title: Perl's caller() function returning incorrect line number
body: <p>I've got the following script running on Perl 5.10.1:</p>
  
  <pre><code>#!/usr/bin/perl
  use strict;
  use warnings;
  
  foreach( my $x =0 ; $x &lt; 1; $x++) {   # Line 5
    print_line();                       # Line 6
  } 
  
  sub print_line {
    print "Function call from line: " . [caller(0)]-&gt;[2] . "\n";
  }
  </code></pre>
  
  <p>Despite the call to the subroutine coming from line 6, the script outputs the line number of the start of the C-style for statement:</p>
  
  <pre><code>Function call from line: 5
  </code></pre>
  
  <p>What's really weird is if I throw a random statement into one of the blank line in the C-style for loop, <code>caller</code> returns the correct line number:</p>
  
  <pre><code>#!/usr/bin/perl
  use strict;
  use warnings;
  
  foreach( my $x =0 ; $x &lt; 1; $x++) {
    my $x = 3;
    print_line();  # Line 7
  }
  
  sub print_line {
    print "Function call from line: " . [caller(0)]-&gt;[2] . "\n";
  }
  </code></pre>
  
  <p>The above script correctly outputs: </p>
  
  <pre><code>Function call from line: 7
  </code></pre>
  
  <p>Is this some kind of bug or is there something I can do to get <code>caller</code> to accurately report the line number?</p>