in reply to valid filehandle
Hi.
I'd use some variation of IO::File or IO::Handle. e.g.
use IO::File; my $fh = IO::File->new("<test.txt"); if (!$fh) { #do something print "my file didn't open\n"; } else { #use $test to print something print "my file did open\n"; while (<$fh>) { # ... } }
I hope that helps.
Cheers,
-- Dave :-)
$q=[split+qr,,,q,~swmi,.$,],+s.$.Em~w^,,.,s,.,$&&$$q[pos],eg,print
In Section
Seekers of Perl Wisdom