[Home]ReadFileOrDie

UseModWiki | RecentChanges | Preferences

Functions : ReadFileOrDie /Code

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:

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




UseModWiki | RecentChanges | Preferences
Edit text of this page | View other revisions | Search MetaWiki
Last edited February 16, 2004 8:05 pm by TarQuin (diff)
Search: