in reply to Is there a better way to use the line number in a quoted string than __LINE__?
... a better way ...
Maybe
printf "Line %s looks very nice\n", __LINE__;
or
printf "Line %d looks very nice\n", __LINE__;
which don't seem so bad to me.
NB: This is hardly unfanny, but works:
Win8 Strawberry 5.8.9.5 (32) Sun 03/07/2021 3:40:51 C:\@Work\Perl\monks >perl -Mstrict -Mwarnings print "Line ${ \__LINE__ } is ok syntactically \n"; ^Z Line 1 is ok syntactically
Give a man a fish: <%-{-{-{-<
|
---|
In Section
Seekers of Perl Wisdom