Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: How do I un-map this code?

by jwkrahn (Abbot)
on Mar 21, 2008 at 21:16 UTC ( [id://675529]=note: print w/replies, xml ) Need Help??


in reply to How do I un-map this code?

Because the function is only returning one item from the list there is no reason to iterate through and sort the entire list:

sub _file_containing { my ( $self, $id ) = @_; opendir my $dir, $self->{ update_dir } or return; my $ret; while ( my $file = readdir $dir ) { next if $file !~ /^\d+$/ || $file > $id; $ret = $file if $ret < $file; } return "$self->{update_dir}/$ret"; }

Log In?
Username:
Password:

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

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

    No recent polls found