Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
Well, I've run that code through perltidy to see what I can see, and that looks very much like something called spaghetti code ... its to hard to read for humans, to hard to fix for humans, me included

So my advice, if you want to solve your warning, start rewriting the program to work without goto

See Text Based Perl Game and especially the responses (and links in responses) for specifics

So in the end you write something like, something short, where the control-flow is easy to seee (birds eye view), no gotos :) no spaghetti

sub LHCC { DECISION: while( 1 ) { WelcomeMsg(); my $decision = GetDecision(); if( $decision =~ /quit/ ) { last DECISION; } elsif( $decision =~ /ready/ ) { GoDoReadyDecision(); } else { TryAgainMessage(); } } } ## end sub LHCC sub GoDoReadyDecision { my $no_statements = GetNoStatements(); ...; GetQPStatements( \%Statements ); ...; my( $conclusions, $o_conclusions ) = ConcludeConclusions( \%Statements, \%Contrapositives ... ); return $conclusions, $o_conclusions; } ## end sub GoDoReadyDecision sub ConcludeConclusions { my( $Statements, $Contrapositives ) = @_; while( my( $key, $value ) = each %$Statements ) { ...; } for my $key ( keys %$Contrapositives ) { my $value = $Contrapositives->{$key}; ...; } ...; return \@Conclusion, \@OtherConclusion; } ## end sub ConcludeConclusions

And when you get "use of unitialized ..." you can focus only on one small subroutine, you Data::Dump::dd( \@_ ) and can debug only this one small part

Good luck


In reply to Re: Hash Uninitialized Values Error by Anonymous Monk
in thread Hash Uninitialized Values Error by slinky773

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (2)
As of 2022-01-29 14:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (74 votes). Check out past polls.

    Notices?