[EMAIL PROTECTED] wrote:
>  --- PerlRun.pm       2001/01/12 15:45:12     1.34
>  +++ PerlRun.pm       2001/01/29 21:51:30     1.35
>  @@ -340,7 +340,12 @@
>           if (defined &$fullname) {
>               no warnings;
>               local $^W = 0;
>  -            *{$fullname} = sub {};
>  +            if (my $p = prototype $fullname) {
>  +                eval "*{\$fullname} = sub ($p) {}";
>  +            }
>  +            else {
>  +                *{$fullname} = sub {};
>  +            }
>           undef &$fullname;


I know it's a nitpick, but the following is a bit faster (about 35%
faster according to Benchmark) and a little clearer to read:

==========================================================
  --- PerlRun.pm        2001/01/12 15:45:12     1.34
  +++ PerlRun.pm        2001/01/29 21:51:30     1.35
  @@ -340,7 +340,12 @@
           if (defined &$fullname) {
               no warnings;
               local $^W = 0;
  -            *{$fullname} = sub {};
  +            if (my $p = prototype $fullname) {
  +                *{$fullname} = eval "sub ($p) {}";
  +            }
  +            else {
  +                *{$fullname} = sub {};
  +            }
            undef &$fullname;
        }
           if (*{$fullname}{IO}) {
==========================================================

  -------------------                            -------------------
  Ken Williams                             Last Bastion of Euclidity
  [EMAIL PROTECTED]                            The Math Forum

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to