Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: my $1

by grinder (Bishop)
on Apr 23, 2009 at 20:34 UTC ( #759656=note: print w/ replies, xml ) Need Help??


in reply to Re: my $1
in thread my $1

perl -e 'my $_ = 1' Can't use global $_ in "my" at -e line 1, near "my $_ "

That's just your copy of perl, which is too old :) Works fine in 5.10.

• another intruder with the mooring in the heart of the Perl


Comment on Re^2: my $1
Re^3: my $1
by almut (Canon) on Apr 23, 2009 at 20:44 UTC

    ...ah, you're right, I had tried with 5.8.8.

    (/me wonders what that change is supposed to be good for... :)

Re^3: my $1
by codeacrobat (Chaplain) on Apr 23, 2009 at 20:47 UTC
    Baah, this gives me creeps.
    perl -e '@foo = map {$_=2; foo()} 1..10; sub foo{print}' 2222222222 $ perl -e '@foo = map {my $_=2; foo()} 1..10; sub foo{print}' 12345678910

    print "just another perl5.8 hacker"
      Baah, this gives me creeps.
      Does this give you also the creeps?
      $ perl -e 'for $x (1 .. 9) {$x = 2; foo ()} sub foo {print $x}' 222222222 $ perl -e 'for $x (1 .. 9) {my $x = 2; foo ()} sub foo {print $x}' 123456789
      Or is it the fact that Perl just got a little bit more regular that creeps you out?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (17)
As of 2015-07-07 14:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (88 votes), past polls