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

Re: [FWP] appending to two strings



John Porter wrote:
> 
> 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 );
> 

i always thought the "." operator was higher overhead becasue it had
more storage management.  why not:

	( $a, $b ) = map { "$_$append" } ( $string1, $string2 );

-- 
 Steven Lembark                                   2930 W. Palmer St.
                                                 Chicago, IL  60647
 lembark@wrkhors.com                                   800-762-1582

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