Link to home
Start Free TrialLog in
Avatar of santoshmotwani
santoshmotwaniFlag for Australia

asked on

Perl Script question

Hi Experts,

I have this perl script its runs fine. My query is how do email this output. I am not good with using arrays.

Here is my code.


All i want is to send output which i am getting via array in email.


$query1 = $db4->prepare("SELECT COUNT (*), (
CASE WHEN PICSTATUS = '11' then 'Transfer Rejected'
when picstatus = '12' then 'Transfer Cancelled'
when picstatus = '20' then 'New Sale'
when picstatus = '70' then 'Pricing Accepted'
when picstatus = '72' then 'Sale Confirmed'
when picstatus = '80' then 'Ready for Transfer'
when picstatus = '90' then 'Transfer in progress'
end
) as STATUS FROM PROCONSUMER WHERE PICSTATUS NOT IN (100,10) GROUP BY PICSTATUS " );

$query1->execute;


while (@array = $query1->fetchrow_array)
{
 print "$array[1] = $array[0]\n";
#($ca) = $array[2];
}

# email

my $subject = " Daily stats";

my $message = " Customer Statistics \n =======================================================================
 ";


`/usr/bin/sendEmail -f stats\@abc.com.au -t abc\@abc.com.au -u $subject -s localhost -m " $message \n " `;

print "email sent";

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of wilcoxon
wilcoxon
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of santoshmotwani

ASKER

That worked awesome , this is what i got !!!
 53      Transfer Rejected


How do i get transfer rejected first and then count?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thnx Mate !!!!!!!