Loading ...
Sorry, an error occurred while loading the content.

what's the module that dumps all the code in a script?

Expand Messages
  • Paul Archer
    I really hate this, but I ve got a complete block on the name of the module, that when invoked, takes all the bytecode from a script and recreates the script.
    Message 1 of 2 , Mar 4, 2004
    • 0 Attachment
      I really hate this, but I've got a complete block on the name of the module,
      that when invoked, takes all the bytecode from a script and recreates the
      script. I know I've seen an example where a 'for' loop is invoked with
      'foreach' and vice versa, and it shows that Perl does the right thing(TM)...

      TIA,

      Paul

      --------------------------------------------------
      I got an announcement recently for a conference on
      massively parallel computing systems.

      They sent me 600 copies.
      --------------------------------------------------
    • Paul Archer
      I hate answering my own post, but since I finally found the answer, I thought I d save someone else from having to deal with my addled brain. The answer
      Message 2 of 2 , Mar 4, 2004
      • 0 Attachment
        I hate answering my own post, but since I finally found the answer, I
        thought I'd save someone else from having to deal with my addled brain.
        The answer (drumroll please) is B::Deparse.
        For example:

        [run this]
        perl -MO=Deparse,-p -e 'foreach (qw/a b c d e/){ print "$_\n"}'

        [and get this output]
        foreach $_ (('a', 'b', 'c', 'd', 'e')) {
        print("$_\n");
        }
        -e syntax OK

        Bartles "Thank you for your support" N. James


        2:13pm, Paul Archer wrote:

        > I really hate this, but I've got a complete block on the name of the module,
        > that when invoked, takes all the bytecode from a script and recreates the
        > script. I know I've seen an example where a 'for' loop is invoked with
        > 'foreach' and vice versa, and it shows that Perl does the right thing(TM)...
        >
        > TIA,
        >
        > Paul
        >
        > --------------------------------------------------
        > I got an announcement recently for a conference on
        > massively parallel computing systems.
        >
        > They sent me 600 copies.
        > --------------------------------------------------
        >

        ----------------------------------------------
        "We Americans, we're a simple people...
        but piss us off, and we'll bomb your cities."
        --------------Robin Williams------------------
      Your message has been successfully submitted and would be delivered to recipients shortly.