http://qs1969.pair.com?node_id=196944

RollyGuy has asked for the wisdom of the Perl Monks concerning the following question:

I have a 64-bit perl that likes to give warnings (I'm doing a use warnings;) that greater than 32bit numbers are non-portable every time I have one typed in. I realize that they are not portable and would like to disable this specific warning, but am unsure how to do it. I've looked into "no warnings;", but it's too broad. I suppose I'll have to use: no warnings "X"; where X is the string I need to find. How do I go about solving this?

Replies are listed 'Best First'.
Re: Disabling Specific Warnings
by Zaxo (Archbishop) on Sep 11, 2002 at 14:29 UTC
    no warnings 'portable';

    See warnings for more information.

    After Compline,
    Zaxo

Re: Disabling Specific Warnings
by Joost (Canon) on Sep 11, 2002 at 14:32 UTC
    I've not got a 64-bit perl laying around, but a look at perllexwarn for 5.8.0 pointed me to the "portable" category, so that this might work:

    use warnings; no warnings "portable";

    If it doesn't help, there might be some other category you can try in perllexwarn.

    -- Joost downtime n. The period during which a system is error-free and immune from user input.
Re: Disabling Specific Warnings
by Aristotle (Chancellor) on Sep 11, 2002 at 14:36 UTC
    perldoc -f perllexwarn should help some; at least it contains all the warning classes you can enable/disable. Which one this would be for you I have no idea, but given this starting point you should be able to find out. Update: oy vey, took me too long to write this it seems.

    Makeshifts last the longest.

Re: Disabling Specific Warnings
by Juerd (Abbot) on Sep 11, 2002 at 14:30 UTC

    $SIG{__WARN__} = sub { warn $_[0] unless $_[0] =~ /portable/ };
    (Note: "no warnings 'portable';" is better, but does not work when the warnings pragma is not available.)

    - Yes, I reinvent wheels.
    - Spam: Visit eurotraQ.
    

      Preventing that sort of constructs is ofcourse why warnings was invented in the first place.
      -- Joost downtime n. The period during which a system is error-free and immune from user input.