HI all, I have a function which is tying a hash and when I pass it to
another function I want to be able to get the values of the hash in the
order they were set in, how would I do this?
Here's the function with the hash:
####################################################
sub get_users_table_and_columns{
my $self=shift;
use Tie::IxHash;
$self->{tables_and_columns}= Tie::IxHash->new(table=>'blog',
column1 =>'first_name',
column2 => 'last_name',
column3 => 'email',
column4 => 'password',
column5 => 'active'
);
return $self->{tables_and_columns};
}
#####################################################
I'm a bit lost as to what I'd put in here:
#####################################################
sub add_user{
my $self=shift;
my %tables_and_columns=shift;
my $first_name=shift;
my $last_name=shift;
my $email=shift;
my $password=shift;
my @columns_and_tables='';
for my $value ( keys %tables_and_columns ) { # this ain't working :'(
print "$value\n";
}
}
#################################################
Any ideas ?
Cheers for any advice.
Graeme :)
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>