Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re^3: retrieve the value of a system call in a non blocking mode

by young_monk_love_perl (Novice)
on Dec 05, 2013 at 22:22 UTC ( [id://1065854]=note: print w/replies, xml ) Need Help??


in reply to Re^2: retrieve the value of a system call in a non blocking mode
in thread Do not display the command result in the console (updated)

Hi Chris, the result of

echo test > myfile.txt") or die $!;

is to still display the command output in the console as usual, i cannot input anything exept SIGINT or SIGTERM, the screen display is dynamic but it doesn't create lines in the console except spaces and then freeze on the last screen when I kill the program. Maybe this precisions will be helpful.

The .txt is created but it only contains two lines of spaces.

Replies are listed 'Best First'.
Re^4: retrieve the value of a system call in a non blocking mode
by taint (Chaplain) on Dec 06, 2013 at 00:56 UTC
    D'OH! Had a bit of a HOMER moment there. :P

    What I should have put above was

    system("echo test > myfile.txt" or die $!); system("cat myfile.txt" or die $!);
    NOTE: the misplaced paren in my earlier post.
    sorry 'bout that.

    --Chris

    UPDATE: I should probably mention, that it might be more elegant to test the existence of the file myfile.txt before cattting it, rather than dieing. If interested. I'd post an example.
    Hey. I'm not completely useless. I can be used as a bad example.
    

      Sure, thank you taint I'm very interested by an example. Also are there some books you could recommend me about Perl ?

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2024-04-24 11:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found