Re: hellp improve efficiency

2007-04-29 Thread yaron
om# or $uri =~ s#www\.example\.com/([wulp])/#$1.example.com/#; print $uri; } Best regards Yaron Kahanovitch - Original Message - From: "Jen mlists" <[EMAIL PROTECTED]> To: "beginners perl" Sent: Saturday, April 28, 2007 10:57:07 AM (GMT+0200) Auto-Detected S

Re: hellp improve efficiency

2007-04-28 Thread Jeff Pang
2007/4/29, Steve Finkelstein <[EMAIL PROTECTED]>: Perhaps I'm misunderstanding what you're ultimately trying to accomplish. However, if you're doing what I think you're doing and you're using Apache, look into mod_rewrite: http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html From my knowledg

Re: hellp improve efficiency

2007-04-28 Thread Steve Finkelstein
Perhaps I'm misunderstanding what you're ultimately trying to accomplish. However, if you're doing what I think you're doing and you're using Apache, look into mod_rewrite: http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html - sf Jen mlists wrote: > Hello members, > > I wrote a perl script for

Re: hellp improve efficiency

2007-04-28 Thread Tom Phoenix
On 4/28/07, Jen mlists <[EMAIL PROTECTED]> wrote: }elsif ($uri =~ m|www\.example\.com/v2/|o) { $uri =~ s|www\.example\.com/v2/|v2.example.com/|; The /o modifier isn't desirable there. Also, because a s/// will only replace if the match part succeeds, you can skip the test: $uri

hellp improve efficiency

2007-04-28 Thread Jen mlists
Hello members, I wrote a perl script for url redirect,shown as below, $|=1; my $uri = ''; while (<>) { $uri = (split)[0]; if ($uri =~ /\.html?\?/ or $uri =~ /\.js\?/ or $uri =~ /\.css\?/ or $uri =~ /\.jpg\?/ or $uri =~ /\.gif\?/ or $uri =~ /\.swf\?/) { $uri =~ s/\?.*$//;