in reply to print curly brackets
All great responses. Thanks. As Dave suggests, I need to be more specific about what I'm really asking for. Here goes: I am parsing an .xml file, formatting, and outputting to an .rtf file. Some of the input strings contain curly brackets (a debug print to the screen verifies that these brackets are in the input string) but they simply don't show up in my output rtf file. So I've tried several substitutions. All 4 of these options cause Word to believe that the output rtf file is corrupted and won't allow me to even open it:
$formatline =~ s/\{/\{/g;or
my $left_bracket = chr(123); $formatline =~ s/\{/$left_bracket/g;
or
my $left_bracket = "{"; $formatline =~ s/\{/$left_bracket/g;
or
my $left_bracket = '{'; $formatline =~ s/\{/$left_bracket/g;
The only success I've had is changing the { to a ( as follows:
$formatline =~ s/\{/(/g;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: print curly brackets
by Anonymous Monk on Jul 12, 2011 at 16:01 UTC | |
|
Re^2: print curly brackets
by ikegami (Patriarch) on Jul 12, 2011 at 16:59 UTC |