Hi Paul,
"Paul Morris" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi > > #!/usr/bin/perl > use strict; > $a = 123; #slips through strict > $b = 123; #slips through strict > $c = 123; #caught by strict > > Is there any reason (apart from convenience) why 'a' and 'b' should get > past "use strict" here? > $a and $b are special variables used when defining your own sorting algorithms (perldoc -f sort), I guess that's why strict doesn't mind. here's a quick example of how you could use them... #!/perl -w use strict; my @array = ("1", "2", "3"); print join(",", @array) . "\n"; @array = sort {$b <=> $a} @array; print join(",", @array) . "\n"; > Obviously, one would desire to have meaningful variable names, but...? > > (I'm using 5.6.1 built for MSWin) > > Thanks, Paul > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
