
zatlas1
User
Jul 8, 2011, 1:05 PM
Post #2 of 2
(2323 views)
|
Re: [zatlas1] Strange file - only CR as 'end of line'
[In reply to]
|
Can't Post
|
|
Found the solution, to use the $/ (use it locally if you do not want major bugs :))
my $irs = $/; {#<<<= anonimous local $/ = $irs; #default if (some condition...) {$/ = \229;} #to allow the program to read normal as well as stupid fixed length 228 + CR characters open (INDEXIN, "$SourceFile") or die("Couldn't open input file: $!"); while (<INDEXIN>) { chop; #if you want to get rid of the CR ... do something ... } }#<<<= end anonimous ZA
|