in reply to Suggestions to make this code more Perlish

Hi, I think that what you are trying to do could be done in a dozen lines of code, or so (or even less), and I would gladly suggest a short "Perlish" solution, but I can't make sense of the messy output format generated by your code with your input data:
CountryNameAddressAgeAndorraAileen, Daquan, Hammett, Malachi1701469Solomon IslandsCyrus, Giacomo, Gretchen, Curran7693526Czech RepublicBriar, (...)
(Carriage returns added to the generated output to avoid one very very long line.) This is surely not the output that you want. Please show the output that you really need.

Replies are listed 'Best First'.
Re^2: Suggestions to make this code more Perlish
by ricardo_sdl (Novice) on Mar 29, 2014 at 19:42 UTC

    That is the intended output. The ascii character 30(Record Separator) is used as the separator between each line. The ascii character 31(Unit Separator) is used as the separator between each column.

    You can use this script to show the output using new lines and pipe characters which make it easier to read.

    #!/usr/bin/perl use 5.010; use strict; use warnings; use utf8; use open qw(:std :utf8); #Print a text file format to standard output. #https://ronaldduncan.wordpress.com/2009/10/31/text-file-formats-ascii +-delimited-text-not-csv-or-tab-delimited-text sub print_line { my ($line) = @_; foreach(split('', $line)) { if ($_ eq "\x{1F}") { print "|"; next; } elsif($_ eq "\x{1E}") { print "\n"; next; } print $_; } } while (<>) { print_line($_); print "\n"; }