-
-
Save sugyan/3a5e26f4ea89875ccac96dfc78ff4b9c to your computer and use it in GitHub Desktop.
YAPC::Hiroshima 2024 Perlbatross
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
(chop,utf8::decode$_)^print/(\X)\X?/g,$",/\X(\X)/g,$/for<> |
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
map{for$a(18..ord){tr/ab-z/za-y/}print}<> |
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
for(<>){/(\d+).{3} .*?" (.)/;($h[$1]||=[(0)x4])->[$2-2]++}for(@h){print"@$_$/"if$_;last if$_->[3]>10} |
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 v5.10;sub p{pop@s}sub u{push@s,@_}@p=<>;o();sub o{my$a=pop;while(@p>$c){$_=$p[$c++];chop;if($a&&/un/){last if!p();$c=$a;next}s/^=/==/;given($_){when(/[\+\-\*\/%<>=]=?/){$i=p();u eval p().$_.$i}when(/^d/){$i=p();u$i,$i if/dup/}when(/^s/){u p(),p()}when(/\.|cr/){print/cr/?$/:p()}when(/if/){if(p()){o();$c++while$p[$c]!~/then/;$c++}else{$i=1;while($i){$_=$p[$c++];$i++if/if/;$i--if/el/}}}when(/^el|^th/){last if/el/}when(/^b/){o($c)}default{u$_}}}} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment