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

Re: strawberry on XP

by mwah (Hermit)
on May 22, 2008 at 10:42 UTC ( [id://687926]=note: print w/replies, xml ) Need Help??


in reply to strawberry on XP

Your program:

use strict; use warnings; use Benchmark; my @junk = `cat /etc/motd`; # not available on windows my $count = 10_000; timethese($count, { 'map' => sub { my @a = @junk; map { s/a/b/ } @a; return @a }, 'for' => sub { my @a = @junk; for (@a) { s/a/b/ }; return @a }, } ); # "my $var = defined(<STDIN>)";

wouldn't work because there's no cat and no /etc/motd available on your box (probably)

Other reasons: there were loads of typos (corrected).

Regards

mwa

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2024-04-19 10:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found