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

The former adds /Web, the latter doesn't

Replies are listed 'Best First'.
Re^4: read an integer from a file
by long (Novice) on Jun 21, 2010 at 07:24 UTC
    /web didn't give any effect to the output. i got the output when i change the slash to square bracket.

      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.