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

Re: Ranking files, largest to smallest

by prasadbabu (Prior)
on May 27, 2008 at 05:31 UTC ( [id://688598]=note: print w/replies, xml ) Need Help??


in reply to Ranking files, largest to smallest

Hi ewexperts,

Change

my @lines = <FILE>; chop(@lines); foreach my $str (@lines) { chomp(@lines); }
into chomp (@lines = <FILE>);

Here chop is not necessary to remove the newline character, it ll remove the last character, not only newline character. Instead you can use chomp which removes only the newline character at the end.

Prasad

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2026-02-15 10:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.