From: Larry G. <Li...@IS...> - 2003-07-10 18:21:26
|
I was wondering if someone would be kind enough to lend an idea. I am trying to preserve the format of a text file. When I submit a form via Webmin I want the result to save to this file by replacing the appropriate entry. I have tried a lot of methods and fail at one specific point. Here is my test script: #################### #!/usr/bin/perl use Tie::File; tie @lines, "Tie::File", "/home/dude/tmp/test"; splice(@lines, 2, 1, "TEST=du...@we..."); untie @lines; #################### You can probably see that my problem is the @ character for the Email address. Perl wants to interpret @ as a metacharacter. While this is a simple script, this will eventually be input from the web for $in{'notify'}. Any thoughts how I can get this done correctly? I am not using &replace_file_lines() as I have about 28 substitutions. Anything I try using the format 's/old/new/'. "perl -p -I -e" and "sed 's/old/new/'" do work but I hate to keep writing to the file after each change (28). TIA for any help! --Larry |