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. Advertising

  2. Ray Muforosky

    Guest

    "Ray Muforosky" <> wrote:
    > Help.


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

    Xho

    --
    -------------------- http://NewsReader.Com/ --------------------
    Usenet Newsgroup Service $9.95/Month 30GB
     
    , Apr 21, 2005
    #2
    1. Advertising

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

    Anno Siegel Guest

    Ray Muforosky <> wrote in comp.lang.perl.misc:
    > 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;


    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. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Luis Esteban Valencia
    Replies:
    0
    Views:
    2,520
    Luis Esteban Valencia
    Jan 6, 2005
  2. jd
    Replies:
    0
    Views:
    430
  3. Klaus Schneider
    Replies:
    1
    Views:
    553
    Rolf Magnus
    Dec 2, 2004
  4. Replies:
    5
    Views:
    392
    Peter Julian
    Jun 1, 2005
  5. lander
    Replies:
    5
    Views:
    599
    bruce barker
    Mar 5, 2008
Loading...

Share This Page