nixCraft Linux Forum

nixCraft

Linux / UNIX Tech Support Forum

how to send email on every saturday in perl

This is a discussion on how to send email on every saturday in perl within the Coding in General forums, part of the Development/Scripting category; Hi, how to send email on every saturday in perl using Date::Calc module? Thanks...


Go Back   nixCraft Linux Forum > Development/Scripting > Coding in General

Linux answers from nixCraft.


Coding in General Discussion on PHP/Perl/Python/Ruby/GNU C or C++. MySQL, PgSQL and (X)HTML or any other programming languages you want.

Reply

 

LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 18-08-2008, 05:19 PM
Member
User
 
Join Date: Feb 2008
OS: fedora
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
chandanperl is on a distinguished road
Default how to send email on every saturday in perl

Hi,
how to send email on every saturday in perl using Date::Calc module?

Thanks
Reply With Quote
  #2 (permalink)  
Old 19-08-2008, 11:44 AM
amitabh's Avatar
Contributors
User
 
Join Date: Jul 2008
Location: New Delhi
OS: FreeBSD
Posts: 99
Thanks: 0
Thanked 4 Times in 3 Posts
Rep Power: 4
amitabh has a spectacular aura about amitabh has a spectacular aura about amitabh has a spectacular aura about
Send a message via MSN to amitabh Send a message via Yahoo to amitabh Send a message via Skype™ to amitabh
Default

Is it necessary to use Date:Calc module? You can easliy use cron jobs to schedule it to send every saturday
Reply With Quote
  #3 (permalink)  
Old 20-08-2008, 09:00 AM
Member
User
 
Join Date: Feb 2008
OS: fedora
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
chandanperl is on a distinguished road
Default Date::Calc module

Hello,
Thanks for ur reply.Yes it is necessary to use Date::Calc module.

i want to send alert mail on every satarday of week.
i am giving u one link which will help u.

Date::Calc - Gregorian calendar date calculations - search.cpan.org

Please help me.
Thanks
Reply With Quote
  #4 (permalink)  
Old 21-08-2008, 11:44 AM
monk's Avatar
Senior Member
User
 
Join Date: Jan 2005
Location: Tibet
OS: Debian GNU/Linux
Posts: 506
Thanks: 0
Thanked 8 Times in 6 Posts
Rep Power: 7
monk has a spectacular aura about monk has a spectacular aura about
Default

Here is code, it is simple stuff:
Code:
#!/usr/bin/perl  
use Date::Calc qw( Today Day_of_Week_to_Text Day_of_Week Month_to_Text English_Ordinal );

# get date
($year,$month,$day) = Today();

# get day of the week
$dow = Day_of_Week($year,$month,$day);


# see if it is 6 =  Saturday

if ( $dow == 6 ){
  # write code to send email
}
__________________
May the force with you!

Last edited by nixcraft; 22-08-2008 at 09:55 PM.
Reply With Quote
  #5 (permalink)  
Old 22-08-2008, 06:25 PM
Member
User
 
Join Date: Feb 2008
OS: fedora
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
chandanperl is on a distinguished road
Default reminder mail

many many Thanks MONK
Reply With Quote
Reply

Tags
date::calc , perl , perl data calculation , perl day of week


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
How to forward an email to other account tom Getting started tutorials 4 04-03-2010 10:38 PM
Shell Script To Send Email via SMTP username and password eawedat Shell scripting 4 31-05-2008 08:11 PM
Email Disclaimer mvibin Mail Servers 2 21-05-2008 11:23 AM
Automated email srinivasantarvedi CentOS / RHEL / Fedora 4 14-04-2008 07:26 PM
A script for generating cPanel backup and send as email vivekv Shell scripting 0 20-10-2007 08:28 PM


All times are GMT +5.5. The time now is 05:32 AM.


Powered by vBulletin® Version 3.8.5 - Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.2
©2005-2010 nixCraft. All rights reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38