Perl: How to use command line special characters (newline, tab) in $LIST_SEPARATOR ($")
问题 I would like to use the value of a variable (fixed by a command line option for instance) as a list separator, enabling that value to be a special character (newline, tabulation, etc.). Unfortunately the naïve approach does not work due to the fact that the two following print statement behave differentely : my @tab = ("a","b","c"); # block 1 gives expected result: # a # b # c { local $" = "\n"; #" let us please the color syntax engine print "@tab"; } # block 2 gives unwanted result: # a\nb