Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

blessed object containing reference to hash

Status
Not open for further replies.

arcnon

Programmer
Aug 12, 2003
242
US
I want to alter the %find in my constructor from a accessor method.
Code:
package Excel::Tabbed;
use strict;

use Exporter();
our @ISA = qw(Exporter);
our @EXPORT = qw(connect);
our $VERSION = 1.00; 

# ie new constructor 
sub connect{
	my $class = $_[0];
    
    if (-e "$_[1]"){ 
    
    	my %find;
		my $object = {
			connect => $_[1],
			prepare => '',
			select => '',
			where => \%find,
			column => '',
			records => '',
		};
                   
		bless $object, $class;
		return $object; 
	}
	else{
		die "file: $_[1] doesn't reside at path\n";
	}            
}

how do I add elements to the find hash? I thought:

Code:
....
my ($self,$args) = @_;
my $find = $self->{where};			
${find}->{name} = 'test';
am I going about this the wrong way?
thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top