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

/web didn't give any effect to the output. i got the output when i change the slash to square bracket.

Replies are listed 'Best First'.
Re^5: read an integer from a file
by ikegami (Patriarch) on Jun 21, 2010 at 07:40 UTC

    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
      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 "/".