Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

I haven't been able to replicate this behavior. I tried the following:

First, I shut off all network connections and ran this code:

my $address = Email::Valid->address(-address => '', -mx +check => 0, -tldcheck => 0, -fudge => 0); use Data::Dumper; warn Dumper $address;

I did not block. Next I added $Email::Valid::Debug = 1; at the top of my script, and saw no debug output. Next I ran the same but with -mxcheck => 1. With that setting I did block (my network was off) and saw this output: using Net::DNS for dns query. Turning the network back on, I got a clean response but with that same debug. My next step was to override the Net::DNS::Resolver::new sub and the Net::DNS::mx sub so that they would warn if invoked. With -mxcheck => 0 I got no warning. With -mxcheck => 1 I got the warning indicating I was hitting Net::DNS code.

Finally I spewed %INC with -mxcheck set false. Unfortunately Net::DNS does get loaded even if the check is turned off. But with no network I never blocked.

In the POD for Email::Valid it mentioned that you can set $Email::Valid::Resolver->tcp_timeout($seconds) and $Email::Valid::Resolver->udp_timeout($seconds) to set how many seconds you're willing to wait on the network. If you continue to find a way to get blocking behavior despite turning off the external checks, set that number really low. However, in my own testing with the network turned off, those two method calls didn't seem to do what was needed; I still got blocking behavior.

One more thing: I looked at Net::Domain::TLD and saw that it does not seem to hit the network. So you could probably enable -tldcheck => 1 without blocking.


In reply to Re: use Email::Valid offline by davido
in thread use Email::Valid offline by IB2017

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others surveying the Monastery: (6)
    As of 2021-03-01 10:10 GMT
    Find Nodes?
      Voting Booth?

      No recent polls found