http://www.perlmonks.org?node_id=178301


in reply to Re: search =~ for /'s
in thread search =~ for /'s

$new .= '/' unless substr $new, -1 eq '/'; can someone explain what -1 does

Replies are listed 'Best First'.
Re: Re: Re: search =~ for /'s
by little (Curate) on Jun 30, 2002 at 03:15 UTC
    see perlman:perlfunc
    # 1st argument given: string to process # 2nd argument given: offset # so here it means regardless of the true length the # last character in the string substr ($new, -1);

    Have a nice day
    All decision is left to your taste