No subject
Brose, Eric
eric.brose at attws.com
Thu Aug 15 16:25:46 CDT 2002
Hello all,
I have a several hashrefs I need to look through, all with similar/identical
structure. What I'd like to do, is have an array hold the exact places to
look in the hash ref. By cycling through the array, I'd like to do
something like below, where I just prepend the hashref name and I get to
view the goods.
@HBSource=("->{vtComponent}->{deployName}","->{vtComponent}->{vtFlow}->{vtPr
operty}->{channel}->{value}","->{vtComponent}->{vtFlow}->{vtProperty}->{host
name}->{value}","->{vtComponent}->{vtFlow}->{vtProperty}->{QManager}->{value
}","->{vtComponent}->{vtFlow}->{vtProperty}->{transactionQueue}->{value}","-
>{vtComponent}->{vtFlow}->{vtProperty}->{QName}->{value}");
foreach (@HBSource){
$value1 = $hash1."$_";
$value2 = $hash2."$_";
$value3 = $hash3."$_";
print "$value1\n$value2\n$value3\n";}
However, this just doesn't work. My output ends up looking like:
HASH(0x1cfebec)->{vtComponent}->{deployName}
HASH(0x1cfebec)->{vtComponent}->{vtFlow}->{vtProperty}->{channel}->{value}
HASH(0x1cfebec)->{vtComponent}->{vtFlow}->{vtProperty}->{hostname}->{value}
HASH(0x1cfebec)->{vtComponent}->{vtFlow}->{vtProperty}->{QManager}->{value}
HASH(0x1cfebec)->{vtComponent}->{vtFlow}->{vtProperty}->{transactionQueue}->
{value}
HASH(0x1cfebec)->{vtComponent}->{vtFlow}->{vtProperty}->{QName}->{value}
I have had success when I put the hashref name in the array(see below), but
I'd like to be able to programatically cycle through just one array.
@HBSource=("$hash->{vtComponent}->{deployName}","$hash->{vtComponent}->{vtFl
ow}->{vtProperty}->{channel}->{value}","$hash->{vtComponent}->{vtFlow}->{vtP
roperty}->{hostname}->{value}","$hash->{vtComponent}->{vtFlow}->{vtProperty}
->{QManager}->{value}","$hash->{vtComponent}->{vtFlow}->{vtProperty}->{trans
actionQueue}->{value}","$hash->{vtComponent}->{vtFlow}->{vtProperty}->{QName
}->{value}");
Any ideas would be appreciated.
Eric
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
POST TO: spug-list at pm.org PROBLEMS: owner-spug-list at pm.org
Subscriptions; Email to majordomo at pm.org: ACTION LIST EMAIL
Replace ACTION by subscribe or unsubscribe, EMAIL by your Email-address
For daily traffic, use spug-list for LIST ; for weekly, spug-list-digest
Seattle Perl Users Group (SPUG) Home Page: http://seattleperl.org
More information about the spug-list
mailing list