Created
March 9, 2016 06:47
-
-
Save neontorrent/652d1e3e58e7b20c22bc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use warnings; | |
use strict; | |
$_ = 'abcdefghi'; | |
# s/./ substr $_, -$+[0], 1 /eg; # duh, substr and array | |
# s#.# /(.).{$-[0]}$/; $1 #eg; # duh, array | |
my $x = 0; s#.# /(.).{$x}$/; $x++; $1 #eg; | |
print "$_\n"; | |
my @a = split //, shift; | |
print "INPUT = <@a>"; | |
# @a[0..$#a] = @a[map -1-$_, 0..$#a]; | |
@a[$_,~$_] = @a[~$_,$_] for 0..$#a/2; | |
print "OUTPUT = <@a>"; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment