Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: ColorRamp1785

by Lawliet (Curate)
on Nov 19, 2008 at 20:11 UTC ( #724707=note: print w/ replies, xml ) Need Help??


in reply to ColorRamp1785

my @map = sort{ $a <=> $::b } keys %map;

Why bother using $::b? I thought it was just shorthand for $main::b (and $::main::b and so on :P).

I'm so adjective, I verb nouns!

chomp; # nom nom nom


Comment on Re: ColorRamp1785
Select or Download Code
Replies are listed 'Best First'.
Re^2: ColorRamp1785
by BrowserUk (Pope) on Nov 19, 2008 at 20:26 UTC

    Because I'm using my $b for one of the rgb triple, and without the ::, perl will see that and attempt to use it instead of $::b, and fail with Can't use "my $b" in sort comparison. I guess I should have used $::a for balance--and now have.


    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

      Oh, I see. Thanks for explaining it to me (",)

      (And you should update the lone subroutine at the top of the node too). Err, you did while I was posting :P

      I'm so adjective, I verb nouns!

      chomp; # nom nom nom

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (12)
As of 2015-07-30 17:42 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 (273 votes), past polls