Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Re: parent wants to capture output from a spawned child

by perlknight (Pilgrim)
on Nov 26, 2001 at 01:04 UTC ( [id://127422]=note: print w/replies, xml ) Need Help??


in reply to Re: parent wants to capture output from a spawned child
in thread parent wants to capture output from a spawned child

Thanks for the help, I ended up using "open" instead of "pipe" because pipe was slower (not sure if I am doing something wrong with it). Quick follow up question? I notice "push @msgs, <$_> for values %kids" deference the filehandle where as something like: " for (values %kids) { print "<$_>\n"; }" returns a ref. Is my assumption correct?
  • Comment on Re: Re: parent wants to capture output from a spawned child

Replies are listed 'Best First'.
Re: Re: Re: parent wants to capture output from a spawned child
by Zaxo (Archbishop) on Nov 26, 2001 at 02:02 UTC

    Nearly right. In push @msgs, <$_> for values %kids; the diamond operator is evaluated in list context, giving you all messages. In print "<$_>\n"; the diamond is not evaluated inside double quotes. Instead, you get literal '<' followed by the interpolated $_, then literal '>'. $_ is a filehandle, a stringified ref to a typeglob is printed. You can do what I think you want with print "@{[<$_>]}\n"; or just print <$_>;

    After Compline,
    Zaxo

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (4)
As of 2024-04-25 05:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found