|
|
| Perl Monk, Perl Meditation | |
| PerlMonks |
Including Modules with a scriptby Mandor (Pilgrim) |
| on Jul 11, 2001 at 12:07 UTC ( [id://95646]=perlquestion: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.Mandor has asked for the wisdom of the Perl Monks concerning the following question:
I want to include some modules with a small script which I've done. It reads a certain XML file on the net which contains server status reports and prints out niceley formatted HTML. I've decided that I am going release it to the public if the script comes out nice. Now two questions arrise since I want to include not-so-common Modules with the script (UBB has MIME:Lite included for example) in case the webmaster can't install Modules himself. 1) Is it perfectly legal to include these Modules with the script (since they can be found on CPAN)? 2) I thought of including a Modules subdirectory (with furher subdirectories) with the script. As you can see in my code example I use FindBin to get the path of the script and then load the Modules from the subdirectory. While this works fine I get an "Undefined subroutine &main::get called at script.pl" error. When I replace the my $tree = get ($xml_path);with my $tree = LWP::Simple -> get ($xml_path); that works but replacing it like this doesn't work for the XML::Simple modules because I get a "Can't use string ("XML::Simple") as a HASH ref while "strict refs" in use at Modules/XML/Simple.pm 494" error". What can be done to overcome this problem? Or do I have to use a different XML parser?
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||||