print "input three numbers separated by spaces\n"; my $user_input = <>;

This is good as far as it goes: you're getting something | a string from  STDIN that is terminated by a newline.

chomp $user_input;

This is good too, except you do it twice more and this is where you start to go off the rails. chomp removes a newline (if present) from the end of a string (well, it's a little more involved than that, but let it stand for now), $user_input in this case, so doing it repeatedly will not usually get you anything. For learning/development/debugging, I would advise placing a print statement after this step so you can be sure exactly what you are dealing with:
    print "A: '$user_unput' \n";
(In general, develop your code step-by-step and use print statements at each successive step to see just what is happening. If weird stuff starts to happen, understand the problem before proceeding.)

my ($nr1) = $user_input, "$a";

This has no meaning. You are assigning  $user_input to  $nr1 (why?) and interpolating  $a (which has no value at this point) into a string, which you then throw away: what do you think is happening here? (Update: Two other, similar statements have the same problem.)

Please consider these and other points raised so far, write some more code and post again.

Update: Do continue to  use strict; and  use warnings; in your code (use Modern::Perl; includes both of these). They will make learning Perl much easier.


In reply to Re^3: Simple Arithmetic Question by AnomalousMonk
in thread Simple Arithmetic Question by pcoady

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.