njack has asked for the wisdom of the Perl Monks concerning the following question:
Hi everyone, I've got a problem I just cant figure out... I want to remove the initial part of some strings. Example:
"../files/jack/2012/derpone.pdf"
should become "derpone.pdf"So i have this:
And it works like a charm on Padre. But when I load the .cgi file on the server of my university it doesn't work anymore.my $text="../files/jack/2012/derpone.pdf"; $text=~ s/..\/\w*\/\w*\/\d\d\d\d\///g;
It' a copy paste and yet on my webpage i get ../files/jack/2012/derpone.pdfmy $text="../files/jack/2012/derpone.pdf"; $text=~ s/..\/\w*\/\w*\/\d\d\d\d\///g; $cgi->h1($text),
the regular expression should: ../letters/letters/4 numbers/
What is the problem?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Why can't I use s///
by toolic (Bishop) on May 08, 2013 at 16:48 UTC | |
by njack (Novice) on May 08, 2013 at 16:54 UTC | |
by toolic (Bishop) on May 08, 2013 at 16:55 UTC | |
by njack (Novice) on May 08, 2013 at 17:02 UTC | |
by linuxer (Curate) on May 08, 2013 at 21:52 UTC | |
by Anonymous Monk on May 09, 2013 at 03:14 UTC | |
Re: Why can't I use s///
by Random_Walk (Prior) on May 08, 2013 at 17:00 UTC | |
by educated_foo (Vicar) on May 08, 2013 at 19:47 UTC |