>
>Hi Jeff,
>
>This IP 192.168.1.1 will replaced by IP defined from user.
>
>example:
>
>Enter with IP : 10.0.0.1
>Submit
>
>When somebody  to type one value, it will replaced the file value.
>
>IP: 192.168.1.1 -> will be replaced -> 10.0.0.1
>

Got it.Then your script is may right.
The only note is the meta-characters.becase '.' is a meta-character in Perl,so 
given this case:

$source_ip = '192.168.1.1';
$dest_ip = '10.0.0.1';
s/$source_ip/$dest_ip/g;

maybe meet some problems.
The better way is use \Q for disable quote meta-characters.like:

s/\Q$source_ip/$dest_ip/g;

>From perldoc perlre:

           \E          end case modification (think vi)
           \Q          quote (disable) pattern metacharacters till \E

Hope this useful.

--
http://home.arcor.de/jeffpang/

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to