Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Need to turn off prints from module

by Corion (Pope)
on Nov 17, 2010 at 17:08 UTC ( #872019=note: print w/ replies, xml ) Need Help??


in reply to Need to turn off prints from module

It would seem to me that this is a bug in Parse::HTTP::UserAgent. It contains a regular expression to suppress those messages, but the RE is

use constant RE_WARN_INVALID => qr{\QVersion string .+? contains inva +lid data; ignoring:\E}xms;

... which will quotemeta all metachars, especially .+?, which seems wrong. Also, the mixed usage of x and \Q happens to work but usually when using /x, you should use \s (or [ ]) for matching spaces.

My approach would be to either preload and monkeypatch Parse::HTTP::UserAgent::Constants or to fix the module upstream.

Also, I'm not sure what actually raises these warnings.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://872019]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2016-08-27 11:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (379 votes). Check out past polls.