Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

TIMTOWTDI and other languages

by Ovid (Cardinal)
on Apr 28, 2002 at 20:35 UTC ( [id://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
Domain Nodelet?
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?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2024-03-28 22:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found