Re: s/// w/o intermediate variables?

2004-05-05 Thread Bart Lateur
On Wed, 5 May 2004 02:04:54 +0100, Allen, Greg wrote: But if we were golfing... Well I suppose it's still pretty ugly. I do find the ($transformed = $package) =~ s,::,/,g; construction pretty unreadable though. People expect flow of control to be left to right, while data flow in assignments is

Re: s/// w/o intermediate variables?

2004-05-04 Thread Marcus Holland-Moritz
On 2004-05-04, at 11:13:38 -0400, [EMAIL PROTECTED] wrote: Here's an example of a recurrent annoyance: my $package = 'Foo::Bar::Baz'; (my $package_filename = $package) =~ s,::,/,g; require $package_filename; $package-foobar(); One of my many neurotic little peeves is that,

RE: s/// w/o intermediate variables?

2004-05-04 Thread Allen, Greg
use File::Spec; my $package = 'Foo::Bar::Baz'; require File::Spec-catfile(split /::/, $package); more generally, this works for me: $tranformed = map {local $_=$_; s,::,/,g; $_} $package Greg -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, May 04,

Re: s/// w/o intermediate variables?

2004-05-04 Thread kynn
From: [EMAIL PROTECTED] (Randal L. Schwartz) Date: 04 May 2004 09:26:52 -0700 Greg == Greg Allen [EMAIL PROTECTED] writes: Greg $tranformed = map {local $_=$_; s,::,/,g; $_} $package Ugh. I'd strangle someone who did that. $tranformed = do { local $_ = $package;

Re: s/// w/o intermediate variables?

2004-05-04 Thread Michael W Thelen
* Allen, Greg [EMAIL PROTECTED] [2004-05-04 10:27]: more generally, this works for me: $tranformed = map {local $_=$_; s,::,/,g; $_} $package It does..? When I run that, $transformed gets a value of 1, since that's what the map returns in scalar context. I think you meant to put parens

Re: s/// w/o intermediate variables?

2004-05-04 Thread Georg Moritz
From the keyboard of [EMAIL PROTECTED] [04.05.04,11:13]: Here's an example of a recurrent annoyance: my $package = 'Foo::Bar::Baz'; (my $package_filename = $package) =~ s,::,/,g; require $package_filename; $package-foobar(); One of my many neurotic little peeves is that,

Re: s/// w/o intermediate variables?

2004-05-04 Thread Paul Makepeace
Je 2004-05-04 20:30:40 +0100, [EMAIL PROTECTED] skribis: From: [EMAIL PROTECTED] (Randal L. Schwartz) Date: 04 May 2004 09:26:52 -0700 Greg == Greg Allen [EMAIL PROTECTED] writes: Greg $tranformed = map {local $_=$_; s,::,/,g; $_} $package Ugh. I'd strangle someone who did