On Nov 23, 2005, at 22:08, The Ghost wrote:

how can I print the current line of my script?

#!/usr/bin/perl

use Module;

$someVar='something';
print "This is line number $???\n"; <-want to print "This is line number 6" print "This is line number $???\n"; <-want to print "This is line number 7"

There's a special literal for that:

    print "This is line number ", __LINE__, "\n";

Some more are available, like __FILE__, they are documented in perldata.

-- fxn

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to