* Kipp, James ([EMAIL PROTECTED]) wrote:
> perldoc perlreftut
> also read Ch 8-9 of Programming Perl 3rd Ed  if you have it.

Hash slices and reference and seperate issues...  Here are two examples of 
hash slices, one on a hash and one on a hash reference

    #!/usr/bin/perl -w
    use strict;

    my %normal_hash = ( firstname => "Jeff",
                        lastname  => "Bisbee",
                        email     => '[EMAIL PROTECTED]' );

    my $hash_ref    = { firstname => "John",
                        lastname  => "Doe",
                        email     => '[EMAIL PROTECTED]' };

    my @keys = qw( firstname lastname );

    my ($name1,$lastname1) = @normal_hash{@keys};  # normal slice
    my ($name2,$lastname2) = @$hash_ref{@keys};    # reference slice

    print "$name1 $lastname1\n";
    print "$name2 $lastname2\n";

-biz-

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to