Perl/PHP Hash array
Posted: Wed Oct 21, 2009 11:20 am
Is there any form of text that I can use to introduce the whole of an associative array into RunRev?
In Perl I can say something similar to using put in RunRev like this.
RunRev
put varValue into hashArray[tKey]
Perl
$hash{ $key } = $value;
In Perl if I want to write a whole a hash array I can use this:
%hash = (
key1 => 'value1',
key2 => 'value2',
key3 => 'value3',
key4 => 'value4',
key5 => 'value5',
key6 => 'value6',
key7 => 'value7',
);
I use these all of the time, sometimes with hundreds of key value pairs. Short of using chunk expressions and a loop to "put" each value into a key of the array is there a way that I can write a whole associative array and introduce it into a RunRev script?
Thanks
Phil
In Perl I can say something similar to using put in RunRev like this.
RunRev
put varValue into hashArray[tKey]
Perl
$hash{ $key } = $value;
In Perl if I want to write a whole a hash array I can use this:
%hash = (
key1 => 'value1',
key2 => 'value2',
key3 => 'value3',
key4 => 'value4',
key5 => 'value5',
key6 => 'value6',
key7 => 'value7',
);
I use these all of the time, sometimes with hundreds of key value pairs. Short of using chunk expressions and a loop to "put" each value into a key of the array is there a way that I can write a whole associative array and introduce it into a RunRev script?
Thanks
Phil