mpettis has asked for the wisdom of the Perl Monks concerning the following question:
Update: -- Thank you all very much... I am going to hack in Anonymous Monk's solution, and investigate the other two to see if they will work, as, per blazar, I really DON'T want to pass parameters to sort.
Thanks,
=========================================
Hi,
I want to build a sorting sub within a 'for' loop that is different based on a value within the scope of the 'for' loop. Can this be done? The variables I use in the sub do not seem to be visible within the customized sorting sub. I know that $a and $b are passed automatically to this function -- is there a way to pass in other arguments to the sorting sub other than $a and $b?
Thanks,
Matt
Thanks,
=========================================
Hi,
I want to build a sorting sub within a 'for' loop that is different based on a value within the scope of the 'for' loop. Can this be done? The variables I use in the sub do not seem to be visible within the customized sorting sub. I know that $a and $b are passed automatically to this function -- is there a way to pass in other arguments to the sorting sub other than $a and $b?
Thanks,
Matt
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: sorting function arcument to 'sort': Can I pass additional parameters?
by Anonymous Monk on Nov 10, 2008 at 04:35 UTC | |
Re: sorting function arcument to 'sort': Can I pass additional parameters?
by f00li5h (Chaplain) on Nov 10, 2008 at 06:12 UTC | |
Re: sorting function arcument to 'sort': Can I pass additional parameters?
by blazar (Canon) on Nov 10, 2008 at 10:22 UTC |
Back to
Seekers of Perl Wisdom