perl_noob_101 has asked for the wisdom of the Perl Monks concerning the following question:
I had a question about file handles. I wanted to know the difference between the following two methods and wanted to know if one was better than the other and why
open SHAKESPEARE, "complete_works.txt" or die "The haunted grave of Shakespeare won't open: $!";
$sh = *SHAKESPEARE; open $sh, "complete_works.txt" or die "The haunted grave of Shakespeare won't open: $!";
P.S: When I tried the first method, I got an error (Inappropriate I/O control operation), but not when I used the second.
Thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl fIle handles
by 7stud (Deacon) on Jun 15, 2011 at 20:44 UTC | |
|
Re: Perl fIle handles
by wind (Priest) on Jun 15, 2011 at 16:58 UTC | |
by mikeraz (Friar) on Jun 15, 2011 at 17:16 UTC | |
by wind (Priest) on Jun 15, 2011 at 17:55 UTC | |
by lidden (Curate) on Jun 16, 2011 at 06:21 UTC | |
by wind (Priest) on Jun 16, 2011 at 22:17 UTC | |
|
Re: Perl fIle handles
by 7stud (Deacon) on Jun 15, 2011 at 20:45 UTC |