Uninitialized value errors

  • Thread starter Archimede Pitagorico
  • Start date
A

axel

Archimede Pitagorico said:
This code give me many errors:

1) Use of uninitialized value in numeric gt (>) ....
Why? Thanks.

If you cannot be bothered to actually post your code, why should we
bother to look it up on the web?

Axel
 
A

Archimede Pitagorico

If you cannot be bothered to actually post your code, why should we
bother to look it up on the web?

Axel

Sorry but I have think that long code can be a problem in newsgroups.
:(
 
A

Archimede Pitagorico

beceuse you haven't read any values into $num1 and $num2 variables.
they remain uninitialized. i haven't used String::Scanf module before
but you don't have to use it to solve your problem. instead of using
sscanf try this:

my $line = <>;
($num1, $num2) = $line =~ /(\d+).*?(\d+)/;

you can also remove $input variable and put some tests after above 2
lines to ensure that both, $num1 and $num2 are defined - contain some
values. be aware that the user can provide any input line - even the
one you aren't expecting.

best regards,
ks


Ok thanks :)
 
A

axel

Archimede Pitagorico said:
If you cannot be bothered to actually post your code, why should we
bother to look it up on the web?
[/QUOTE]
Sorry but I have think that long code can be a problem in newsgroups.
:(

Long code is a problem anyway... the Posting Guidelines give guidance as
to providing the best means of receiving help.

Besides that, posting the code to the newsgroup is much less of a problem
than putting it on a web site.

- People need to start a browser to view the code instead of just
reading it in context with the problem.

- Answers relating to the code are not very meaningful unless those
reading the follow-ups also go to the effort of visiting the web page.
Which manages to destroy guidelines about posting replies in context
unless the replier is willing to cut and paste.

- The web page will no doubt be ephemeral and thus the archives of the
group will contain posts with little meaning since essential
information is lacking (the same as posting material with an
X-No-Archive header).

- In general it just involves a great deal more work for everyone with
no gain whatsoever.

Sorry to go on at length, but it is something which does annoy me... you
are certainly not the only person to do this and doubtless will not be
the last.

Axel
 
J

Josef Moellers

If you cannot be bothered to actually post your code, why should we
bother to look it up on the web?

Also, the error message given (omitting the line number) would require
us to actually run the script. Running an unknown, and in this case
*known* *buggy* script is pretty much like eating something found on the
sidewalk.
 
A

anno4000

Archimede Pitagorico said:
This code give me many errors:

http://nopaste.info/6ec866c6ea.html

1) Use of uninitialized value in numeric gt (>) ....

That's a rather misleading description of your program's behavior.

Why don't you mention the other 13 error messages you're getting?
Why don't you mention that the program asks you to enter two integers
but doesn't give you the chance to do so?

Anno
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top