in reply to string gets front truncated
# call as: ConvertFindLaw.pl PilotLifeFindLaw.htm use 5.010; use Switch; use strict; my $wholeFile; my $INPUT_FILE = shift; my $FH; open(FH, $INPUT_FILE) or die "Bad $INPUT_FILE: $!"; ; while (<FH>) { # print $line; # All lines printed chomp $_; # This makes difference , if want it in one line $wholeFile .= qq~$_~; # Just use quoted qq } # Build a long string $wholeFile .= qq~\n~; # This is needed, when you say u want it in one +line, there should one new line character after doing appending in wh +ile loop, now when you do wc -l on this one, it will show one line close(FH); print $wholeFile; # front truncated here
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: string gets front truncated
by hsfrey (Beadle) on Jul 30, 2008 at 04:08 UTC | |
by ysth (Canon) on Jul 30, 2008 at 04:31 UTC | |
by systems (Pilgrim) on Jul 30, 2008 at 08:29 UTC |