in reply to Syntax question...

And the question is...? We can't help you unless you specify a question :)

Here is a rewrite, by the way: [untested]

perl -pe' if (length > 3) { my @args = split /\|/; # I'm surprised the following line works in a # shell script, with the single quotes and all... if ($args[1] eq '$service' and $args[3] eq '$bundle') { $args[4] =~ s/N/Y/; $_ = join "|", @args; } } ' $inputfile
There, with proper indenting and an implicit loop and use of implicit handling of $_, it looks a lot better. If you add -i, the file itself will be changed, which may remove the need for a temporary file.

- Yes, I reinvent wheels.
- Spam: Visit eurotraQ.