logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

foreachLine substitution code reference: msg#00059

Subject: foreachLine substitution code reference
This example in the Mail::Message::Body foreachLine docs
doesn't work for me.

        $content->foreachLine( sub {(my $x=$_) =~ s/a/A/} );

This does:
        $content->foreachLine( sub {(my $x=$_) =~ s/a/A/; return $x} );

The other examples work.

I wonder if it is a problem of arrays being returned in scalar
context, because the output of the first type is a sequence of
digits, typically 1, like 1111111.

-- 
Greg Matheson                    The best jokes are 
Dr Bean's Penpal Pool            those you play on
Address: palpool                 yourself.
Domain:  @cn91.chinmin.edu.tw




<Prev in Thread] Current Thread [Next in Thread>