$current_script_line_number

$current_script_line_number

am 02.10.2007 21:06:55 von Dan Jacobson

die() has access to these two:
$ perldoc -f die
the current script line number and input line number

The latter is $., but what about the former? No accessing that
from within one's program unless one wants to die() or warn()?

Re: $current_script_line_number

am 02.10.2007 21:46:02 von Dummy

jidanni@jidanni.org wrote:
> die() has access to these two:
> $ perldoc -f die
> the current script line number and input line number
>
> The latter is $., but what about the former? No accessing that
> from within one's program unless one wants to die() or warn()?

Search perldata for __LINE__



John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall

Re: $current_script_line_number

am 02.10.2007 23:26:21 von Ron Bergin

On Oct 2, 12:06 pm, jida...@jidanni.org wrote:
> die() has access to these two:
> $ perldoc -f die
> the current script line number and input line number
>
> The latter is $., but what about the former? No accessing that
> from within one's program unless one wants to die() or warn()?

Look for $0 in this perldoc
perldoc perlvar

Also read
perldoc -f caller

Re: $current_script_line_number

am 03.10.2007 01:26:07 von charley

On Oct 2, 3:06 pm, jida...@jidanni.org wrote:
> die() has access to these two:
> $ perldoc -f die
> the current script line number and input line number
>
> The latter is $., but what about the former? No accessing that
> from within one's program unless one wants to die() or warn()?

__LINE__

see perldoc perldata (special literals)

Chris

Re: $current_script_line_number

am 03.10.2007 03:00:50 von Ben Morrow

Quoth krahnj@telus.net:
> jidanni@jidanni.org wrote:
> > die() has access to these two:
> > $ perldoc -f die
> > the current script line number and input line number
> >
> > The latter is $., but what about the former? No accessing that
> > from within one's program unless one wants to die() or warn()?
>
> Search perldata for __LINE__

Also (caller 1)[2] if you're trying to imitate die.

Ben