It relies on the fact that setting the $/ input separator to a numeric value reads in that number of bytes.
You need to set $/ to a reference to a number: $/=\1;. The example you gave sets the record separator to "1", which isn't quite the same thing :-)
In reply to Re: Re: How do I safely, portably extract one or more bytes from a string?
by Anonymous Monk
in thread How do I safely, portably extract one or more bytes from a string?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |