I think I messed up the .pl file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • quagmireman
    New Member
    • Sep 2007
    • 6

    I think I messed up the .pl file

    I am very new to perl... today is my first encounter. and i think i messed up pretty big.

    I was trying to update some info on a website, so i thought I could just open the index.pl file and change what was in there (and i didn't make a back up ) The program i used changed the formatting and i didn't realize this.


    Is this an acceptable practice to edit this file as long as you don't change the formatting?

    now i get this error on the site

    Internal Server Error
    The server encountered an internal error or misconfiguratio n and was unable to complete your request.

    Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.



    any ideas? suggestions?
  • numberwhun
    Recognized Expert Moderator Specialist
    • May 2007
    • 3467

    #2
    Originally posted by quagmireman
    I am very new to perl... today is my first encounter. and i think i messed up pretty big.

    I was trying to update some info on a website, so i thought I could just open the index.pl file and change what was in there (and i didn't make a back up ) The program i used changed the formatting and i didn't realize this.


    Is this an acceptable practice to edit this file as long as you don't change the formatting?

    now i get this error on the site

    Internal Server Error
    The server encountered an internal error or misconfiguratio n and was unable to complete your request.

    Please contact the server administrator, root@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.



    any ideas? suggestions?
    Yes, ALWAYS make a back up of any file you are going to modify. It helps you avoid these types of situations.

    We would definitely need to know more. What did you change? How did the formatting change? Can you post the code (surrounded by code tags) here?

    Regards,

    Jeff

    Comment

    • quagmireman
      New Member
      • Sep 2007
      • 6

      #3
      [code=perl]
      #!/usr/bin/perluse strict;use warnings;use diagnostics;use CGI;use CGI::Carp qw/fatalsToBrowser/;use DBI;use Data::Dumper;us e Registration;my $cgi = new CGI;Registratio n::print_header ($cgi);=headpri nt <<EOS;<p>Regist ration for the 2007 SWE Engineering Career Fair is not yet open.To be notified when registration opens, contact the Coordinator, EOSprint email_officer(" Coordinator")," . ";=cutprint <<EOS;<p>Regist ration opens Monday, November 26th, 2007.EOSprint <<EOS;</p><p>Company registration is \$450, and this includes one table/booth, lunch, and sufficient parking passes. Additional tables can be purchased for \$225 each. Hospitality suites overlooking the football field can also be purchased for \$300. This includes unlimited access to the suite during the career fair, private restroom, storage area, television monitors, and comfortable seating for company representatives or an interview room for students, at your discretion.</p><p>This year, for the first time, the Society of Women Engineers is offering a discount of \$150 to 501(c)(3) non-profit organizations and to government agencies. If this applies to you, please check the appropriate box on the registration page. Please note that this discount only applies to the first table, and that it is subject to verification.</p><p>Registrati on closes Thursday, February 1st, 2007. Late registrations will not be accepted.</p><p>Employer registration is limited to corporations, government agencies, and non-profit employers. We are unable to accept registrations from employment agencies and referral services.</p>EOSRegistrati on::print_foote r($cgi);
      [/code]

      i just changed some regular txt in here but i don't know how the original format is. I tried putting it all back on one line.
      Last edited by numberwhun; Sep 27 '07, 05:46 PM. Reason: add code tags

      Comment

      • quagmireman
        New Member
        • Sep 2007
        • 6

        #4
        i changed the

        Registration opens Monday, November 26th, 2007.

        Comment

        • numberwhun
          Recognized Expert Moderator Specialist
          • May 2007
          • 3467

          #5
          Originally posted by quagmireman
          [code=perl]
          #!/usr/bin/perluse strict;use warnings;use diagnostics;use CGI;use CGI::Carp qw/fatalsToBrowser/;use DBI;use Data::Dumper;us e Registration;my $cgi = new CGI;Registratio n::print_header ($cgi);=headpri nt <<EOS;<p>Regist ration for the 2007 SWE Engineering Career Fair is not yet open.To be notified when registration opens, contact the Coordinator, EOSprint email_officer(" Coordinator")," . ";=cutprint <<EOS;<p>Regist ration opens Monday, November 26th, 2007.EOSprint <<EOS;</p><p>Company registration is \$450, and this includes one table/booth, lunch, and sufficient parking passes. Additional tables can be purchased for \$225 each. Hospitality suites overlooking the football field can also be purchased for \$300. This includes unlimited access to the suite during the career fair, private restroom, storage area, television monitors, and comfortable seating for company representatives or an interview room for students, at your discretion.</p><p>This year, for the first time, the Society of Women Engineers is offering a discount of \$150 to 501(c)(3) non-profit organizations and to government agencies. If this applies to you, please check the appropriate box on the registration page. Please note that this discount only applies to the first table, and that it is subject to verification.</p><p>Registrati on closes Thursday, February 1st, 2007. Late registrations will not be accepted.</p><p>Employer registration is limited to corporations, government agencies, and non-profit employers. We are unable to accept registrations from employment agencies and referral services.</p>EOSRegistrati on::print_foote r($cgi);
          [/code]

          i just changed some regular txt in here but i don't know how the original format is. I tried putting it all back on one line.
          WOW!!! What did you use to do this again? (editor wise) If this code was formatted correctly before you made any changes, something drastic happened to get it in this condition.

          Lets see what we can do:

          [code=perl]
          #!/usr/bin/perl

          use strict;
          use warnings;
          use diagnostics;
          use CGI;
          use CGI::Carp qw/fatalsToBrowser/;
          use DBI;
          use Data::Dumper;
          use Registration;

          my $cgi = new CGI;
          Registration::p rint_header($cg i);

          =headprint <<EOS;
          <p>Registrati on for the 2007 SWE Engineering Career Fair is not yet open.To be notified when registration opens, contact the Coordinator,
          EOS

          print email_officer(" Coordinator")," . ";

          =cut
          print <<EOS;
          <p>Registrati on opens Monday, November 26th, 2007.
          EOS
          print <<EOS;
          </p><p>Company registration is \$450, and this includes one table/booth, lunch, and sufficient parking passes. Additional tables can be purchased for \$225 each. Hospitality suites overlooking the football field can also be purchased for \$300. This includes unlimited access to the suite during the career fair, private restroom, storage area, television monitors, and comfortable seating for company representatives or an interview room for students, at your discretion.</p><p>This year, for the first time, the Society of Women Engineers is offering a discount of \$150 to 501(c)(3) non-profit organizations and to government agencies. If this applies to you, please check the appropriate box on the registration page. Please note that this discount only applies to the first table, and that it is subject to verification.</p><p>Registrati on closes Thursday, February 1st, 2007. Late registrations will not be accepted.</p><p>Employer registration is limited to corporations, government agencies, and non-profit employers. We are unable to accept registrations from employment agencies and referral services.</p>
          EOS
          Registration::p rint_footer($cg i);
          [/code]

          I don't know if that is totally correct for formatting, but it is a lot better looking than what you had.

          Regards,

          Jeff

          Comment

          • quagmireman
            New Member
            • Sep 2007
            • 6

            #6
            I used a program called alleycode

            Comment

            • quagmireman
              New Member
              • Sep 2007
              • 6

              #7
              when i opened this file in notepad it was all on one line originally. Is it suppost to stay that way?

              Comment

              • quagmireman
                New Member
                • Sep 2007
                • 6

                #8
                What program should I be using to edit these?

                Comment

                • numberwhun
                  Recognized Expert Moderator Specialist
                  • May 2007
                  • 3467

                  #9
                  Originally posted by quagmireman
                  What program should I be using to edit these?
                  First, do not EVER use notepad. It is one of the worst programs for editing (IMHO). As you found out, there are not carriage returns and when it does wrap, it usually isn't correctly.

                  My suggestion would be to find yourself a good editor that does not strip off or not recognize carriage returns. Some more popular editors are Textpad and Notetab Light.

                  My personal preference when I do anything coding wise is to use my IDE. I lean towards Komodo from Active State, using it for pretty much all of my development.

                  In my opinion, IDE's are personal preference. Find one you like and stick with it.

                  Regards,

                  Jeff

                  Comment

                  • KevinADC
                    Recognized Expert Specialist
                    • Jan 2007
                    • 4092

                    #10
                    Notepad is OK for editing short perl scripts. The problem is that the first editor is using line ending that notepad does not recognize so it lumps all lines together.

                    Google for "perl express" it's a free perl IDE that works very well. Not sure how many operating systems it's ported for though.

                    Keep in mind, you can use any editor for perl files but always save them as text or ascii and not in some other format like rtf or doc.

                    Comment

                    • Kelicula
                      Recognized Expert New Member
                      • Jul 2007
                      • 176

                      #11
                      Originally posted by KevinADC
                      Notepad is OK for editing short perl scripts. The problem is that the first editor is using line ending that notepad does not recognize so it lumps all lines together.

                      Google for "perl express" it's a free perl IDE that works very well. Not sure how many operating systems it's ported for though.

                      Keep in mind, you can use any editor for perl files but always save them as text or ascii and not in some other format like rtf or doc.
                      OMG, I am probably going to turn you into a hot head (with all the smoke I am blowing up your a%%) but Kevin, YOU ROCK!!!

                      I had no idea, or even an inkling to check and see if there was a free perl IDE.

                      Sweet!!!

                      On to my next project ... creating a CMS with perl and mySQL

                      thanks!

                      Comment

                      • numberwhun
                        Recognized Expert Moderator Specialist
                        • May 2007
                        • 3467

                        #12
                        Originally posted by Kelicula
                        OMG, I am probably going to turn you into a hot head (with all the smoke I am blowing up your a%%) but Kevin, YOU ROCK!!!

                        I had no idea, or even an inkling to check and see if there was a free perl IDE.

                        Sweet!!!

                        On to my next project ... creating a CMS with perl and mySQL

                        thanks!
                        Hey Kevin! I have some sandbags lying around that you can borrow if you need them. Wouldn't want you to float away on us. He he he.

                        Comment

                        Working...