in reply to Re: last character in string ?
in thread last character in string ?
It's worth noting that perl uses negative numbers to "count backwards" when dealing with string (and array, and probably many other surprising things) indexes, removing the need to do things like length($date)-1)). Code looks nicer and scans better for the effort.
$date = substr($date,0,(length($date)-1)); # remove last char
Update : Wouldn't it be nice if push, pop and (un)shift worked on characters in a string? Yes, there's chop. that's true enough, but still.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl that moves.
by demerphq (Chancellor) on Oct 01, 2001 at 19:44 UTC | |
|
Re: Perl that moves.
by Amoe (Friar) on Oct 01, 2001 at 19:26 UTC | |
by demerphq (Chancellor) on Oct 01, 2001 at 19:55 UTC |