in reply to the end of a word
will work. However, more is needed if you're looking to eliminate an indetermined amount of junk. A general regex to customize would be:chop $directory;
This will remove any non-letters from the end of the variable (the ^ negates the [] character class). If there are other valid word letters, change the character class as needed.$directory =~ s/[^a-zA-Z]+$//;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Laziness is one of the three virtues!
by jaldhar (Vicar) on Jul 22, 2002 at 20:31 UTC | |
by Ovid (Cardinal) on Jul 22, 2002 at 20:41 UTC |