question about sort()

From: Wiseguy (noone_at_uber.usachoice.net)
Date: 03/04/05

  • Next message: Philip Salgannik: "Re: [ANN] j2Perl 2.0 - Allowing Java to access Perl code"
    Date: 3 Mar 2005 22:29:26 -0600
    
    

    OK. I need to sort a list and I have the following code

            @L=(35,10,0,27,100,-4);
            sub numeric { $A <=> $b; }
            @L=sort numeric @L;

    The only reference I have is an ancient Oreilly book on Perl 4.
    does sort() actually sort the operand list or only return a sorted list?
    Is it safe to use the source operand as the return value of sort() as well?

    ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
    http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
    ----= East and West-Coast Server Farms - Total Privacy via Encryption =----


  • Next message: Philip Salgannik: "Re: [ANN] j2Perl 2.0 - Allowing Java to access Perl code"

    Relevant Pages