Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

aborted due Compilation error (!!??)

by franky (Initiate)
on May 04, 2012 at 05:07 UTC ( [id://968858]=perlquestion: print w/replies, xml ) Need Help??

franky has asked for the wisdom of the Perl Monks concerning the following question:

Hi Folks, Please help, don't know what to do... :( I'm windows user, but 3 years a go a perl programmer did a small pl program and installed for me under pclinux os. (stand alone computer) The program work fine until a crash that i had recently. the program is called myperl60f.pl and the configuration file myperl60f.ini The program work with the following packages : curses::ui, test::more, test::pod. (Already installed) The way i called the program was as follow : On Linux desktop, "Right click"-> on "myProg" folder, then on "action" -> Open "terminal here" Then i type : perl -w myperl60f.pl Then i'm having the following error : franky@localhost myprog$ perl -w myperl60f.pl Bareword "MainLoop" not allowed while "strict subs" in use at myperl60f.pl line 112. Execution of myperl60f.pl aborted due to compilation errors. Please need help. P.S Program have-->   #!/usr/bin/perl -w Thank you !!!

Replies are listed 'Best First'.
Re: aborted due Compilation error (!!??)
by chromatic (Archbishop) on May 04, 2012 at 05:21 UTC

    Change line 112 from:

    MainLoop;

    ... to:

    MainLoop();

    That may not fix all of the errors, but that will fix the error you mentioned. If you have other errors, you'll have to show the entire code and the verbatim error messages.


    Improve your skills with Modern Perl: the free book.

      Hi Mr chromatic, I did Changed from  MainLoop; ... to:  MainLoop(); Then I called the program and, after enter, program didn't do any Action (cursor just went to next line) franky@localhost myprog$ perl -w myperl60f.pl franky@localhost myprog$

        You'll have to post the code. We can't help you without seeing it.

        Please see Writeup Formatting Tips before you post it.

Re: aborted due Compilation error (!!??)
by NetWallah (Canon) on May 04, 2012 at 05:35 UTC
    Welcome to the Monastery!

    If you are intimidated by code changes, as suggested by chromatic, here is an alternative.

    Add the following line BEFORE any line that gives you that syntax error:

    no strict "subs";
    Of course, this is NOT good/recommended programming practice, but, if you are a perl novice, it will help you get past the immediate issues, until you get more comfortable with code changes and "real" corrections.

    P.S. You can use certain (limited) html markup, such as the <p> tag, to format your writeup. See Writeup Formatting Tips for details.

    Update: Redacted - please see notes in my next post below..

                 I hope life isn't a big joke, because I don't get it.
                       -SNL

      NetWallah, I'm curious...

      If franky is intimidated by chromatic's suggested code change, why would they not be inimidated by your suggested code changes?

        It is franky's first post, and he is an admitted noob. I anticipated that he would have more than one occurrence of access to an undeclared sub.

        My logic was that for a noob, a cookie-cutter "environmental change" solution would be better than "changes to the perl code".

                     I hope life isn't a big joke, because I don't get it.
                           -SNL

      Hi Mr NetWallah, also i Applied on line 16 your suggestion, I changed  use strict ;      to :     use no strict subs; And i got a long message : frankyy@localhost myprog$ perl -w myperl60f.pl Can't locate no.pm in @INC (@INC contains: /usr/lib/perl5/site_perl/5.10.1/i386-linux-thread-multi /usr/lib/perl5/site_perl/5.10.1 /usr/lib/perl5/vendor_perl/5.10.1/i386-linux-thread-multi /usr/lib/perl5/vendor_perl/5.10.1 /usr/lib/perl5/5.10.1/i386-linux-thread-multi /usr/lib/perl5/5.10.1 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl .) at myperl60f.pl line 16. BEGIN failed--compilation aborted at myperl60f.pl line 16. franky@localhost myprog$ - P.S I used first Mr chromatic Sugesttion, then yours,and finally i applied both suggestion at once

        My suggestion was "no strict "subs"" - it id not include the word "use".

        If you want to disable "use strict", simply comment it out at the top of the code. (Insert "#" as the first character (without the quotes))

        Also - it would help readers if you formatted your post using HTML paragraph markers: <p> and/or <br/>

                     I hope life isn't a big joke, because I don't get it.
                           -SNL

Log In?
Username:
Password:

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

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

    No recent polls found