Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^3: Replaying Santa Claus Golf Apocalypse with Pugs/Perl6

by rg0now (Chaplain)
on Mar 29, 2005 at 09:23 UTC ( #443076=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Replaying Santa Claus Golf Apocalypse with Pugs/Perl6
in thread Replaying Santa Claus Golf Apocalypse with Pugs/Perl6

Quite a strange syntax, I think. And apparently, Pugs thinks so too, because it croaks badly when I try to run your version.

Even though, the fact that neither Pugs nor me seem to recognize this syntax, this does not mean to any extent that it is illegal. If you can recall where you met it, I can definitely make a todo_test out of it for autrijus to implement...

rg0now


Comment on Re^3: Replaying Santa Claus Golf Apocalypse with Pugs/Perl6
Download Code
Re^4: Replaying Santa Claus Golf Apocalypse with Pugs/Perl6
by pdcawley (Hermit) on Mar 29, 2005 at 12:56 UTC
    It's a rubyish thing: Open this and then call the block for every line of the resulting file handle, closing the file at the end. I'd not be surprised if it's a hopeful figment of my imagination.
      Open this and then call the block for every line of the resulting file handle, closing the file at the end.

      Ok, I see. How about this one?

      (=<>)[0..9].print
      This seems to work and it is semantically much closer to what you proposed: it opens the file, calls print (which is not a block, but I think, it could be made one for no good) for each requested line.

      It is an interesting question, whether we could omit the parentheses around =<>. Although Pugs does not seem to like it, I am not entirely sure that [] should bind so tight.

      rg0now

        Shouldn't that be like this?

        (=<>)[0..9].print

        -nuffin
        zz zZ Z Z #!perl

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2014-09-03 05:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (35 votes), past polls