doubleqq has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I am not sure why, but when I attempt to escape a quote, a line break is added to my string where I really don't want a line break. Any help in formatting my string is much appreciated
This is what I am trying to do:
INPUT: 0060 0067 0068 ##Troublesome code## foreach (@pbArray){ push (@qxArray, "vc.get(\"$_\") Exists() && vc.get(\"$_\") getMin +> 20"); } chomp @qxArray; foreach (@qxArray){ print $_; } OUTPUT vc.get("0060 ") Exists () && vc.get("0060 ") getMin > 20 vc.get("0067 ") Exists () && vc.get("0067 ") getMin > 20 vc.get("0068 ") Exists () && vc.get("0068 ") getMin > 20 EXPECTED OUTPUT: vc.get("0060") Exists () && vc.get("0060") getMin > 20 vc.get("0067") Exists () && vc.get("0067") getMin > 20 vc.get("0068") Exists () && vc.get("0068") getMin > 20
I am likely escaping the double quotes in error, but I cannot see how to do it differently. Thank you for any insight!"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Escape Characters Add Line Breaks
by Perlbotics (Archbishop) on Jan 12, 2015 at 20:19 UTC | |
by doubleqq (Acolyte) on Jan 12, 2015 at 20:21 UTC |