Re: [PBML] How to traverse through a array reference
- From: "saurabh talwar" <talwar.saurabh@...>
> I am having problems going through the hash reference and outputting theuse Data::Dumper;
> Can someone tell me how to traverse thorugh the output of "p4 info" using
> p4 info is a command in perforce.
> Is there any way I can increment an address and look what is stored inside
> till I hit EOF just like C . The reason is that this array could be an array
> of hashes or array of arrays or any mixed combination.
> Any help is greatly appreciated ?
> sub run_info()
> my $key;
> my $value;
> my $p4_info;
> my $val;
> $p4_info = $p4->Run( "info" );
> ## p4_info is a reference to an array but I dont know what is inside that
> ## p4_info is ARRAY(0x226f8c)
Once you know what's inside the $p4_info you can acces the bits.
===== Jenda@... === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery