Gossamer Forum
Home : General : Perl Programming :

Help with HASHES

Quote Reply
Help with HASHES
Hi Peoples,

Im kinda new to perl, so here's a quick question, maybe somenoe can even think of an alternative ?

I'm trying to create a hash, then reference it later, but my values in the hash are multiple field like so...

%cmd = qw(
bankloan "/apps/bklnsrv/blcor/scripts/blbert.sh"
dealviewer "/apps/mts/bin/DealViewer.sh -display \@d&"
);


When i reference it using:

my $choice = $cmd{dealviewer}

All i get is : "/apps/mts/bin/DealViewer.sh (it left out the -display \@d&")


How do i grab the whole value if my values are more than one word ? Thanks in advance
Quote Reply
Re: [mtorres] Help with HASHES In reply to
This works for me:

%cmd = (
bankloan => '/apps/bklnsrv/blcor/scripts/blbert.sh',
dealviewer => '/apps/mts/bin/DealViewer.sh -display \@d&'
);


my $choice = $cmd{dealviewer} ;
print $choice;
Quote Reply
Re: [Watts] Help with HASHES In reply to
doh!, that works , thanks alot

those single and double quotes all fsck me up. Thanks