title: Why is this line of Perl code throwing a numeric gt warning?
body: <p>I have the following conditional:</p>
  
  <pre><code>if ($self-&gt;path ne 'contact_us' &amp;&amp; !grep { $status == $_ } 2, 3, 8) {
  </code></pre>
  
  <p>And it is throwing this warning:</p>
  
  <blockquote>
    <p>Use of uninitialized value in numeric gt (>)</p>
  </blockquote>
  
  <p>Of course, there's no numeric gt at all on the surface. $self->path is a Moose attribute accessor, so the only under-the-hood magic would be coming from that. But I can't see how that would be making a numeric gt comparison, especially since <code>path</code> is defined as follows:</p>
  
  <pre><code>has 'path' =&gt; (is =&gt; 'rw', isa =&gt; 'Str');
  </code></pre>
  
  <p>Any ideas on how this warning is getting thrown? I'm using Perl v5.8.8 built for i386-linux-thread-multi, if it matters in this case.</p>
  
  <p><strong>Update</strong>: Even more mysteriously, I've rewritten the conditional as follows:</p>
  
  <pre><code>my $cond1 = $self-&gt;path ne 'contact_us';
  my $cond2 = !grep { $status == $_ } 2, 3, 8;
  if ($cond1 &amp;&amp; $cond2) {
  </code></pre>
  
  <p>And it's the <em>third</em> line that throws the warning. <code>Carp::Always</code>'s stack trace isn't sufficiently informative. Some further disclosure, as I'm feeling utterly clueless now: The base file is a FastCGI script being called up by Apache's mod_fcgi.</p>
  
  <p><strong>Last update:</strong>
  <code>$status</code> was getting set by a call to a method found in another module (<code>My::Session</code>). Here was line generating the warning in that module's method (note the errant <code>&gt;</code>):</p>
  
  <pre><code>my $disputes =&gt; dbh('b')-&gt;selectrow_hashref($query);
  </code></pre>
  
  <p>What's confusing to me is why the warning didn't reference the module containing the offending line (it referenced the module making the method call, <code>My::Page</code>). Here's the full output from <code>Carp::Always</code>; there is an utter lack of mention of <code>My::Session</code>:</p>
  
  <blockquote>
    <p>[Wed Feb 23 17:44:29 2011] [warn]
    [client ---.---.94.159] mod_fcgid:
    stderr: Use of uninitialized value in
    numeric gt (>) at /path/to/My/Page.pm
    line 65, referer:
    <a href="https://testserver.domain.tld/help" rel="nofollow">https://testserver.domain.tld/help</a></p>
    
    <p>[Wed Feb 23 17:44:29 2011] [warn]
    [client ---.---.94.159] mod_fcgid:
    stderr:
    \tPage::BUILD('My::Page::Help=HASH(0xa7ce788)',
    'HASH(0xa327904)') called at
    /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Class/MOP/Method.pm
    line 123, referer:
    <a href="https://testserver.domain.tld/help" rel="nofollow">https://testserver.domain.tld/help</a></p>
    
    <p>[Wed Feb 23 17:44:29 2011] [warn]
    [client ---.---.94.159] mod_fcgid:
    stderr:
    \tClass::MOP::Method::execute('Moose::Meta::Method=HASH(0x9fa357c)',
    'My::Page::Help=HASH(0xa7ce788)',
    'HASH(0xa327904)') called at
    /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Object.pm
    line 57, referer:
    <a href="https://testserver.domain.tld/help" rel="nofollow">https://testserver.domain.tld/help</a></p>
    
    <p>[Wed Feb 23 17:44:29 2011] [warn]
    [client ---.---.94.159] mod_fcgid:
    stderr: \tMoose::Object::BUI, referer:
    <a href="https://testserver.domain.tld/help" rel="nofollow">https://testserver.domain.tld/help</a></p>
    
    <p>[Wed Feb 23 17:44:29 2011] [warn]
    [client ---.---.94.159] mod_fcgid:
    stderr:
    LDALL('My::Page::Help=HASH(0xa7ce788)',
    'HASH(0xa327904)') called at
    /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Meta/Class.pm
    line 278, referer:
    <a href="https://testserver.domain.tld/help" rel="nofollow">https://testserver.domain.tld/help</a></p>
    
    <p>[Wed Feb 23 17:44:29 2011] [warn]
    [client ---.---.94.159] mod_fcgid:
    stderr:
    \tMoose::Meta::Class::new_object('Class::MOP::Class::<strong>ANON</strong>::SERIAL::1=HASH(0xa3397c8)',
    'HASH(0xa327904)') called at
    /usr/lib/perl5/site_perl/5.8.8/i386-linux-thread-multi/Moose/Object.pm
    line 26, referer:
    <a href="https://testserver.domain.tld/help" rel="nofollow">https://testserver.domain.tld/help</a></p>
    
    <p>[Wed Feb 23 17:44:29 2011] [warn]
    [client ---.---.94.159] mod_fcgid:
    stderr:
    \tMoose::Object::new('My::Page::Help',
    'HASH(0xa339d38)') called at generated
    method (unknown origin) line 3,
    referer:
    <a href="https://testserver.domain.tld/help" rel="nofollow">https://testserver.domain.tld/help</a></p>
    
    <p>[Wed Feb 23 17:44:29 2011] [warn]
    [client ---.---.94.159] mod_fcgid:
    stderr:
    \tMy::Page::new('My::Page::Suppo,
    referer:
    <a href="https://testserver.domain.tld/help" rel="nofollow">https://testserver.domain.tld/help</a></p>
    
    <p>[Wed Feb 23 17:44:29 2011] [warn]
    [client ---.---.94.159] mod_fcgid:
    stderr: rt', 'HASH(0xa339d38)') called
    at /path/to/My.pm line 44, referer:
    <a href="https://testserver.domain.tld/help" rel="nofollow">https://testserver.domain.tld/help</a></p>
    
    <p>[Wed Feb 23 17:44:29 2011] [warn]
    [client ---.---.94.159] mod_fcgid:
    stderr: \tMy::start() called at
    index.fcgi line 9, referer:
    <a href="https://testserver.domain.tld/help" rel="nofollow">https://testserver.domain.tld/help</a></p>
  </blockquote>