Matthew Walkup wrote:
>
> Paul,
>
> while (my $input = <FILE>)
> {
> next if $input =~ /\*/; # Removes the ***** seperator
> $input =~ s/\^M//ig;
> $input =~ s/\^\@//g;
> print OUTPUT $input;
>
> }
>
> - OR -
>
> while (<FILE>)
> {
> next if $_ =~ /\*/; # Removes the ***** seperator
> $_ =~ s/\^M//ig;
> $_ =~ s/\^\@//g;
> print OUTPUT $_;
>
> }
>
> I would suggest the first method, because I'm a little unsure of how $_
> works (how modifying a $_ variable with a regular expression really affects
> $_).
I prefer the second method using $_, but you don't need to write the $_ since
it's implied :
while (<FILE>) {
next if /\*/;
s/\^M//g;
s/\^\@//g;
print OUTPUT; # not needed here either
}
All of that assumes as I said earlier that the ^ chars are really there and
not just an ASCII rep. of the true ctrl char.
--
,-/- __ _ _ $Bill Luebkert ICQ=14439852
(_/ / ) // // DBE Collectibles Mailto:[EMAIL PROTECTED]
/ ) /--< o // // http://dbecoll.tripod.com/ (Free site for Perl)
-/-' /___/_<_</_</_ Castle of Medieval Myth & Magic http://www.todbe.com/
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs