losso3000 / quine-scarf

A kind-of quine in perl
GNU General Public License v3.0
7 stars 0 forks source link

seek on __DATA__ #1

Open osresearch opened 6 years ago

osresearch commented 6 years ago

Potentially a more portable way to read the code is to seek on DATA instead of opening $0:

#/usr/bin/perl
seek DATA, 0, 0;
print while <DATA>;
__DATA__

My much less artistically laid-out quine-scarf-generator uses this technique:

quine-crop

losso3000 commented 6 years ago

Very nice! Thank you for the hint. Not sure if I will update this one or write a new one, aiming for “proper” quine-ness – one day… :)

Also, a beautiful piece of scarf code – extra kudos for using strict!