Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: my $a outside sort block incompatibility

by poolpi (Hermit)
on Feb 23, 2009 at 15:03 UTC ( #745775=note: print w/replies, xml ) Need Help??


in reply to my $a outside sort block incompatibility

I thought I'd previously found a way of using "local" to get around this but I can't reconstruct it now.

#!/usr/bin/perl use strict; use warnings; my @arr1 = ( 1, 3, 5, 2, 4, 6 ); my @arr2; local $a = 'whatever'; { @arr2 = sort { $a <=> $b } @arr1; } print join( ' ', @arr2 ), "\n";


hth,
PooLpi

'Ebry haffa hoe hab im tik a bush'. Jamaican proverb

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://745775]
help
Chatterbox?
[Corion]: Hi marto :)
[Discipulus]: morning marto!
[Corion]: Hmmm - I would have assumed that << is not special in cmd.exe, but maybe it is ...
[karlgoethebier]: Discipulus: Corion may be right... backslash?
[karlgoethebier]: Discipulus: i don't know. no msdog at hand no more
[Eily]: Discipulus I get the same thing on strawberry perl v5.20

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (11)
As of 2017-07-21 08:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (319 votes). Check out past polls.