http://qs321.pair.com?node_id=191334

BrowserUk has asked for the wisdom of the Perl Monks concerning the following question:

I came across what, according to my reading of the docs, is an anomoly in the way substr works.

Is this a bug in substr, or my reading of the docs?

0.02 0.02 >$,='|' |0.02|0.02|>$s = qq(the quick brown fox jumps over the lazy dog) # Used this way, the return is the 4 bytes replaced. |0.02|0.02|>print substr($s,0,4,''),$s the |quick brown fox jumps over the lazy dog |0.02|0.02|>print $s quick brown fox jumps over the lazy dog # But used this way, it is the first 4 bytes *after* the replacement o +ccurs? |0.02|0.02|>print substr($s,0,4)='',$s k br|k brown fox jumps over the lazy dog |0.02|0.02|>print $s k brown fox jumps over the lazy dog

What's this about a "crooked mitre"? I'm good at woodwork!