Hello Monks. Currently, I am making this program that pretty much serves as a study guide for my math class. Unit 6 has to do with quadrilaterals, so I made another script aside from Unit6.pl called CMQIA.pl that runs the "Casio-Maxim Quadrilateral Identification Algorithm" (don't ask). I made it so that if you type "quit" into the script, it'll go back to Unit6.pl. I used:  if($choice !~ /ready/i) {require "Unit6.pl";} Since require LABEL; runs the program, I thought it would work. However, since Unit6.pl has  if($Choice =~ /crazy maxim/i) {require "CMQIA.pl";} something really weird happens now. If I run Unit6.pl and I type crazy maxim, it goes to CMQIA.pl. Then, if I type quit in CMQIA.pl, it goes back to Unit6.pl. Then, if I go to CMQIA.pl from there again, it gives me:  Can't exec "Unit6.pl": No such file or directory at CMQIA.pl line 12, <STDIN> line 3. I've tried a bunch of other things in conjunction with the original code from CMQIA.pl, but nothing ever really works. Any solutions? This is the full code. Unit6.pl
#!/usr/bin/perl -w use strict; CHOICE: print " This is Unit 6 - Quadrilaterals and Polygons.\n For the Final Exam, you will have to know the\n properties of all quadrilaterals and how to\n prove that a given shape is any quadrilateral.\n To access the Quadrilateral Information Database,\n type 'Quads.' To access the Casio-Maxim Quadrilateral\n Identification Algorithm, type 'crazy Maxim.'\n Type 'quit' to exit Unit 6.\n Type your choice.\n\n"; my $Choice = <STDIN>; chomp $Choice; if($Choice =~ /quit/i) {print "\nBye.\n\n"; exit;} if($Choice =~ /quads/i) {require "Quadrilaterals.pl";} if($Choice =~ /crazy maxim/i) {require "CMQIA.pl";}
CMQIA.pl
#!/usr/bin/perl -w use strict; ORIGINAL: print " Welcome to the Casio-Maxim Quadrilateral Identification\n Algorithm. In order to identify said quadrilateral,\n you must have the coordinates of all 4 vertices.\n"; PROMPT: print " When you are ready to input your coordines, type\n 'ready.' Type anything else to exit the CMQIA.\n\n"; my $choice = <STDIN>; if($choice =~ /ready/i) {goto MAXIM;} if($choice !~ /ready/i) {require "Unit6.pl"; system("Unit6.pl"); requi +re "Unit6.pl"; goto ORIGINAL;} MAXIM: print "\nFor shape ABCD, in which point A has coordinates (X1, +Y1), B has coordinates\n\n(X2, Y2), C has coordinates (X3, Y3), and D + has coordinates (X4, Y4),\n\nX1 = "; my $AX = <STDIN>; chomp $AX; …

In reply to Error with require LABEL; by slinky773

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.