[26494] in Perl-Users-Digest
Perl-Users Digest, Issue: 8654 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Nov 10 21:05:30 2005
Date: Thu, 10 Nov 2005 18:05:05 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 10 Nov 2005 Volume: 10 Number: 8654
Today's topics:
Re: how to interpret string as code? <No_4@dsl.pipex.com>
Re: Need workaround for regex bug in 5.8.6 <nospam-abuse@ilyaz.org>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 10 Nov 2005 23:34:21 +0000
From: Big and Blue <No_4@dsl.pipex.com>
Subject: Re: how to interpret string as code?
Message-Id: <K5mdneXlZvxiRe7enZ2dnUVZ8qGdnZ2d@pipex.net>
Jason Quek wrote:
> Yes you're right, the variable names are only avialable at runtime. I
> understand your method and have several other work arounds, but I was
> wondering if my 'method' were possible. Possibly using 'eval',
> although I wasn't able to get it to work either.
As has been pointed out, the variable names you assign to need to be
known in advance (for use elsewhere in the program) - it's just the
assignment order you want to change.
Some simple options, by example:
They all assume that you can set $invert if you need to swap things.
1) Choose the l-value based on $invert
my ($f, $l);
$invert? ($l, $f): ($f, $l) = qw( first last );
print "f is $f\n";
print "l is $l\n";
2) Assign under one assumption the swap if necessary:
my ($f, $l) = qw( first last );
($f, $l) = ($l, $f) if ($invert);
print "f is $f\n";
print "l is $l\n";
--
Just because I've written it doesn't mean that
either you or I have to believe it.
------------------------------
Date: Thu, 10 Nov 2005 23:33:39 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: Need workaround for regex bug in 5.8.6
Message-Id: <dl0lcj$1jhv$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
James Marshall
<james@jmarshall.com>], who wrote in article <20051110080949.Q22930@jmarshall.com>:
> IZ> c) Do not use ()* on complicated constructs (likewise).
Actually, there is
d) Use ()* only on construct I fixed 5 years ago. It may have been
the "constant length of the group case" (do not remember...); so
if you could use
(..|ab)*
instead of yours
(.|ab)*
this may be crucial. (Or maybe it was length=1 case only?)
You need to experiment,
Ilya
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 8654
***************************************