From: deane.rothenma...@walgreens.com
> I'm almost ashamed to have to post this, because I know this is a newbie
> question, and I'm not really one of those any more, but I'm drawing a
> blank. Isn't there an easier way to initialize a list of variables, to a
> common value, than this:
>
> my
hi deane --
In a message dated 12/11/2008 11:29:11 A.M. Eastern Standard Time,
[EMAIL PROTECTED] writes:
> my ($a, $b, $c, $d, $e, $f) = ('init', 'init', 'init', 'init', 'init',
'init');
to init all to the same value without knowing in advance the number
of variables, how 'bout
Yeah, not sure 'map' is going to give you a trick here, unless there is
some other source that has the list of init values. You could try:
map { $$_ = 'init' } qw(a b c d e f);
but that's just wrong - map in a void context *and* the ref var name
thingee (
Can't use string ("a") as a SCALAR ref wh
On Dec 11, 2008, at 11:39 AM, Brian Raven wrote:
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: 11 December 2008 16:29
To: activeperl@listserv.ActiveState.com
Subject: Initializing list of variables
> Gurus,
>
> I'm almost ashamed to have to post this, be
Hi Deane,
2008/12/12 <[EMAIL PROTECTED]>:
> my ($a, $b, $c, $d, $e, $f) = ('init', 'init', 'init', 'init', 'init',
> 'init');
I thought "hmm, you want to repeat a value ... what about the
repetition operator?". Just for a lark, I tried:
> perl -e 'my ($a, $b, $c) = ('init') x 3; print "$a:$b:$c
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
[EMAIL PROTECTED]
Sent: 11 December 2008 16:29
To: activeperl@listserv.ActiveState.com
Subject: Initializing list of variables
> Gurus,
>
> I'm almost ashamed to have to post this, because I know this is a
newbie question, and I'm no