Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: valid filehandle

by DaveH (Monk)
on Mar 20, 2003 at 23:49 UTC ( #244768=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://244768]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2023-03-23 17:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (60 votes). Check out past polls.

    Notices?