Hi,
I just used RPMforge package perl-Mail-Sender, and am looking at the perl cpan site for info, anyone got a simple way to determine if the module is working properly?
I am trying to use the cpan info, but it's a bit cryptic (as perl is wont to be).
-it says to use this:
#!/usr/local/bin/perl
use ExtUtils::Installed; my $instmod = ExtUtils::Installed->new(); foreach my $module ($instmod->modules()) { my $version = $instmod->version($module) || "???"; print "$module -- $version\n"; }
but all I get is:
Perl -- 5.8.5
which seems to indicate doing a
wget http://dag.wieers.com/rpm/packages/perl-Mail-Sender/perl-Mail-Sender-0.8.13-... rpm -ivh perl-Mail-Sender-0.8.13-1.el4.rf.noarch.rpm
is either working and thie script above just cant see it, or the module is installed and requires some follow up. Both of these are just theoretical.
Any input from the wise listers other than "read all of cpan since you have a million hours free time".
perl -MCPAN -e 'install Mail::Sender' simply hangs on the FTP transaction, thus the reason I did this from RPMforge instead.
-krb
Karl R. Balsmeier wrote:
Hi,
I just used RPMforge package perl-Mail-Sender, and am looking at the perl cpan site for info, anyone got a simple way to determine if the module is working properly?
A very superficial test. If it fails, then the module is definitely not working. In my case, it's not even installed:
########################################################### $ cat perl-test #!/usr/bin/perl -w use Mail::Sender;
$ ./perl-test Can't locate Mail/Sender.pm in @INC (@INC contains: /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.7/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.6/x86_64-linux-thread-multi /usr/lib64/perl5/site_perl/5.8.5/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.7/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.6/x86_64-linux-thread-multi /usr/lib64/perl5/vendor_perl/5.8.5/x86_64-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at ./perl-test line 3. BEGIN failed--compilation aborted at ./perl-test line 3. ############################################################
For more thorough tests, I guess you could write a simple Perl script and actually test the module's functionality. Can't really beat that for accuracy in testing.
Florin Andrei wrote:
For more thorough tests, I guess you could write a simple Perl script and actually test the module's functionality. Can't really beat that for accuracy in testing.
Do an "rpm -ql" on your package and see if there's a test.pl file in it.
If there is one, do a "perl /....path..../test.pl" and see what happens. It's pretty basic, but better than my test.
yeah, that rpm -qa showed it, and the test I did like this and it worked great:
#!/usr/bin/perl -w use Mail::Sender; $sender = new Mail::Sender {smtp => 'my.mail.server', from => 'me@my.domain'}; $sender->MailFile({to => 'me@my.domain', subject => 'Here is the file', msg => "I'm sending you the list you wanted.", file => 'filename.txt'});
Thanks alot, I did this for my supervisor and just wanted to verify it before he used it...
-karl
Florin Andrei wrote:
Florin Andrei wrote:
For more thorough tests, I guess you could write a simple Perl script and actually test the module's functionality. Can't really beat that for accuracy in testing.
Do an "rpm -ql" on your package and see if there's a test.pl file in it.
If there is one, do a "perl /....path..../test.pl" and see what happens. It's pretty basic, but better than my test.