Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: use strict Question?

by SirClive (Scribe)
on Dec 07, 2009 at 12:15 UTC ( #811484=note: print w/ replies, xml ) Need Help??


in reply to Re: use strict Question?
in thread use strict Question?

I think the original poster is referring to the fact that they didn't need my $a or my $b but they did need my $c my $d , etc etc The reason for this is that $a and $b are global variables which are used by the sort function. See perldoc -f sort for more --- start quote ---

If the subroutine's prototype is "($$)", the elements to be compared are passed by reference in @_, as for a normal subroutine. This is slower than unprototyped subroutines, where the elements to be compared are passed into the subroutine as the package global variables $a and $b (see example below). Note that in the latter case, it is usually counter-productive to declare $a and $b as lexicals.

-- end quote ---


Comment on Re^2: use strict Question?
Re^3: use strict Question?
by Anonymous Monk on Dec 07, 2009 at 12:17 UTC
    Thanks SirClive!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (18)
As of 2015-07-01 15:54 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 (6 votes), past polls