---------- Forwarded message ---------- From: Robert Citek <[EMAIL PROTECTED]> Date: Jan 8, 2008 3:39 PM Subject: Re: avoid using a temporary variable To: "John W. Krahn" <[EMAIL PROTECTED]>
On Jan 8, 2008 3:09 PM, John W. Krahn <[EMAIL PROTECTED]> wrote: > John W. Krahn wrote: > > You don't really need ls either: > > > > $ perl -le 'print "(", join ",", map( { chomp; "\047$_\047" } <*> ), ")"' > > Or chomp: > > $ perl -le 'print "(", join ",", map( "\047$_\047", <*> ), ")"' That makes the script very specific. Substitute a data stream for ls and the script breaks. In contrast, this works: $ { date ; seq 1 100 ; } | perl -le 'print "(" . join(",", map( { chomp; "\047$_\047" } <> )) . ")"' Regards, - Robert -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/