Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

TIMTOWTDI and other languages

by Ovid (Cardinal)
on Apr 28, 2002 at 20:35 UTC ( #162711=perlmeditation: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
    use strict;
    ...
    }
    @results = sort { $a <=> $b } @results;
    print "Linear search: @results\n";
    
  2. or download this
    my @alphas = qw/ 9 4 3 2 22  13 7  140 95 278/;
    my @betas  = qw/ 8 3 4 1 278 94 15 7   19 200/;
    ...
    
    @results = sort { $a <=> $b } @results;
    print "Hash lookup:   @results\n";
    
  3. or download this
    my @alphas = qw/ 9 4 3 2 22  13 7  140 95 278/;
    my @betas  = qw/ 8 3 4 1 278 94 15 7   19 200/;
    ...
            return undef;
        }
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://162711]
Approved by robin
Front-paged by robin
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (4)
As of 2014-09-22 05:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (178 votes), past polls