Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

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

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 having an uproarious good time at the Monastery: (4)
As of 2016-10-24 08:23 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (304 votes). Check out past polls.