General Description of function:
ReadFileOrDie reads in a file (from a passed filename)
if the file can't be opened, then the function calls
Die with arg: 'Can not open %s'
Given input
Given:
- first arg is $filename
Returns results
Returns:
- $data from file
Uses variables
Uses:
- $NAME?
Flow of Control of function:
Subtleties in code
The
$!
in the following code is a special Perl variable that holds information about the error. It can also be called $ERRNO.
[1]
die(Ts('Can not open %s', $fileName) . ": $!");
Global variables:
- $status?
- Typical Contents : 1 or 0
- General kind of contents : number for success of read
- $data?
- Typical Contents : the result of reading in a file
- Default value :
- General kind of contents :
Special terms to describe function's actions
Notes/Observations?:
Questions:
Fixes to bugs in code:
fixed code
Suggestions to improve code:
suggested code
Sample output from function:
actual output