in reply to Open statement

When opening a file you can either specify the filehandle, or you can provide an undefined scalar (or existing reference) - which will then hold an anonymous reference to a newly created filehandle.

Typically one opens file lie this:

open SOME_FH, ">", "somefile" or die "Failed to open somefile. $!"; print SOME_FH "Test\n";
But it's also ok to do this
my $fh = undef; open $fh, ">", "somefile" or die "Failed to open somefile. $!"; print $fh "Test\n";
In the code you listed the programmer chose the second option, but instead of declaring a lexical variable to keep the filehandle in, he uses the variable named $XFORM_FILE in the AB package.

You can read more about packages here

Replies are listed 'Best First'.
Re^2: Open statement
by erniep (Sexton) on Jul 21, 2006 at 12:08 UTC
    Thanks loads.. I did read the open docs but missed the meaning of not opened (i guess I scanned the doc rather than read)..