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

Re: How to output backtick or qx to a variable and STDOUT at the same time?

by Utilitarian (Vicar)
on Nov 20, 2012 at 08:39 UTC ( #1004674=note: print w/ replies, xml ) Need Help??


in reply to How to output backtick or qx to a variable and STDOUT at the same time?

What I suspect your tutor wants you to prove you understand is that assignment returns the value assigned on success.
Try the following

perl -e 'print $out=qx(ls );print "+" x 80 , "\n";print $out'
print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."


Comment on Re: How to output backtick or qx to a variable and STDOUT at the same time?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (8)
As of 2014-11-28 12:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (196 votes), past polls