Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: How do I write to a file?

by DigitalKitty (Parson)
on Apr 07, 2002 at 22:11 UTC ( [id://157320]=note: print w/replies, xml ) Need Help??


in reply to How do I write to a file?

A good idea when writing to a file is to include a space between the filename and the direction symbol. Like this:

open(FH, "> sample.txt") or die("Cannot write to file: $!\n");

Perl will ignore the extra space between the '>' and the filename. It is useful in preventing unexpected results.
-DigitalKitty

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-25 13:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found