#!/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"; }