Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > print line number

Reply
Thread Tools

print line number

 
 
Michael Goerz
Guest
Posts: n/a
 
      10-08-2006
Hi,

is there a way to print the line number of the line that is currently
executed in a perl script (similar to the $. variable), so that I can
use it in debugging messages, like this:

[... perl code ...]

$i = 5; print ('The value of $i changed to ', $i, "at line ",
$current_line, "\n") if $DEBUGGING;

[... perl code ...]

Thank,
Michael
 
Reply With Quote
 
 
 
 
Michael Goerz
Guest
Posts: n/a
 
      10-08-2006
Abigail wrote:
> print "The value of \$i changed to $i at line ", __LINE__, "\n";


Thanks, that exactly what I meant!

Michael
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
print a vs print '%s' % a vs print '%f' a David Cournapeau Python 0 12-30-2008 03:19 AM
Problem - I want to print Current Output of Pdf file and should print once.I get print dialog box but it is not working keto Java 0 05-30-2007 11:27 AM
How to print a 32-bit number as a base-10 number Steve C Programming 5 12-13-2004 07:07 PM
Read a file line by line with a maximum number of characters per line Hugo Java 10 10-18-2004 11:42 AM
Unlarging the print to print using PDF file to print Bun Mui Computer Support 3 09-13-2004 03:15 AM



Advertisments