Well, this is somewhat disappointing:

Put this in a file called test.pl

sub mysub{
        my @callinfo=caller(0);
        my $linenum=$callinfo[2];
        print "linenum is '$linenum'\n";
}


our @array=(
        mysub('a'),
        mysub('b')
);


Then run it and you get something like this:

perl test.pl
linenum is '10'
linenum is '10'


If you change it to
our @array=(
        mysub('a', __LINENUM__ ),
        mysub('b', __LINENUM__ )
);

You get 11 and 12 passed into the mysub routine.

Which would be OK I suppose, except perl doesn't have text macros
that I know of.

argh....

Greg



_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to