I am having problems going through the hash reference and outputting the result.
Can someone tell me how to traverse thorugh the output of "p4 info" using Perl.
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 ?
Expand|Select|Wrap|Line Numbers
- 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 array.
- ## p4_info is ARRAY(0x226f8c)
- print ("\n p4_info is $p4_info \n");
- #my $ref = \@p4_info;
- foreach $key ( sort keys %{$p4_info})
- {
- print( $key, "-> \n" );
- #print @{$p4_info->{"clientAddress"};
- }
- }
Sunny