Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re^2: Add Perl Varibles in system()

by FunkyMonk (Chancellor)
on May 11, 2009 at 22:25 UTC ( [id://763375]=note: print w/replies, xml ) Need Help??


in reply to Re: Add Perl Varibles in system()
in thread Add Perl Varibles in system()

Normally when list context is needed you might say (my $s)=func_returning_list();, with the my on the inside
my ($s) causes list context too.
Note that you would not say my ($x,$y) as that is actually a syntax error.
That works fine here on perl 5.10.0 and on any earlier perl I can remember

$ perl -Mstrict -cwe 'my ($x,$y)' -e syntax OK

Replies are listed 'Best First'.
Re^3: Add Perl Varibles in system()
by John M. Dlugosz (Monsignor) on May 11, 2009 at 23:02 UTC
    I must be getting old. I distinctly remember learning that lesson when Perl 5 was freshly minted. The grammar must have been "improved" since then. You are right about the latter for sure; how many times do I say
    my ($x,$y,$z)= @_; </code? So the <code>my ($x)
    vs (my $x) must be (or have been) something more subtle.
Re^3: Add Perl Varibles in system()
by ikegami (Patriarch) on May 11, 2009 at 23:09 UTC
    I verified that it works as far back as 5.6.0, but I'm sure it worked even before that.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (3)
As of 2025-06-18 03:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.