Skip Menu |

This queue is for tickets about the Shipment CPAN distribution.

Report information
The Basics
Id: 110920
Status: resolved
Priority: 0/
Queue: Shipment

People
Owner: andrew [...] pullingshots.ca
Requestors: bill [...] bottlenose-wine.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 2.03



Subject: Suppress Warnings
Date: Tue, 5 Jan 2016 17:19:43 +0000
To: bug-Shipment [...] rt.cpan.org
From: William Carr <bill [...] bottlenose-wine.com>
Hi, Andrew. Is there a way to suppress the following warnings? Your invoice may vary from the displayed reference rates at /usr/local/share/perl/5.20.2/Shipment/UPS.pm line 548. They really clutter up my tests.
On 2016-01-05 09:19:54, bill@bottlenose-wine.com wrote: Show quoted text
> Hi, Andrew. > > Is there a way to suppress the following warnings? > > Your invoice may vary from the displayed reference rates at > /usr/local/share/perl/5.20.2/Shipment/UPS.pm line 548. > > They really clutter up my tests.
You can capture warnings with a custom $SIG{__WARN__} handler -- see 'perldoc perlvar' under %SIG.
Got it. Thank you. $SIG{__WARN__} = sub { my $msg = shift; return if $msg =~ /Your invoice may vary from the displayed reference rates/; print STDERR $msg; };
On Tue Jan 05 12:19:54 2016, bill@bottlenose-wine.com wrote: Show quoted text
> Hi, Andrew. > > Is there a way to suppress the following warnings? > > Your invoice may vary from the displayed reference rates at > /usr/local/share/perl/5.20.2/Shipment/UPS.pm line 548. > > They really clutter up my tests.
Warnings are now only thrown if you set the debug attribute!