Saving a compiled source file with the "require"d files

Discussion in 'Perl Misc' started by Ray Muforosky, Apr 21, 2005.

  1. Help.


    If I have file1 that loads (require file2 and files), is it possible
    save the content of file file after the load.


    example:
    file1
    #!perl
    $a =12;
    require file2;
    $b = $z;
    require file3;
    $c = $y;
    print $a;


    file2
    $z = 200;
    1;


    file3
    $y = "foo";
    1;


    So, is it possible to save file1 after loading file2 and file3
    file1 becomes:
    #!perl
    $a =12;
    $z = 200;
    $b = $z;
    $y = "foo";
    $c = $y;
    print $a;


    Thanks
    Ray
     
    Ray Muforosky, Apr 21, 2005
    #1
    1. Advertisements

  2. Ray Muforosky

    xhoster Guest

    Please pick one appropriate subject line, and then stick with it.

    Xho
     
    xhoster, Apr 21, 2005
    #2
    1. Advertisements

  3. My apologies, I thought the first subject was not proper.
     
    Ray Muforosky, Apr 21, 2005
    #3
  4. Ray Muforosky

    Anno Siegel Guest

    You can use Perl to print the text above, and you can overwrite
    file1 with it, but you'll have to write the code yourself. I would
    not call that "saving file1 after loading", it's a completely
    different file.

    Anno
     
    Anno Siegel, Apr 22, 2005
    #4
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.