in reply to Re: $. - smarter than you might think
in thread $. - smarter than you might think
Ohh, that's nice, if you expect it. :)
So you can have a Perl script print itself by:
use warnings; use strict; seek DATA, 0, 0; print while <DATA>; __END__
so long as __END__ or __DATA__ are present.
Of course that also means that you have to my $dataStart = tell DATA; if you want to seek DATA back to the data start rather than script start.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: $. - smarter than you might think
by shmem (Chancellor) on Jun 22, 2006 at 23:13 UTC | |
by radiantmatrix (Parson) on Jun 26, 2006 at 15:56 UTC | |
by shmem (Chancellor) on Jun 26, 2006 at 16:23 UTC |