Data Serialization Concepts
CSV-Like Rows
Join scalar fields into a comma-separated row.
csv-like-row
Comma-separated text is a compact way to store one record per line.
CSV-Like Rows
csv_like_rows.pl
Replay: real traced execution (multi-file project)
use strict;
use warnings;
my $city = "Paris";
my $count = 3;
my $row = join(",", "city", $city, $count);
print "city=$city\n";
print "count=$count\n";
print "row=$row\n";
use strict;
use warnings;
my $city = "Rome";
my $count = 3;
my $row = join(",", "city", $city, $count);
print "city=$city\n";
print "count=$count\n";
print "row=$row\n";
use strict;
use warnings;
my $city = "Lima";
my $count = 3;
my $row = join(",", "city", $city, $count);
print "city=$city\n";
print "count=$count\n";
print "row=$row\n";
$city ← Paris, $count ← 3, $row ← city,Paris,3
4my $city→ Paris = "Paris"; #@city="Rome", "Lima"5my $count→ 3 = 3;6my $row→ city,Paris,3 = join(",", "city", $cityParis, $count3);78print "city=$cityParis\n";9print "count=$count3\n";10print "row=$rowcity,Paris,3\n";outputcity=Paris count=3 row=city,Paris,3
$city ← Rome, $count ← 3, $row ← city,Rome,3
4my $city→ Rome = "Rome";5my $count→ 3 = 3;6my $row→ city,Rome,3 = join(",", "city", $cityRome, $count3);78print "city=$cityRome\n";9print "count=$count3\n";10print "row=$rowcity,Rome,3\n";outputcity=Rome count=3 row=city,Rome,3
$city ← Lima, $count ← 3, $row ← city,Lima,3
4my $city→ Lima = "Lima";5my $count→ 3 = 3;6my $row→ city,Lima,3 = join(",", "city", $cityLima, $count3);78print "city=$cityLima\n";9print "count=$count3\n";10print "row=$rowcity,Lima,3\n";outputcity=Lima count=3 row=city,Lima,3