in reply to Re: Re: "Use of uninitialized value" with many variables
in thread "Use of uninitialized value" with many variables

my %txt; my @field = qw( AnniversaryDate BirthDate EmailAddr FaxNo MobileNo ... ); @txt{@field} = ('') x @field;
Update: corrected thinko as per CombatSquirrel's reply.

Makeshifts last the longest.

Replies are listed 'Best First'.
Re: Re^3: "Use of uninitialized value" with many variables
by CombatSquirrel (Hermit) on Oct 06, 2003 at 07:59 UTC
    Actually, '' x @field just concatenates @field empty strings and returns that string. This still causes the warning.
    You probably had a typo, intending to say @txt{@field} = ('') x @field;.
    Cheers,
    CombatSquirrel.
    Entropy is the tendency of everything going to hell.
Re: Re^3: "Use of uninitialized value" with many variables
by gwadej (Chaplain) on Oct 06, 2003 at 03:27 UTC

    I still stumble over the hash-slice syntax. I guess I just have to keep working with it.

    Thanks for the reminder.

    G. Wade