Skip to content

Instantly share code, notes, and snippets.

@nicomen
Last active May 28, 2016 01:25
Show Gist options
  • Save nicomen/16fadd89e3ad10cd053f1f63f92f420a to your computer and use it in GitHub Desktop.
Save nicomen/16fadd89e3ad10cd053f1f63f92f420a to your computer and use it in GitHub Desktop.
Some weird with that }; ?
$ cat test.pl
#!/usr/bin/perl -dl
{
use DB;
*DB::DB = sub {
my ($p, $f, $l) = caller;
print "> " . @{"::_<$f"}[$l] unless caller(1);
};
};
*foo = sub {
"bar";
};
print foo();
$ perl test.pl
Loading DB routines from perl5db.pl version 1.49
Editor support available.
Enter h or 'h h' for help, or 'man perldebug' for more help.
> };
> print foo();
bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment