#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2009
    Posts
    204
    Rep Power
    6

    Write perl code into a .pl file from a form


    Hello. While I have experience with Java and PHP I have not worked with Perl before so I may be way off my rocker with this problem but here goes.
    I have a stand alone Notebook program that is written in Perl. It outputs HTML pages with a text editor and links. The text editor saves the input to a file which is then read from a browser.
    It works well but there is no create new notebook option. To create a new notebook I have to go into the enote.pl file and add lines of code manually with the new notebook name and then go and create a new directory.

    I would like to have a button that let's me append the lines of pearl code to the enote.pl file.

    Here are the lines of code that have to be added manually every time I need a new notebook.

    Code:
    $main::notebook{'architecture'} = {(
      'dir'   => 'f:/wamp/www/enote1.12/html/architecture/',
      'title' => ""
      )};

    Code:
    $main::nb = 'architecture';
    Can writing those four lines of code be accomplished from a button or form?

    Any help would be appreciated.
    From the Movie Phenomenon

    George Malley: Specifics, Bob
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Apr 2009
    Posts
    1,940
    Rep Power
    1225
    Yes, you could have your form processing script append new code to the enote.pl script, BUT that would be a REALLY BAD approach in any language.

    Instead, you should extend the script to accommodate the addition of creating new notebooks without having to add that block of code each time you need a new notebook.

    I don't know anything about your "Notebook program" so I can't give any specific recommendations on how to extend its features.

    Comments on this post

    • Laurent_R agrees
  4. #3
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2009
    Posts
    204
    Rep Power
    6
    Thanks for your suggestion. I'll have another go at the problem with your post in mind.
    From the Movie Phenomenon

    George Malley: Specifics, Bob

IMN logo majestic logo threadwatch logo seochat tools logo