Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re^2: perl determine a subroutine name by given line

by duelafn (Vicar)
on Aug 05, 2011 at 11:05 UTC ( #918733=note: print w/replies, xml ) Need Help??


in reply to Re: perl determine a subroutine name by given line
in thread perl determine a subroutine name by given line

Not quite. It seems to give the line number where the subroutine becomes known to perl. Thus, if the sub is used before it is defined the line numbers will be wrong. Example:

#!/usr/bin/perl use 5.010; say f( 34 ); sub f { $_[0] + 8 }

Then, perl -MO=Xref,d /tmp/test.pl gives (among other things):

Package main &f s3

Which is the line where f is used, not defined.

This is perl, v5.10.1 (*) built for x86_64-linux-gnu-thread-multi

Good Day,
    Dean

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://918733]
help
Chatterbox?
[ambrus]: (either on just one screen or two screens). this is necessary because
[ambrus]: overhead slide plus blackboard is inconvenient because the lighting conditions are different and they require separate areas you can't quickly repartition, and typing on keyboard is faster and more convenient than writing on a blackboard
[Corion]: (b) would be cool. I've thought about this doing Pod editing, and even simply regenerating/live updating the browser makes things much more interactive
[ambrus]: modern computers have way enough processing power to allow this, at least for geeks who are willing to spend a few weeks to learn a tricky new user interface like vim
[Corion]: ambrus: Well, for mathematical notation, I find blackboard much more convenient than a computer. But when inserting text or moving text around, the computer wins obviously
[ambrus]: But either of these is a big problem in practice, so I'd need to spend like thirty years of my life to solve (a) and five more years to solve (b)
[ambrus]: Corion: yes, CURRENTLY the blackboard is more convenient
[ambrus]: and it's not like I want to ban blackboards anyway
[ambrus]: you already have blackboards and a canvas for projector or overhead transparencies (or positive film slide projector, not used for maths) canvas in the same lecture halls today, and switch in a few minutes between presentations,
[ambrus]: they're only difficult to use together.

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (10)
As of 2017-09-26 10:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (293 votes). Check out past polls.

    Notices?