Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Use of uninitialized value in string

Status
Not open for further replies.

tonykent

IS-IT--Management
Jun 13, 2002
251
GB
It's been a while but I'm hoping one of you helpful guys can help me out again.

I'm trying to debug a 3000 line script written by a.n.other. When run it is throwing up dozens of warnings like this one:

Use of uninitialized value in string ne at ./ccrscript line 1528

The section of the script referred to is:

Code:
1525  foreach my $container ("section_block", "cluster", "release_part", "assembly") {
1526          my @prov_all_n;
1527          foreach my $cc ( sort keys %{ $h_set{"component"}}) {
1528           push @prov_all_n, 
	       grep { $h_set{"component"}{$cc}{$container} ne $h_set{"interface"}{$_}{$container}} 
               grep { !$group2if{$_} }
	       @{$h_set{"component"}{$cc}{"requires"}};
        }

I have dumped the hash to take a look at what is in it but it is gigantic so it is difficult to know where to start with it.

Can anyone suggest a bit of code that might help narrow down exactly which bit of line 1528/the data it is acting on that is throwing up the warnings?

Many thanks, Tony
 
This is a tad brute force, but will get you there
Code:
print "cc>$cc<\n" ;
print "container>$container<\n" ;
print "h_set'component'>$h_set{"component"}{$cc}{$container}<\n";
prnit "\$_>$_<\n"; ;
print "h_set'interface'>$h_set{"interface"}{$cc}{$container}<\n";
print "\$group2if{$_}>!$group2if{$_}<\n";
print "\$h_set{"component"}{$cc}{"requires"}>$h_set{"component"}{$cc}{"requires"}<\n";
print "arr>$#{$h_set{"component"}{$cc}{"requires"}}<\n" ;
... an old habbit of mine is to put ><'s around vars when dumping to screen. Helps w/ blank/space/null/undef questions.
 
Many thanks PNB, I will incorporate your code this morning.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top