Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: map grep and sort

by Tux (Monsignor)
on May 25, 2013 at 12:39 UTC ( #1035250=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
      my @img = map  { $_->[0] }
                sort { $tsort{$Option{thumbsorting}}->() }
    ...
                # convert can't deal with .ico files (yet)
                # Tk can deal with Tiff/NEF as of 804.027_501 with Tk::TIF
    +F
                grep m/\.(jpe?g|gif|x[pb]m|png|bmp|tiff?|nef)$/i => @file_
    +names;
    
  2. or download this
    @out = map substr ($_, 1 + rindex $_, "\0") =>
           sort =>
           map "\L$_\E\0$_" =>
           @in;
    
  3. or download this
    # sort file names by the (first) sequence of digits, then by size
    my @sorted = map  { $_->[0],
    ...
                 map  { m/(\d+)/; # sort by digits in file name
                        [ $_, pack "l>l>", $1 || 0, -s $_ ] }
                 @filelist;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (13)
As of 2014-04-17 10:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (444 votes), past polls