line numbers within code

Discussion in 'Perl Misc' started by Robin, Jun 26, 2010.

  1. Robin

    Robin Guest

    How can I get the line number in perl of the currently running perl
    program, what perl code will return it and put it in a variable?

    I have found it very difficult to figure this out.

    Thank you,
    -Robin
     
    Robin, Jun 26, 2010
    #1
    1. Advertising

  2. Robin

    Uri Guttman Guest

    >>>>> "R" == Robin <> writes:

    R> How can I get the line number in perl of the currently running perl
    R> program, what perl code will return it and put it in a variable?

    R> I have found it very difficult to figure this out.

    i have found it very difficult to respond to a spammer. have you tried
    reading the documentation? it is in there.

    uri

    --
    Uri Guttman ------ -------- http://www.sysarch.com --
    ----- Perl Code Review , Architecture, Development, Training, Support ------
    --------- Gourmet Hot Cocoa Mix ---- http://bestfriendscocoa.com ---------
     
    Uri Guttman, Jun 26, 2010
    #2
    1. Advertising

  3. Robin <> wrote:
    > How can I get the line number in perl of the currently running perl
    > program, what perl code will return it and put it in a variable?


    > I have found it very difficult to figure this out.


    Have you tried to google for "perl line number"? The answer
    (by using the variable '__LINE__', that's two underscores be-
    fore and after 'LINE') is given already in the third link...

    Regards, Jens
    --
    \ Jens Thoms Toerring ___
    \__________________________ http://toerring.de
     
    Jens Thoms Toerring, Jun 26, 2010
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Hugo
    Replies:
    10
    Views:
    1,323
    Matt Humphrey
    Oct 18, 2004
  2. kaushikshome
    Replies:
    4
    Views:
    777
    kaushikshome
    Sep 10, 2006
  3. scad
    Replies:
    23
    Views:
    1,177
    Alf P. Steinbach
    May 17, 2009
  4. Max Williams

    copy/paste line numbers with code

    Max Williams, Sep 12, 2007, in forum: Ruby
    Replies:
    11
    Views:
    424
    Ronald Fischer
    Sep 13, 2007
  5. Marek Stepanek
    Replies:
    12
    Views:
    418
    Peter J. Holzer
    Sep 2, 2006
Loading...

Share This Page