On Thursday, May 3, 2012 4:24:02 PM UTC+10, Athanasius wrote:
> Hi,
>
> Searching perldoc (Perl 5 version 14.1) for the built-in 'substr' function
> gives:
>
> > substr EXPR,OFFSET,LENGTH,REPLACEMENT
> > substr EXPR,OFFSET,LENGTH
> > substr EXPR,OFFSET
> >
> > Extracts a substring out of EXPR and returns it. First character is at
> > offset 0 ...
>
No, that is 0, the way you count is 0,1,2, .... so the first character is at position 0. If the offset is say 3, then the string is taken from starting at the 4th character.
Owen