Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: File operations

by GotToBTru (Prior)
on Nov 20, 2015 at 13:28 UTC ( [id://1148231]=note: print w/replies, xml ) Need Help??


in reply to File operations

Are you sure there is anything in $content? One way to check would be to use the debugger.

Update: as a general thing, simultaneous read and write access to a file gets messy. Also, not sure, but your use of DATA as the file handle might be causing trouble as well; it's a special word.

use strict; use warnings; open my $fh,'>>','logname' or die "Could not open logname"; while (1) { my $content = $rh->cmd(...); if (defined $content) { print $fh $content } else { print 'Nothing to be done!' } sleep 1; } close $fh;
Dum Spiro Spero

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-04-20 08:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found