Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

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

by rg0now (Chaplain)
on Mar 29, 2005 at 09:23 UTC ( [id://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

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://443076]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-04-19 15:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found