Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Backticks and SIGALRM

by zentara (Archbishop)
on Aug 20, 2007 at 11:58 UTC ( [id://633780]=note: print w/replies, xml ) Need Help??


in reply to Backticks and SIGALRM

You might try qx instead of backticks.
#!/usr/bin/perl # qx does interpolation too # generalized form for using backticks $output=qx(ls -la); print "$output\n"; $output = `ls`; print "$output\n";

I'm not really a human, but I play one on earth. Cogito ergo sum a bum

Replies are listed 'Best First'.
Re^2: Backticks and SIGALRM
by halley (Prior) on Aug 20, 2007 at 16:12 UTC
    It is useful to remember that qx// is backticks. It's just another syntax to get there. It doesn't exercise any different code path, it won't behave any different, except how the parser finds the end of the string (you could type qx/foo `blah`/ without needing special escape characters to get the backquotes into the shell).

    Also, q// is single-quoted, and qq// is double-quoted. Same thing.

    --
    [ e d @ h a l l e y . c c ]

Re^2: Backticks and SIGALRM
by nemo (Sexton) on Aug 20, 2007 at 12:53 UTC
    Thank you for your replies.
    I attempted the solution using qx but I had the same result. Executing the command using the shell seems to be the problem, the sigalrm is not delivered. It's an interesting problem I haven't come across before.
    I was considering using system to redirect the output of the command to a temporary text file and then reading the tmp file to parse output one line at a time.
    I should also mention I am working on Win32 Boo! ;)

    Nemo
Re^2: Backticks and SIGALRM
by ikegami (Patriarch) on Aug 21, 2007 at 14:53 UTC
    qx and `` produce the same code.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-03-29 10:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found