macperl deletes lines ....
[email protected] (Brandon Barker) Tue, 19 Jun 2001 11:33:27 -0400
| Newsgroups | perl.macperl.anyperl |
|---|---|
| Message-ID | <[email protected]> |
I'm having trouble writing a script that will remove the regular
expression "<B>" in a text file in macperl. At first I thought I was
making a programming mistake but I tried the same script in Linux and it
worked as expected; in macperl the <B> will be removed but every line
after the first will be deleted in the output file. I've included the
code as well as the droplet and a sample input file "funerals" in this
email.
#!/usr/bin/perl -w
{
foreach $inFile (@ARGV) {
open (INNEWSFILE, $inFile);
open (OUTTEXTFILE,">".$inFile.".txt");
$newsFile = <INNEWSFILE>;
$newsFile =~ s/<B>//g;
print OUTTEXTFILE $newsFile;
close (INNEWSFILE);
}
}
(unnamed)
(application/applefile, 7.5 KB) - not displayed
newseditfix.pl
(application/octet-stream, 0 B)
funerals
(application/text, 4.2 KB) - not displayed