Augusto Flavio wrote:

Good morning,



Are you saying to me that i can't compile a module
(extension .pm)? I'm look a method to compile my
module(.pm). Can i do this with the pp?


Have some way to obfuscate the code of a module?


Thanks for all



Augusto Flavio





_______________________________________________________ Yahoo! Acesso Grátis - Instale o discador do Yahoo! agora. http://br.acesso.yahoo.com/ - Internet rápida e grátis




I am not saying you cannot compile a module. I suppose you can compile anything you want. However, a perl module by itself presumably has no entry points, except as defined with Exporter (ie the subroutine entry points), as given to the invoking main perl file when it uses the "use module_name;" directive presumably near the top of the file.

If you wrote the module correctly, invoking the module from the command line should give you ... nothing. Well, almost nothing. All such Perl modules must return a '1' value at the end or the syntax checker would complain. Hence executing a compiled .pm file would simply return a '1'.

I have a feeling there is some miscommunication going on here. To clarify things, here is a paste of the file my_module.pm and my_main.pl, and "pp -o aa.exe my_module.pm" which is a rather useless endeavor.
--------------------------paste of my_module.pm
package my_module;


use Exporter;
@ISA = qw(Exporter);
@EXPORT = ( "my_print" );

sub my_print {
 my ($message) = @_;
 print $message;
}
1;
------------------------end paste

------------------------paste of my_main.pl
use my_module;
my_print("Hello\n");
-----------------------end paste

>pp -o aa.exe my_module.pm
>aa.exe

>
(Notice above that nothing happens when aa.exe is executed)
Now let me compile my_main.pl
>pp -o aa.exe my_main.pl
>aa.exe
Hello
>
(Notice that "Hello" was printed out)

I hope this helps.










Reply via email to