annotate bin/slashes @ 12320:9c7eb9899d95
draft
<fizzie> le/rn karma//All living beings have actions (karma) as their own, their inheritance, their congenital cause, their kinsman, their refuge. It is karma that differentiates beings into low and high states.
author |
HackEso <hackeso@esolangs.org> |
date |
Fri, 06 Mar 2020 23:08:37 +0000 |
parents |
c989a1669243 |
children |
|
rev |
line source |
9075
|
1 #!/usr/bin/perl -w
|
|
2 #By Ørjan Johansen, 2009-2012. This file is in the public domain.
|
|
3
|
|
4 $| = 1;
|
|
5 my $l = 0;
|
|
6
|
|
7 $_ = join '', <>;
|
|
8 while ($l < 512) {
|
|
9 if (s!^([^/\\]+)!! or s!^\\(.)!!s) {
|
|
10 $l += length($1);
|
|
11 print($1);
|
|
12 }
|
|
13 else {
|
|
14 if (s!^/((?:[^/\\]|\\.)*)/((?:[^/\\]|\\.)*)/!!s) {
|
|
15 my ($s,$d) = ($1,$2);
|
|
16 $s =~ s/\\(.)/$1/gs;
|
|
17 $d =~ s/\\(.)/$1/gs;
|
|
18 while (s/(?:\Q$s\E)/$d/) {
|
|
19 }
|
|
20 }
|
|
21 else { last; }
|
|
22 }
|
|
23 }
|