Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Golf Challenge: FizzBuzz

by tweetiepooh (Friar)
on Jun 02, 2009 at 15:25 UTC ( #767637=note: print w/replies, xml ) Need Help??


in reply to Re^2: Golf Challenge: FizzBuzz
in thread Golf Challenge: FizzBuzz

#2345678901234567890123456789012345678901234567 warn+(Fizz)[$_%3].(Buzz)[$_%5]||$_,$/for 1..100
also works with one fewer characters.
#2345678901234567890123456789012345678901234 perl -M5.01 -e 'say+(Fizz)[$_%3].(Buzz)[$_%5]||$_,for 1..100'
But this isn't really golf since you need to add -M5.01 to the calling statement.

Replies are listed 'Best First'.
Re^4: Golf Challenge: FizzBuzz
by shmem (Canon) on Jun 02, 2009 at 18:28 UTC

    As you can see from the date of the post to which you answered, it was written previous to the release of perl5.10 - there is no 'say' in 5.8.8...

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://767637]
help
Chatterbox?
[choroba]: On the other hand, lots of options to receive the requests :-)
[Corion]: ... values to be used. For example, I think for headers, one would want to have various kinds of Content-Encoding headers, but for the get_parameters one would have various kinds of Bobby Tables
[choroba]: What about [metadoc:// Algorithm::Loops]?
[Corion]: choroba: Yeah, but handing off the request to Dancer,Plack, Mojolicious,LWP is easy once I have the data filled into some structure ;))
[choroba]: Algorithm::Loops
[Corion]: choroba: I'm using that to generate the permutations, but I don't know how the user can pass the intended values to my function in a sane way
[Corion]: I have a prototype that permutes the get_parameters, but the values used for the get parameters should be different from the values used for the headers and potentially for parts of the URL
[Corion]: But yes, in general, my approach will be "split the URL into another set of parameters, generate an array of allowed values for each parameter and then NestedLoops() over the set"
[choroba]: hmm... so you need something like bag from Test::Deep, but not for checking, but for generation
[Corion]: This has the dual use of easily requesting sequential URLs and also being suitable for testing

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (9)
As of 2017-01-17 08:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (152 votes). Check out past polls.