You'd almost certainly be faster to unpack the entire string into an array once and then just index into the array:
my @numbers = unpack '(a4)*', $string;; ## Requires 5.8.x sub fetchOne { my $index = shift; return $numbers[ $index ]; }
In reply to Re: Null-stripping performance
by BrowserUk
in thread Null-stripping performance
by qiau
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |