Hello,

I'm asking you to help me in escaping a new line separator.
I have a code like this:

foreach $line (@array1) {
        chomp($line);
        @dump = split(/"\|"/, $line);

        #
        # Define required fields
        #
        .....
                foreach $line2 (@array2) {
                chomp($line2);
                @dump_wan = split(/"\|"/, $line2);

                #
                # Define required fields ($ID,$IPAddr,$CctNum)
                #
        .....
        open(OUT,">>output.csv") or die "Can't open file: $!\n";
        ...
        chomp($line);
        print OUT "$line|$ID|$IPAddr|$CctNum\n";
        ...
        close OUT;
                } #end inner foreach
} #end outer foreach

The problem is that $line has the end-of-line separator and my
fields($ID|$IPAddr|$CctNum) are added after this end-of-line separator.
How can I escape the end of line separator when added new fields at the
end of the records?

Thanks a lot!
Livia

Reply via email to