in reply to How to handle metacharacters in input file for Perl one-liner code
Use the interpolative equivalent of quotemeta?
So I did not use your suggestion of using quotemeta (I haven't used it before, so I'm gonna go look it up), but I got my answer in the sample output you linked :)
Here's my updated code that's working now. Apparently I just needed to preemptively escape the . in my search string.
my $file = "foo.c";
$file =~ s/\./\\\./;
`perl -p -l -i.bak -e "s/$file/$file,=SUM(B$x:B$y)/" sample.csv`
Though probably I should look into Dean's suggestion as well. Any thoughts on which approach would have the fastest execution time out of these?
... which approach would have the fastest execution time out of these?
Since you're shelling out to the OS to run another copy of Perl to do your work, fast execution is not something you ever need to worry about.
Give a man a fish: <%-(-(-(-<
www.com | www.net | www.org
A scientific project
A system/database administration tool
A toy/personal tool
Other web based tool
None of the above
Results (82 votes). Check out past polls.