Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: GRT sort of files by time

by salva (Canon)
on Jul 12, 2007 at 08:30 UTC ( [id://626169]=note: print w/replies, xml ) Need Help??


in reply to Re: GRT sort of files by time
in thread GRT sort of files by time

your benchmarking code is wrong:
... my @files=glob '*'; ... cmpthese -30, { map { $_ => "$_(\@files)" } @sub };
@files is a lexical not available from outside its scope. You are actually sorting nothing.

You can solve that bug using a global variable for @files:

... our @files=glob '*'; ... cmpthese -30, { map { $_ => "$_(\@main::files)" } @sub };

Log In?
Username:
Password:

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

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

    No recent polls found