in reply to Byte-level file inspection?
can become:if ($_ < $bytepos) { print '< '; } if ($_ > $bytepos) { print '> '; } if ($_ == $bytepos) { print '* '; }
Whoosh, that was fun :-)print qw(* > <)[$_ <=> $bytepos];
You should also be careful about feeding a negative index into substr, which could happen with a low enough bytepos.
update: deleted a bit of misguided foolishness.
MeowChow s aamecha.s a..a\u$&owag.print
|
|---|