Revision [3766]
Last edited on 2010-08-01 20:23:50 by KenFongAdditions:
==Using perl to sendmail directly to MX server==
use Net::SMTP;
#Create a new object with 'new'.
$smtp = Net::SMTP->new("smtp.blah.com");
#Send the MAIL command to the server.
$smtp->mail("perlsucks\@blah.com");
#Send the server the 'Mail To' address.
$smtp->to("recipient\@blah.com");
#Start the message.
$smtp->data();
#Send the message.
$smtp->datasend("Subject: hello\n\n");
$smtp->datasend("Test message.\n\n");
#End the message.
$smtp->dataend();
#Close the connection to your server.
$smtp->quit();
use Net::SMTP;
#Create a new object with 'new'.
$smtp = Net::SMTP->new("smtp.blah.com");
#Send the MAIL command to the server.
$smtp->mail("perlsucks\@blah.com");
#Send the server the 'Mail To' address.
$smtp->to("recipient\@blah.com");
#Start the message.
$smtp->data();
#Send the message.
$smtp->datasend("Subject: hello\n\n");
$smtp->datasend("Test message.\n\n");
#End the message.
$smtp->dataend();
#Close the connection to your server.
$smtp->quit();
Revision [3670]
Edited on 2010-03-15 00:45:45 by KenFongAdditions:
==Checking if a specific module is installed==
perl -MModule::Name -e 1
perl -MModule::Name -e 1
Revision [1834]
Edited on 2008-07-22 03:19:44 by WikiAdminAdditions:
==Changing perl lib path==
Example
export PERL5LIB=/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
Example
export PERL5LIB=/usr/lib/perl5/vendor_perl/5.8.0/i386-linux-thread-multi
Revision [1224]
Edited on 2007-12-05 02:40:30 by WikiAdminAdditions:
==reset URL list==
cpan> o conf urllist
urllist
ftp://ftp.kernel.org/pub/CPAN/
Type 'o conf' to view configuration edit options
cpan> o conf urllist shift
cpan> o conf urllist push ftp://ftp-mirror.internap.com/pub/CPAN/
cpan> o conf urllist
cpan> o conf commit
cpan> o conf urllist
urllist
ftp://ftp.kernel.org/pub/CPAN/
Type 'o conf' to view configuration edit options
cpan> o conf urllist shift
cpan> o conf urllist push ftp://ftp-mirror.internap.com/pub/CPAN/
cpan> o conf urllist
cpan> o conf commit
Revision [881]
Edited on 2007-08-13 19:23:27 by WikiAdminAdditions:
==Reinitialize CPAN config==
cpan> o conf init
cpan> o conf init
Revision [351]
Edited on 2007-04-24 08:45:01 by WikiAdminDeletions:
Revision [350]
Edited on 2007-04-24 08:41:17 by WikiAdminAdditions:
Perl is an annoying son of a bitch. I have no idea why this language still exist today... Java is the only language needed on this planet. If you don't know it, learn it. I don't care what you can do with Perl. It's cool, maybe 10 years ago.
Deletions:
Revision [349]
Edited on 2007-04-24 08:38:15 by WikiAdminAdditions:
Perl is an annoying son of a bitch. I have no idea why this language still exist today... Java is the only language needed on this planet. If you don't know it, learn it. Having complains? save it.
Revision [348]
Edited on 2007-04-24 08:33:14 by WikiAdminAdditions:
==Upgrading MCPAN==
The only reason I know is that upgrading MCPAN will remove the annoying message saying the existing one is outdated.
perl -MCPAN -e shell
cpan>install Bundle::CPAN
cpan>reload cpan
The only reason I know is that upgrading MCPAN will remove the annoying message saying the existing one is outdated.
perl -MCPAN -e shell
cpan>install Bundle::CPAN
cpan>reload cpan
Revision [312]
Edited on 2007-04-20 01:10:03 by WikiAdminAdditions:
==Listing installed modules==
%%(perl)
#!/usr/bin/perl
# list installed modules
use ExtUtils::Installed;
my $instmod = ExtUtils::Installed->new();
foreach my $module ($instmod->modules()) {
my $version = $instmod->version($module) || "???";
print "$module -- $version\n";
}
%%(perl)
#!/usr/bin/perl
# list installed modules
use ExtUtils::Installed;
my $instmod = ExtUtils::Installed->new();
foreach my $module ($instmod->modules()) {
my $version = $instmod->version($module) || "???";
print "$module -- $version\n";
}
Revision [211]
Edited on 2007-04-16 08:08:15 by WikiAdminAdditions:
{{parent page="HomePage"}}