It isn't a bug. It is the feature of Perl where the last statement executed defines the return value. "sub foo {}" doesn't count as a run-time statment.
If you want "sub foo {}" to give back an empty list, then the solution is simple:
$ say '$^D=$^D; sub foo {}' 0 $ say '$^D=$^D; (); sub foo {}' $
- tye
In reply to Re: Hacking Debugger bugs connected to $^D (())
by tye
in thread Hacking Debugger bugs connected to $^D
by LanX
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |