Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^3: script to listen on a port & redirect to a file

by VinsWorldcom (Prior)
on Aug 14, 2015 at 19:41 UTC ( [id://1138635]=note: print w/replies, xml ) Need Help??


in reply to Re^2: script to listen on a port & redirect to a file
in thread script to listen on a port & redirect to a file

I think he means:

[...] open my $fh, '>>', $file or die $!; while(<$new_sock>) { print $fh $_; } [...]

Alternatively, just add:

$|++

before the "$sock->accept()" call in your original script and the redirect to file will work.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (6)
As of 2024-04-18 22:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found