in reply to Re: Suggestions to make this code more Perlish
in thread Suggestions to make this code more Perlish
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"; }
|
|---|