I am doing a pipeline delimited report using perl. How do i include the delimiting character | between the fields. | symbol in perl stands for aligning the field to centre.
format details =
@<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<
"$rtype", "$rdescr", "$rid"
OUTFILE->format_name("details");
write OUTFILE;
If you’re using that format, then you could as simply use:
You should think about migrating to lexical file handles
though ISTR that formats require the non-lexical handles. However, that doesn’t automatically truncate the fields to length, which may matter to you.This code works for me:
The output it produces (in
file.out) is:(PS: I tried
\|first; it produced\|in the output, so it was an easy and reasonable inference that the backslash was not actually needed.)With lexical file handle:
This gives the same output.