in reply to Search and replace the word in Column 16

Maybe you could split the record,
my @fields = split /|/, $record;
The replace the field if necessary and then recreate the record by joining the fields again?

I am sure someone will have a far more efficient and exotic answer, but sometimes first principles works.

Of course, gellyfish is right, the | should be escaped:

my @fields = split /\|/, $record;
jdtoronto

Replies are listed 'Best First'.
Re^2: Search and replace the word in Column 16
by gellyfish (Monsignor) on Jul 25, 2006 at 12:17 UTC

    I don't think you meant split /|/ as witnessed by the the output of the following:

    print +join '*', split /|/, 'AT0000937503|20060530|||142.708534||GROUP + AG|30618720||||OPEN|ISIN|4943402|VSE|STOCK|39600000|0.77320';
    You need to escape the regex metacharacter '|'.

    /J\