Since it seems clear that a simple (or even highly complex) regex isn't going to appear and solve this (I think even
japhy is a few months from building an entire Perl interpreter in a single regex ;-), I offer this
trivial attempt for your amusement. At least it is an
out of the box solution, but it will not work for all of the
examples offered in this thread. I had some fun testing it if nothing else!
my $firstline = (`perl -MO=Deparse $0 2>nul`)[2];
print "\nThe first line of Perl code is:\n$firstline";
# first test:
$x = sin / 25 ; # /; die "Bang! I'm dead!";
$y = time / 25 ; # /; die "I'm only pretending!";
produces:
The first line of Perl code is:
$x = sin / 25 ; # /;
Bang! I'm dead! at D:\Perl\dl\debug\testsource.pl line 19.
--
I'd like to be able to assign to an luser