Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Reordering array contents alphanumerically

by abachus (Monk)
on Jan 29, 2007 at 17:47 UTC ( #597139=perlquestion: print w/replies, xml ) Need Help??

abachus has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.
  • Comment on Reordering array contents alphanumerically

Replies are listed 'Best First'.
Re: Reordering array contents alphanumerically
by ikegami (Patriarch) on Jan 29, 2007 at 17:56 UTC

    There is the sort command.

    my @unsorted = sort @sorted;

    and its quite large

    If the left-hand size and right-hand side of sort is the same array, I heard the sort is done in-place.

    @array = sort @array;
Re: Reordering array contents alphanumerically
by ww (Archbishop) on Jan 29, 2007 at 17:57 UTC
    Welcome to the Monastery.

    But, please, SEARCH before reposting elementary questions   26 Jun 2001; numerous others will be found if one adds "sort" to a search for "alphanumeric").

    That leaves those with answers more time to assist with not_quite_so_elementary questions.
Re: Reordering array contents alphanumerically
by perrin (Chancellor) on Jan 29, 2007 at 19:03 UTC

      You're right, its elementary. I'd forgot sort() existed. And i should have read the faq. I'm constantly amazed by my own laziness and stupidity :)

      thanks though, my question has been answered !
        You can list your simple knowledge about Perl. It would take a few minutes initially, but you would be very productive comparatively. You will be amazed by your productivity.
        Alphanumerical sorting actually puts numbers first and alphabetic characters latter.
        --Artist

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2022-10-05 03:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My preferred way to holiday/vacation is:











    Results (20 votes). Check out past polls.

    Notices?