I just started learning Perl; this is the first program i've ever tried to write. I can't really figure out what i'm doing wrong (one, because I don't know, and two, because my interpreter won't stay open long enough to tell me; it closes right when the program finishes). Can anyone help me figure out what i'm doing wrong? This is supposed to find primes between two numbers. (And if you could help with the interpreter issue, that'd be nice, too).
<code> use strict; use warnings; #finds prime numbers between two points; print "Please enter the values for the 2 numbers between which you wis +h to find the primes.\n"; $x=<STDIN>; chomp($x); print "\n"; #user inputs point x; $y=<STDIN>; chomp($y); print "\n"; #user inputs point y; for($i==$x; $i==$y; $i++){ $even=0; $notprime=0; $j=$i/2; if(int($j)==$j){ $even=1; # tests to see if it is even; } else{ $n=$i**(1/2); for($m=3; $m=$n; $m+=2){ $o=$i/$m; if(int($o)==$o){ $notprime=1; } } } if($even==0 && $prime==0){ print "$i is prime!\n"; } } $q=<STDIN>; # stops the program from closing...;
If anyone wants to help me figure out what's wrong... just let me know what you did? Thanks.

In reply to Debugging? by Andrew_Levenson

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.