[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] <> warning



When I run a program containing the following lines,

    while ($line = <IN_FILE>) {
        print $line;
    }

I get the following warning,

# Value of <HANDLE> construct can be "0"; test with defined().
File 'Untitled'; Line 10

The reason I am using $line is that I have another file opened and don't
want to alter the $_ variable. This construct is in the MacPerl P&E book,
so I assume it is commonly used.

The program executes properly, but I am bothered by the warning. What does
the warning mean? Is there a better way to write this code?


William B. Birkett
Precision Color, Inc.
9200 General Drive
Plymouth, MI 48170 (USA)

Phone: (734) 459-5640
FAX:   (734) 459-4210




***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch