http://www.perlmonks.org?node_id=1056386


in reply to Do values from string exist within array?

Do you actually have a structure that looks like this?

my %hash = ( 'GrpID' => [ 123, 456 ] );

That would be a hash with a single key, whose value is an arrayref. You could find out how many values were present by looking at the value of scalar @{$hash{'GrpID'}} -- in this example, the value should be 2, meaning there are multiple values.

And you'd put values into that hash entry with

push ( @{$hash{'GrpID'}}, 789 );
I'd recommend you pop into the Perl debugger and try this stuff out. The debugger's a great place to try out Perl constructs.

Alex / talexb / Toronto

Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.