Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

caller() returns wrong line on multi-line function call

by jh (Beadle)
on Sep 13, 2017 at 18:24 UTC ( #1199342=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
    #!/usr/bin/perl -w
    use strict;
      %{{ A => 1, B => 2, C => 3 }}
  2. or download this
    Called from line 11; caller() reports line 11
    Called from line 15; caller() reports line 16
  3. or download this
    #!/usr/bin/perl -w
    use strict;
    print "\n";
  4. or download this
        Called from line 22; caller() reports line 22 [args: A 1 D 4 C 3 E
    + 5 B 2]
        Called from line 23; caller() reports line 23 [args: HASH(0x974070
    *** Called from line 122; caller() reports line 124 [args: space_1 str
    *** Called from line 126; caller() reports line 129 [args: space_1 spa
    +ce_2 strings_are_scalar]
    *** Called from line 131; caller() reports line 134 [args: space_1 spa
    +ce_2 strings_are_scalar space_3 space_4]

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1199342]
Approved by beech
Front-paged by LanX
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (10)
As of 2018-07-17 14:11 GMT
Find Nodes?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?

    Results (368 votes). Check out past polls.