> put the line break as a code in the CSV file
CSV does not *escape* line feed characters like e.g. C does, it *quotes*
fields as a whole instead. Familiarise yourself with the file format
and its rules by reading the relevant RFC. The following program outputs
a standard compliant file, inspect it and pay attention how the LF in
the data fields differ from the record separating CR LF. Try opening it
in LibreOffice, too.
#!/usr/bin/env perl
use utf8;
use Text::CSV_XS qw();
use autodie qw(:all);
my $vcf = <<'VCF';
BEGIN:VCARD
⋮
END:VCARD
VCF
my $csv = Text::CSV_XS->new({
binary => 1,
eol => "\r\n",
always_quote => 1,
auto_diag => 2,
}) or die Text::CSV_XS->error_diag;
open $fh, '>:encoding(UTF-8)', 'vcards.csv';
$csv->print($fh, $_) for (
[23,42,1337,$vcf,qw(foo bar baz)],
[1,2,3,$vcf,qw(quux xyzzy zot)],
);
close $fh;
> How did you generate the packed notation?
With unpack. 0a is the cardinal of the codepoint of the LF character
in hexadecimal.
<http://p3rl.org/PostScript::Barcode#pack_data>
<http://kobesearch.cpan.org/htdocs/PostScript-Barcode/Barcode.pm.html#...>
<http://p3rl.org/unpack>