Hello,
I am trying to get to grips with modules. Here is my module code, saved in the lib folder as motor.pm.
And here is the .pl file, saved in perl\programs as motorVehicle.pl.Code:#!c:\perl\bin\perl.exe package Motor; 1; require Exporter; @ISA = ("Exporter"); @EXPORT = (); @EXPORT_OK = ("motorStatements"); sub motorStatements { $statements = print("\"I have an engine\"\n\"I have wheels\"\n\"I have doors\""); return $statements; }
When I type perl motorVehicle.pl, it prints the three lines as expected, but immediately after the last one there is a mysterious 1.Code:#!c:\perl\bin\perl.exe use Motor("motorStatements"); print motorStatements();
I don't know where it came from and can't get rid of it. What is happening?






Bookmarks