Wednesday, March 29, 2006

Code for lower case to upper case

Perl Funda’s

Code for lower case to upper case: $line =~ tr/a-z/A-Z/;

SQL friendly –> $Mail_Message=~ s/['"]/`/g;

use Date::Calc qw(Delta_Days);
$days = Delta_Days($year1, $month1, $day1, $year2, $month2, $day2);

mail code

$to_id=”dileepreddy@ti.com”;
my $from_id =’pushreport@india.ti.com’;
my $cc=”";
my $bcc=”";
$mailSub=”Push Report : Data Upload Complete”;
$mailContent=”Reddy,
Push Report: Data Upload from file to table $tablename is completed.
— Push Report generator.”;
open(SENDMAIL,”|/usr/lib/sendmail -t”);
print SENDMAIL <<”EOF_MAIL”;
From: $from_id
To: $to_id
Cc: $cc
Bcc: $bcc
Subject: $mailSub
Content-Type: text/html;
$mailContent
EOF_MAIL
close(SENDMAIL);

commify_series

sub commify_series {
(@_ == 0) ? ” :
(@_ == 1) ? $_[0] :
(@_ == 2) ? join(” and “, @_) :
join(“, “, @_[0 .. ($#_-1)], “and $_[-1]“);
}

Posted by Babai in 08:31:38
Comments

Leave a Reply