On Fri, Sep 07, 2001 at 02:58:30PM +0200, Roland Schoenbaechler wrote:
> In some cases I want to write the line-number of the script to STDERR (In
> analogy to the functions die or next). Does a variable exist indicating the
> line number of the currently executed step (or the last step)?

If you use the warn function, with no trailing newline, it will append the
name of the script and the line number.  die does the same.

For example:

    > perl -wle 'warn("Unable to open foo")'
    Unable to open foo at -e line 1.

This might be a better solution than appending the line number yourself.


Michael
--
Administrator                      www.shoebox.net
Programmer, System Administrator   www.gallanttech.com
--

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to