Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
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 studying the Monastery: (14)
As of 2015-07-02 09:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (33 votes), past polls