in reply to Re: Why does Perl use dynamic scoping?
in thread Why does Perl use dynamic scoping?
Dunno. I like dynamic scoping. It has some interesting uses. How would do the same as below without it? (Im not saying it cant be done, just that it would be harder)
In order to do the same thing we would have to do that asour $Debug=0; # lots of subs that work sub doesnt_work_quite_right { local $Debug=1; # code that we are trying to debug }
Which is both a PITA and far too reminiscent of debugging VBA for my taste.my $Debug; sub doesnt_work_quite_right { my $olddebug=$Debug; $Debug=1; # code that we are trying to debug $Debug=$olddebug; }
--- demerphq
my friends call me, usually because I'm late....
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Why does Perl use dynamic scoping?
by steves (Curate) on Feb 07, 2003 at 17:41 UTC | |
|
Re: Re: Re: Why does Perl use dynamic scoping?
by Anonymous Monk on Feb 08, 2003 at 00:28 UTC | |
by demerphq (Chancellor) on Feb 08, 2003 at 00:41 UTC | |
|
Re: Re: Re: Why does Perl use dynamic scoping?
by Boots111 (Hermit) on Feb 07, 2003 at 19:05 UTC | |
by demerphq (Chancellor) on Feb 07, 2003 at 22:38 UTC | |
by adrianh (Chancellor) on Feb 07, 2003 at 22:23 UTC | |
by Boots111 (Hermit) on Feb 10, 2003 at 03:50 UTC |