Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

(MeowChow) Re: Mixing Up a Text File

by MeowChow (Vicar)
on Jun 02, 2002 at 08:02 UTC ( [id://170996]=note: print w/replies, xml ) Need Help??


in reply to Mixing Up a Text File

Reiterating an old solution:
perl -ne'splice@l,rand$.,0,$_}{print@l'
or more readably:
my @lines; splice @lines, rand $., 0, $_ while <>; print @lines;
   MeowChow                                   
               s aamecha.s a..a\u$&owag.print

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-04-19 12:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found