in reply to Re: using modules with 'no warnings' in perl 5.005
in thread using modules with 'no warnings' in perl 5.005

Everybody is too eval(string) happy for my tastes ;)
BEGIN { eval { require warnings; 1 } or do { no strict 'refs'; *warnings::import = *warnings::unimport = sub{}; $INC{'warnings.pm'}=''; }; }

MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
** The third rule of perl club is a statement of fact: pod is sexy.

Replies are listed 'Best First'.
Re: Re: Re: using modules with 'no warnings' in perl 5.005
by liz (Monsignor) on Jul 29, 2003 at 08:28 UTC
    Ok, fair enough.

    One question though: the 1 in line 4 of your code seems superfluous to me. A successful 'require warnings' should return a true value anyway, no?

    Liz
      Yup, it's just a force of habit, like including a "1;" at the "official" end of every package within a single file.

      MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
      I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
      ** The third rule of perl club is a statement of fact: pod is sexy.