in reply to Open statement
Typically one opens file lie this:
But it's also ok to do thisopen SOME_FH, ">", "somefile" or die "Failed to open somefile. $!"; print SOME_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.my $fh = undef; open $fh, ">", "somefile" or die "Failed to open somefile. $!"; print $fh "Test\n";
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 |