perl formats

Stephane Rondal rondal at
Tue Jan 9 15:51:51 CST 2001

Using perl formats, I'm simply trying to print:
|x|, that is x, a meanlingless value, ***enclosed between
two 'or' bars, without additional spaces***

So, here goes:

format STDOUT = 

The problem with this is that it will print (for $x = 1): 
The second 'or' bar is missing because it has been interpreted
by perl as the center aligned format directive.
I've also tried |@<| and other variants, as well as escaping the
'or' bar, but I always end up with an unwanted space between 1 
and the closing 'or' bar, or even the escape character '\' itself.

Finally I came up with:

format STDOUT = 

which means: left aligned on 2 characters (@<) and use the concatenation 
operator to manually add the closing 'or' bar.

Any ideas?


PS. I know this may seem an overkill use of perl formats,
but this is just part of a bigger format 

More information about the Liege-pm mailing list