ghenry has asked for the wisdom of the Perl Monks concerning the following question:
Update: I asked this in the CB, but wanted to keep a record of it here for other inexperienced Monks like myself.
In Downloading a lot of files yesterday, I did the classic or die whilst opening a file, as per most code I've ever seen.
However, in the perlfaq, How can I read in an entire file all at once? I see a lot of || dieIn Downloading a lot of files, I use:
open( RPMS, "<", "./upgrade.log" ) or die "can't open file: $!\n";
but in perlopentut - Simple Opens it shows
open( INFO, ">", $datafile ) || die "Can't create $datafile: $!";
Which way is the best and why?
Thanks,
Gavin.
Walking the road to enlightenment... I found a penguin and a camel on the way.....
Fancy a yourname@perl.me.uk? Just ask!!!
Fancy a yourname@perl.me.uk? Just ask!!!
Back to
Seekers of Perl Wisdom