Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Use of uninitialized value in string

Use of uninitialized value in string

Use of uninitialized value in string

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:


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{$_} }

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

RE: Use of uninitialized value in string

This is a tad brute force, but will get you there


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.

RE: Use of uninitialized value in string

Many thanks PNB, I will incorporate your code this morning.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close