Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Re: Re: (OT) The Schwartzian Transform in Java

by demerphq (Chancellor)
on Jun 15, 2003 at 13:15 UTC ( [id://266021]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    @newfiles=@files.map([-s($_),$_]).sort($a->[0]<=>b->[0]).map(pop @$_);
    
  2. or download this
    use strict;
    use warnings;
    ...
       @$ret=reverse @$self;
       wantarray ? @$ret : $ret
    }
    
  3. or download this
    package main;
    my @x=Array->new( qw( bb cccc ddd aaaaa fffff qqq xxx iiiii ) )
    ...
               ->map('pop @$_');
    
    print "@x";
    
  4. or download this
    @sorted_by_size = 
      map  { pop @$_ } 
      sort { $a->[0] <=> $b->[0] } 
      map  { [-s $_ , $_ ] } 
      @files;
    
  5. or download this
    @sorted_by_ext_name_size =
      map  { pop @$_ }
    ...
    
    print join(",\n",@files);
    print join(",\n",@sorted_by_ext_name_size);
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2024-04-23 12:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found