Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Comment on

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

I think choroba’s point is that you can use BEGIN blocks to determine when the warning is issued. For example:

#! perl use strict; use warnings; BEGIN { print "BEGIN 1\n"; } sub each { warn 'main::each() was called' } BEGIN { print "BEGIN 2\n"; } sub delete { warn 'main::delete() was called' } BEGIN { print "BEGIN 3\n"; } my %person = (name => 'Ken Takakura'); while (my ($key, $val) = each %person) { print "$key: $val\n"; } delete $person{name}; BEGIN { print "BEGIN 4\n"; }

produces this output:

BEGIN 1 BEGIN 2 BEGIN 3 Ambiguous call resolved as CORE::each(), qualify as such or use & at 1 +66_SoPW.pl line 13. BEGIN 4 name: Ken Takakura

which shows that the warning is issued during the compile phase (before the main code is executed) at the point where the code specifies an ambiguous call to each.

This works because BEGIN blocks are executed during compilation, as soon as they are seen by the Perl compiler, before the main code is run. See BEGIN, UNITCHECK, CHECK, INIT and END.

HTH,

Athanasius <°(((><contra mundum


In reply to Re^3: Ambiguous calls by Athanasius
in thread 'Ambiguous call' diagnosis seems ambiguous by anazawa

Title:
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!
  • 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
  • Outside of code tags, you may need to use entities for some characters:
            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?
    Username:
    Password:

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

    How do I use this? | Other CB clients
    Other Users?
    Others meditating upon the Monastery: (16)
    As of 2014-07-31 14:53 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My favorite superfluous repetitious redundant duplicative phrase is:









      Results (249 votes), past polls