Ugh, I'm being foolish. Let me clarify.
map { s/\r\n/ } @chomp_me;
would do the trick, for lists of things that need to be chomped. Perhaps
just a modification to the map function is needed, to support things like:
for(map { s/\r\n/ } $fh) {
print;
}
or maybe bind chomp to a new prototype using map, to provide all the
functionality we're discussing:
while(chomp { \r\n } $fh) {
print;
}
I would give more detail but I'm wandering off of familiar ground. What
we would want is a replacement chomp function that takes the first
parameter (if any) as a regexp, the second parameter as a list (ie, @ary =
<$fh>), and unfolds it into a for loop, as such:
for(@to_be_chomped) {
$_ =~ s/$regexp//;
}
return want(); # etc
I hope I'm being clear. :-P
On Tue, 8 Aug 2000, Mike Pastore wrote:
> On Tue, 8 Aug 2000, Ted Ashton wrote:
>
> >
> > Quite true. The two-argument one is new to me and I hadn't thought much
> > about it. Do you have a suggestion?
>
> Hmm,
>
> chomp { /\r\n/ } @chomp_me;
>
> ala p5 map, grep, and sort?
>
> --
> Mike Pastore
> [EMAIL PROTECTED]
>