[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] appending to two strings



On Mon, Aug 16, 1999 at 01:05:02PM -0400, Rich Bowen wrote:
> 
> Is there a way to do the following two lines in one line? :
> 
> $string1 .= $append;
> $string2 .= $append;

  $_ .= $append for ( $string1, $string2 );

and if for is too "multi-line" for you, try map:

  ( $string1, $string2 ) = map { $_ . $append } ( $string1, $string2 );

One line, but longer.

-- 
John Porter


==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe