Hi all,
I am currently trying to work on a system that reads in all kinds of feeds.
These feeds can be created on a PC, new/old mac, or a *nix machine.
And I need to be able to deal with them all.
Here's the kicker, these feeds sometimes have inline breaks, and we need to
keep them.
Does anyone have any suggestions on how to deal with this?
This works:
---------------------------
my $newline = "\n";
my $file = '788_test.txt';
open (my $file_fh, $file) || die "could not open $file for reading";
my $file_content = <$file_fh>;
$file_content =~ s/(?:\015{1,2}\012|\015|\012)/$newline/sg;
foreach (split(/\n/, $file_content)) {
print "$_\n";
}
close($file_fh);
---------------------------
I can even split on that regular expression.
But I'm just concerned about losing inline breaks.
Thoughts?
Thanks.
--Alex
_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm