in reply to Re^4: read an integer from a file
in thread read an integer from a file

No difference in output?

$_ = 'http://www.foo.com/'; s/^http:\/\/(.*)\/(.*)/http:\/\/123.1.34.107:8080\/Web/; print("$_\n"); $_ = 'http://www.foo.com/'; s[^http://(.*)(.*)][http://123.1.34.107:8080]; print("$_\n");
http://123.1.34.107:8080/Web http://123.1.34.107:8080

Replies are listed 'Best First'.
Re^6: read an integer from a file
by long (Novice) on Jun 21, 2010 at 08:00 UTC
    sorry.my mistakes. but that is not what i meant. My main focus is to get the output from the full code in my fist post. if i use the  s/^http:\/\/(.*)\/(.*)/http:\/\/123.1.34.107:8080\/Web/;. the url will not redirected to 123.1.34.107. But when i changed to
    s[^http://(.*)(.*)][http://123.1.34.107:8080];
    . any url entered will be redirected to 123.1.34.107.
      I know. And the reason it works is because it doesn't add "/Web" and because it doesn't require a "/".