Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Replaying Santa Claus Golf Apocalypse with Pugs/Perl6

by rg0now (Chaplain)
on Mar 12, 2005 at 17:55 UTC ( #438961=note: print w/ replies, xml ) Need Help??


in reply to Replaying Santa Claus Golf Apocalypse with Pugs/Perl6

And here is my masterpiece for today, wc.p6:

say*(split"",int(7e10+ +*(=open@ARGS[0])))[1..11]
Just a quick explanation about +*(=open@ARGS[0]): the * operator forces the = $filehandle operator into list context, which is then forced into scalar context to count the number of lines in the file. Similar idea is used right after say, to force the ourput of split[] into list context without the use of join.

Update: And of course, head.p6 along similar lines:

print*(=open@ARGS[0])[0..9]

rg0now


Comment on Re: Replaying Santa Claus Golf Apocalypse with Pugs/Perl6
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (13)
As of 2014-07-31 18:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (251 votes), past polls