Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: yet another sort issue

by Tomte (Priest)
on Jun 23, 2003 at 11:46 UTC ( #268117=note: print w/replies, xml ) Need Help??


in reply to yet another sort issue

You should probably read up what qw is doing:

perl -MData::Dumper -e 'print Dumper([qw(1 2)]);'; $VAR1 = [ '1', '2' ];
vs.
perl -MData::Dumper -e 'print Dumper([1,2]);'; $VAR1 = [ 1, 2 ];

You are in fact comparing strings :), but that doesn't matter.
As numbers are always completly valid as string-value and the internal conversion is almost always what you want, this is maybe one if the times where DWIM instead of DWIT is biting you in the privat parts...

regards,
tomte


Hlade's Law:

If you have a difficult task, give it to a lazy person --
they will find an easier way to do it.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2023-05-28 05:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?