Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: Golf: ROT-n

by tilly (Archbishop)
on Nov 09, 2004 at 19:31 UTC ( #406451=note: print w/replies, xml ) Need Help??


in reply to Re: Golf: ROT-n
in thread Golf: ROT-n

This generates an error on Perl 5.8.4 (Can't modify constant item in postincrement).

I thought about a couple of variants of this idea (not this one though) but didn't find a way to get the stroke count low. Particularly not on my version of Perl.

Replies are listed 'Best First'.
Re^3: Golf: ROT-n
by BrowserUk (Pope) on Nov 09, 2004 at 19:42 UTC

    Strange. The output I showed was using 5.8.4 (AS810)

    [19:39:27.71] P:\test>perl -v This is perl, v5.8.4 built for MSWin32-x86-multi-thread (with 3 registered patches, see perl -V for more detail) Copyright 1987-2004, Larry Wall Binary build 810 provided by ActiveState Corp. http://www.ActiveState. +com ActiveState is a division of Sophos. Built Jun 1 2004 11:52:21 Perl may be copied only under the terms of either the Artistic License + or the GNU General Public License, which may be found in the Perl 5 source ki +t. Complete documentation for Perl, including FAQ lists, should be found +on this system using `man perl' or `perldoc perl'. If you have access to + the Internet, point your browser at http://www.perl.com/, the Perl Home Pa +ge. [19:40:24.59] P:\test>perl -e"die map{($i)=@ARGV;$_++while$i--;chop}sp +lit'',pop" 4 pqrstuvwxyz tuvwxyzabcd at -e line 1.

    I saw your for tr version just after I posted which is in a similar vien but much shorter. Nice work++.


    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
      Ah, quoting issue on Linux. y/'"/"'/ and all is fine.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://406451]
help
Chatterbox?
[1nickt]: tobyink perl -MTypes::Standard= is_Int -Mstrict -wE 'say 1 if is_Int 1.0'
[jdporter]: so that I can use the existing expand unix util. Otherwise, I'll probably use Text::Tabs.
[1nickt]: pryrt I guess I don;t really care if user 42 logs on as 42.0 ... more of an academic question at this point.
[LanX]: jdporter: open PIPE,'-|' ?
[LanX]: oh you want the result line by line?
[jdporter]: ok, LanX, then what?
[jdporter]: It doesn't have to be line by line. Just "my program" "writes" to the external prog and also/then "reads" from it.
LanX open (You are not allowed to open to a command that pipes both in and out, but see IPC::Open2, IPC::Open3, and Bidirectional Communication with Another Process in perlipc for alternatives.)
[jdporter]: IPC::Open2, I guess
[jdporter]: yes, that

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (11)
As of 2017-05-24 20:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?