Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Error with require LABEL;

by tangent (Parson)
on Dec 19, 2013 at 23:15 UTC ( [id://1067897]=note: print w/replies, xml ) Need Help??


in reply to Error with require LABEL;

This line in CMQIA.pl:
if($choice !~ /ready/i) {require "Unit6.pl"; system("Unit6.pl"); requi +re "Unit6.pl"; goto ORIGINAL;}
Should that not be:
if($choice !~ /ready/i) {require "Unit6.pl";}
Also, it might be safer to use if ... elsif

Update: see revised comment below

Replies are listed 'Best First'.
Re^2: Error with require LABEL;
by slinky773 (Sexton) on Dec 19, 2013 at 23:24 UTC
    That skips  require "Unit6.pl"; entirely. I have no idea why. It just goes straight onto the rest of the script.

      require() skips loading the second time because it records internally which file it already has loaded and therefore doesn't need to load again. This is because require was used to load libraries in early perl versions. Later use() replaced require() because it does much more.

      But using require to start other scripts is definitely not as intended. As you have experienced.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1067897]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2024-04-25 06:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found