Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

Re: Backticks and SIGALRM

by zentara (Archbishop)
on Aug 20, 2007 at 11:58 UTC ( #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

Comment on Re: Backticks and SIGALRM
Download Code
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! ;)

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

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (7)
As of 2015-11-29 14:06 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (751 votes), past polls