in reply to Find Replace text with list

I see that you are already using file operations in your script. What stops you from simply reading the contents of a file into $s?

For the @replace array you can just read a file line by line and split on a predefined delimiter.

Replies are listed 'Best First'.
Re^2: Find Replace text with list
by wa2nlinux (Novice) on Feb 07, 2011 at 14:35 UTC
    Here the error when I try to get @replace from file
    Can't use string ("my @replace = ( ") as an ARRAY ref while "strict refs" in use at parsingtex.pl line 16 +, <FData> line 4.
        When I read my @replace as array from a file and try to subtitute
        open(FData,"< data") || die("Cannot Open File"); my @replace=<FData>; for my $replace (@replace) { $s =~ s/$replace->[0]/$replace->[1]/gee; }
Re^2: Find Replace text with list
by Anonymous Monk on Feb 15, 2012 at 13:12 UTC
    I saw you can do a multiple find and replace a list of items in text online at http://list-replace.info . Maybe this can help.