in reply to Still blurry on variables for filehandles

The issue comes from assigning $foo to the string 'FILE'. As others have mentioned, you can call open on an undefined scalar lvalue and it will magically assign a filehandle to it. If you are so inclined, you can also do it explicitly yourself:
use IO::File; my $foo = new IO::Handle; open $foo, '<', 'data.txt';
Update: switched modules per ikegami's suggestion.

Replies are listed 'Best First'.
Re^2: Still blurry on variables for filehandles
by ikegami (Patriarch) on Jan 24, 2007 at 17:12 UTC
    I'd use IO::File over FileHandle. FileHandle is a backwards compatibility wrapper for IO::File.