[ create a new paste ] login | about

Link: http://codepad.org/GvYTuvGI    [ raw code | output | fork ]

Perl, pasted on Dec 29:
1
2
3
4
5
6
7
8
my $path_pusher = sub {
      my @path;
      return sub {push(@path, shift); join('/', @path);};
}->();

print &$path_pusher('hoge'), "\n";
print &$path_pusher('foo'), "\n";
print &$path_pusher('bar'), "\n";


Output:
1
2
3
hoge
hoge/foo
hoge/foo/bar


Create a new paste based on this one


Comments: