in reply to Re: substr problem
in thread substr problem

I was hoping to get a certain number($length) of characters from the end of the string.
But using -$lenght returns "" regardless of $length.

Replies are listed 'Best First'.
Re: Re: Re: substr problem
by TStanley (Canon) on Jul 13, 2002 at 18:28 UTC
    so what you need is:
    my $offset = -5; # or however many characters from the end # that you want my $new_string = substr $filename, $offset;

    UPDATE: You might also want to read this

    TStanley
    --------
    Never underestimate the power of very stupid people in large groups -- Anonymous