Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Golf: ROT-n

by borisz (Canon)
on Nov 09, 2004 at 20:38 UTC ( #406485=note: print w/ replies, xml ) Need Help??


in reply to Golf: ROT-n

1234567890123456789012345678901234567890 $_=pop;for$x(1..pop){y/a-z/b-za/}print
Length 38
1234567890123456789012345678901234567890 $_=pop;y/a-z/b-za/for$x(1..pop);print
Length 37, but does not work, why?

Boris

Edited by Chady -- code tags.


Comment on Re: Golf: ROT-n
Select or Download Code
Re^2: Golf: ROT-n
by BrowserUk (Pope) on Nov 09, 2004 at 20:50 UTC
    perl -we" $_=pop;y/a-z/b-za/for$x(1..pop);print" syntax error at -e line 1, near "$x("

    Examine what is said, not who speaks.
    "Efficiency is intelligent laziness." -David Dunham
    "Think for yourself!" - Abigail
    "Memory, processor, disk in that order on the hardware side. Algorithm, algorithm, algorithm on the code side." - tachyon
      I know, I asked what is wrong with that line?
      Boris

        The statement-modifier form of for/foreach doesn't allow you to specify a variable. You're forced to either use $_ or use the regular form with curlies. Sucks, don't it?

        "There is no shame in being self-taught, only in not trying to learn in the first place." -- Atrus, Myst: The Book of D'ni.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (13)
As of 2015-07-02 12:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (37 votes), past polls