On Sun, Oct 13, 2002 at 02:55:15PM +0200, Roland Bauer wrote:
> when installing a module which uses the 'our' pragma,
> the $VERSION cannot be evaled on systems with Perl 5.005.
> This patch tries to warn the user.
> 
> Maybe you have a better idea how to do it.

It might work.  I'm nervous about putting in heuristics based on simple
regexes parsing Perl code.  Then again, that's what parse_version() is.

I'm tempted to reverse the warning.  To instead tell the user to inform the
author to put a "require 5.006" statement into their Makefile.PL so the user
never even gets this far.


> --- MM_Unix.pm_1.34        Tue Aug 27 03:17:54 2002
> +++ MM_Unix.pm        Sun Oct 13 14:42:50 2002
> @@ -2939,7 +2939,13 @@
>          };
>          local $^W = 0;
>          $result = eval($eval);
> -        warn "Could not eval '$eval' in $parsefile: $@" if $@;
> +        if ($@) {
> +                warn "Could not eval '$eval' in $parsefile: $@";
> +                if ( $] < 5.006 and /\bour\b/ ) {
> +                        print "It seems that your module uses the pragma 'our'.\n";
> +                        print "This is not valid in Perl $]. Please upgrade to at 
>least 5.006.\n"
> +                }
> +        }
>          last;
>      }
>      close FH;


-- 

Michael G. Schwern   <[EMAIL PROTECTED]>    http://www.pobox.com/~schwern/
Perl Quality Assurance      <[EMAIL PROTECTED]>         Kwalitee Is Job One
I will personally promise to glare sternly at such people.
        -- Jarkko Hietaniemi in <[EMAIL PROTECTED]>

Reply via email to