Fwd: avoid using a temporary variable

2008-01-08 Thread Robert Citek
-- 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: > Joh

Re: avoid using a temporary variable

2008-01-08 Thread Robert Citek
On Jan 8, 2008 2:33 PM, John W. Krahn <[EMAIL PROTECTED]> wrote: > Robert Citek wrote: > > $ ls | perl -e 'print "('\''" . join("'\'','\''", map { chomp; $_ } > > (<>) ) . "'\'') \n" ; ' > > $ ls | perl -le 'print "(", join ",", map( { chomp; "\047$_\047" } <> ), > ")"' Nice example of putting the

Re: avoid using a temporary variable

2008-01-08 Thread John W. Krahn
John W. Krahn wrote: John W. Krahn wrote: Robert Citek wrote: On Jan 8, 2008 9:40 AM, Robert Citek <[EMAIL PROTECTED]> wrote: On Jan 8, 2008 9:24 AM, Robert Citek <[EMAIL PROTECTED]> wrote: What I really want to know is if there's a way to eliminate the temporary variable. If not, that's fin

Re: avoid using a temporary variable

2008-01-08 Thread John W. Krahn
John W. Krahn wrote: Robert Citek wrote: On Jan 8, 2008 9:40 AM, Robert Citek <[EMAIL PROTECTED]> wrote: On Jan 8, 2008 9:24 AM, Robert Citek <[EMAIL PROTECTED]> wrote: What I really want to know is if there's a way to eliminate the temporary variable. If not, that's fine. I was just wonderi

Re: avoid using a temporary variable

2008-01-08 Thread John W. Krahn
Robert Citek wrote: On Jan 8, 2008 9:40 AM, Robert Citek <[EMAIL PROTECTED]> wrote: On Jan 8, 2008 9:24 AM, Robert Citek <[EMAIL PROTECTED]> wrote: What I really want to know is if there's a way to eliminate the temporary variable. If not, that's fine. I was just wondering if there's somethin

Re: avoid using a temporary variable

2008-01-08 Thread John W. Krahn
Robert Citek wrote: How can I get rid of the @foo? This does what I want, but uses the "temporary" variable @foo: $ ls | perl -e '@foo=<>; chomp @foo ; print join(" ", @foo)' This eliminates the temporary variable but doesn't work: $ ls | perl -e 'print join(" ", chomp(<>))' $ ls | perl -l4

Re: avoid using a temporary variable

2008-01-08 Thread Paul Johnson
On Tue, Jan 08, 2008 at 08:07:02AM -0800, Paul Lalli wrote: > On Jan 7, 6:59 pm, [EMAIL PROTECTED] (Robert Citek) wrote: > > How can I get rid of the @foo? > > > > This does what I want, but uses the "temporary" variable @foo: > > > > $ ls | perl -e '@foo=<>; chomp @foo ; print join(" ", @foo)' > >

Re: avoid using a temporary variable

2008-01-08 Thread Robert Citek
On Jan 8, 2008 11:14 AM, Tom Phoenix <[EMAIL PROTECTED]> wrote: > On Jan 8, 2008 7:38 AM, Robert Citek <[EMAIL PROTECTED]> wrote: > > What I really want to know is if there's a way to eliminate the > > temporary variable. > > Are temporary variables quite expensive in your country? > > Cheers! You

Re: avoid using a temporary variable

2008-01-08 Thread Robert Citek
On Jan 8, 2008 9:40 AM, Robert Citek <[EMAIL PROTECTED]> wrote: > On Jan 8, 2008 9:24 AM, Robert Citek <[EMAIL PROTECTED]> wrote: > > What I really want to know is if there's a way to eliminate the > > temporary variable. If not, that's fine. I was just wondering if > > there's something I'm over

Re: avoid using a temporary variable

2008-01-08 Thread Tom Phoenix
On Jan 8, 2008 7:38 AM, Robert Citek <[EMAIL PROTECTED]> wrote: > What I really want to know is if there's a way to eliminate the > temporary variable. Are temporary variables quite expensive in your country? Cheers! --Tom Phoenix Stonehenge Perl Training -- To unsubscribe, e-mail: [EMAIL PRO

Re: avoid using a temporary variable

2008-01-08 Thread Paul Lalli
On Jan 7, 6:59 pm, [EMAIL PROTECTED] (Robert Citek) wrote: > How can I get rid of the @foo? > > This does what I want, but uses the "temporary" variable @foo: > > $ ls | perl -e '@foo=<>; chomp @foo ; print join(" ", @foo)' > > This eliminates the temporary variable but doesn't work: > > $ ls | per

Re: avoid using a temporary variable

2008-01-08 Thread Robert Citek
On Jan 8, 2008 9:24 AM, Robert Citek <[EMAIL PROTECTED]> wrote: > On Jan 8, 2008 8:59 AM, Chas. Owens <[EMAIL PROTECTED]> wrote: > > On Jan 7, 2008 6:59 PM, Robert Citek <[EMAIL PROTECTED]> wrote: > > > How can I get rid of the @foo? > > > > > > This does what I want, but uses the "temporary" varia

Fwd: avoid using a temporary variable

2008-01-08 Thread Robert Citek
-- Forwarded message -- From: Robert Citek <[EMAIL PROTECTED]> Date: Jan 8, 2008 9:24 AM Subject: Re: avoid using a temporary variable To: "Chas. Owens" <[EMAIL PROTECTED]> On Jan 8, 2008 8:59 AM, Chas. Owens <[EMAIL PROTECTED]> wrote: > On Ja

Re: avoid using a temporary variable

2008-01-08 Thread Martin Barth
On 0:59:22 08/01/2008 "Robert Citek" <[EMAIL PROTECTED]> wrote: > How can I get rid of the @foo? > $ ls | perl -e '@foo=<>; chomp @foo ; print join(" ", @foo)' hi! ls | perl -pe 's/\n\ /' perldoc perlrun: -p causes Perl to assume the following loop around your program, whic

Re: avoid using a temporary variable

2008-01-08 Thread Chas. Owens
On Jan 7, 2008 6:59 PM, Robert Citek <[EMAIL PROTECTED]> wrote: > How can I get rid of the @foo? > > This does what I want, but uses the "temporary" variable @foo: > > $ ls | perl -e '@foo=<>; chomp @foo ; print join(" ", @foo)' > > This eliminates the temporary variable but doesn't work: > > $ ls

avoid using a temporary variable

2008-01-08 Thread Robert Citek
How can I get rid of the @foo? This does what I want, but uses the "temporary" variable @foo: $ ls | perl -e '@foo=<>; chomp @foo ; print join(" ", @foo)' This eliminates the temporary variable but doesn't work: $ ls | perl -e 'print join(" ", chomp(<>))' Thanks in advance. Regards, - Robert