[Courses] [Perl] Part 4: Simple File Access

Devdas Bhagat devdas at dvb.homelinux.org
Sat Apr 23 00:23:10 EST 2005


On 22/04/05 14:41 +0100, Dan wrote:
<snip>
> The open statement takes two arguments. The first is a file handle,

Nit: The open function takes one, two or three arguments. See perldoc -f
open for the differences.

<snip>

> The "while" loop continues until "<MY_INPUT>" returns the undefined
> value, which is the signal that we've reached the end of the file.
> (Note: in Perl a "while" loop must be contained in braces, even if it
> only has one statement. The same is true with "if".)

Nit: while, for, foreach and if take a block as a parameter.
while (EXPR) { BLOCK }

{} are block delimiters.

Devdas Bhagat


More information about the Courses mailing list