Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: How do I write to a file?

by DigitalKitty (Parson)
on Apr 07, 2002 at 22:11 UTC ( #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
Node Status?
node history
Node Type: note [id://157320]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2021-04-12 16:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?