Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Opens but Won't Write to file

by Joost (Canon)
on Oct 30, 2009 at 20:58 UTC ( #804216=note: print w/ replies, xml ) Need Help??


in reply to Opens but Won't Write to file

open() and print() return a true value when they succeed. Either your open call isn't succeeding or your prints arent working (maybe you're running out of disk space?)

In either case, you should ALWAYS check that open() succeeds, and it's probably a good idea to check print() too:

open FH,">","whatever" or die "Can't open whatever: $!";
is the standard procedure.


Comment on Re: Opens but Won't Write to file
Download Code
Replies are listed 'Best First'.
Re^2: Opens but Won't Write to file
by Bloodnok (Vicar) on Oct 30, 2009 at 23:09 UTC
    I commend your suggestions, wrt the testing of the success (or otherwise) of calls, to the house.

    I would, however, debate your suggestion that ...your open call isn't succeeding... since the OP 'sees' a new file on each run - ergo, it strikes me that, as other, for more learned monks, have already pointed out elsewhere on this thread, the OP is suffering from buffering.

    A user level that continues to overstate my experience :-))

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (10)
As of 2015-07-31 04:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (274 votes), past polls