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

Re: pass subroutine value to scalar

by dpuu (Chaplain)
on Jan 12, 2006 at 02:46 UTC ( #522605=note: print w/ replies, xml ) Need Help??


in reply to pass subroutine value to scalar

The subroutine as your have coded it doesn't actually have a meaningful return value. The problem is that the "system" command does not capure the output text of the command. Perl has a different operator for that:
sub ctrl { return qx/xmmsctrl print %T/; } my $ctrl = ctrl();
The qx operation could also be written using backticks:
sub ctrl { return `xmmsctrl print %T`; }
--Dave
Opinions my own; statements of fact may be in error.
Comment on Re: pass subroutine value to scalar
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (13)
As of 2016-04-29 12:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    :nehw tseb si esrever ni gnitirW







    Results (441 votes). Check out past polls.