Rob Tanner ([EMAIL PROTECTED]) said something to this effect:
> There's always more than one way to skin a cat, and I've tried several. 
> This is what I really want to accomplish:
> 
> my $colleague = {};
> @{$colleague} = { "status",
>                 "id",
>                 "last_name",
>                 "first_name",
>                 "middle_name",
>                 "campus",
>                 "dob"
>                } = split(/:/, $record);

Write it as @{$colleague}{@keys} = (@values), e.g.:

bash $ perl
my $colleague = {};
my $record = join(':',(1..7));
@{$colleague}{"status",
                  "id",
                  "last_name",
                  "first_name",
                  "middle_name",
                  "campus",
                  "dob"} = split(':',$record);
print map { sprintf "%s => %s\n",$_,$colleague->{$_} } keys %{$colleague};
^D
first_name => 4
status => 1
last_name => 3
campus => 6
id => 2
dob => 7
middle_name => 5
bash $

(darren)

-- 
Unix is an operating system, OS/2 is half an operating system, Windows
is a shell, and DOS is a boot partition virus.
-- Peter H. Coffin

Reply via email to