lacertus has asked for the wisdom of the Perl Monks concerning the following question:
Essentially, if a webpage I've served has been called with a trailing "/", I want to shear it off, $served being the actual webpage served out. So I'm saying:$served = ($served =~ s/\/$//) if ($served =~ /^\/.+?\/$/);
This doesn't work, I assume because of the =~ in the substitution. What is the proper method?if the served page has a trailing "/" { set served equal to a substition of served without the "/" }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Substitution Trickery
by dragonchild (Archbishop) on Mar 21, 2003 at 15:38 UTC | |
by Thelonius (Priest) on Mar 21, 2003 at 15:54 UTC | |
|
Re: Substitution Trickery
by jmcnamara (Monsignor) on Mar 21, 2003 at 15:54 UTC | |
by jasonk (Parson) on Mar 21, 2003 at 15:56 UTC | |
by jmcnamara (Monsignor) on Mar 21, 2003 at 16:21 UTC | |
|
Re: Substitution Trickery
by BrowserUk (Patriarch) on Mar 21, 2003 at 16:13 UTC | |
|
Re: Substitution Trickery
by zby (Vicar) on Mar 21, 2003 at 15:58 UTC | |
|
Re: Substitution Trickery
by diotalevi (Canon) on Mar 21, 2003 at 17:31 UTC | |
|
Re: Substitution Trickery
by lacertus (Monk) on Mar 21, 2003 at 22:11 UTC | |
|
Re: Substitution Trickery
by awkmonk (Monk) on Mar 24, 2003 at 10:13 UTC |