I decided that I would try it myself, and I have found that the code below
is correct. For a tied hash (%hash), and the variable $hashref is assigned
\%hash the following lines are equivalent:
$hashref->{key} eq $hash{key};
$hash{key} eq $hash{key};
Brad Handy
--www.jack-of-all-trades.net
[EMAIL PROTECTED]
> -----Original Message-----
> From: Bradley M. Handy [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 01, 2001 10:27 AM
> To: [EMAIL PROTECTED]
> Subject: Tie and HASHREF's
>
>
> I am wondering about the use of tie with hashes and then returning a
> reference to that tied hash.
>
> If have the following code:
>
> ##--- Begin Code
>
>
> #!/usr/bin/perl -w
>
> use strict;
> use Apache::Session::DB_File;
>
> my %session;
> tie %session, Apache::Session::DB_File, ,
> {FileName=>'/path/to/db_file', LockDirectory=>'path/to/'};
> my $hashref = \%session;
>
> ##--- End Code
>
> Is
>
> $hashref->{session_var} = session_value;
>
> the same as
>
> $session{session_var} = session_value;
>
>
> ========================================================
> Bradley M. Handy
> Programmer/Analyst, Spring Arbor University
> 106 E. Main Street, St 22, Spring Arbor, Michigan 49283
> ========================================================
> Phone: +1 517 750 6675
> +1 800 968 9103 x1675
> Email: [EMAIL PROTECTED]
> ========================================================
> If women don't find you handsome, they should at least
> find you handy.
> -- Steve Smith as Red Green from The Red Green Show
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]