Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Things I have learnt

by davido (Archbishop)
on Oct 22, 2004 at 03:40 UTC ( #401366=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @sorted = sort { substr( $a, 1 ) cmp substr( $b, 1 ) } @unsorted;
    
  2. or download this
    @original       |                @transform
                    |               [0]          [1]
    ...
    qwert           |               qwert        wert
    uiop            |               uiop         iop
    
  3. or download this
    @original = qw/abc asdf jkas qwert uiop/;
    
  4. or download this
    @transformed = ( [ 'abc'  ,  'bc'   ],
                     [ 'asdf' ,  'sdf'  ],
                     [ 'jkas' ,  'kas'  ],
                     [ 'qwert',  'wert' ],
                     [ 'uiop' ,  'iop'  ]  );
    
  5. or download this
    my @sorted = map { $_->[0] }
                     sort { $a->[1] cmp $b->[1] }
                         map { [ $_, substr( $_, 1 ) ] }
                             @unsorted;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2014-09-21 08:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (168 votes), past polls