CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner: Re: [Kenosis] if then else with Date help needed: Edit Log



dprogrammer
New User

Mar 24, 2013, 10:22 PM


Views: 525
Re: [Kenosis] if then else with Date help needed

Ok, now I've slight change in the original code. I need to now check for date and time as well. Like the condition should check first day of the month and time of 07:30AM.
E.g:
localtime(time)==1 07:30AM ? 'D:\\MyFiles\con_1.conf' : 'D:\\MyFiles\con_2.conf';


I am thinking about this but not sure if that's the best approach:

my $con = ( ( localtime(time) ) [1] == 30 && (localtime(time) ) [2] == 7 && (localtime(time) ) [3] == 1 ) ?
'D:\\MyFiles\con_1.conf' : 'D:\\MyFiles\con_2.conf';
print $con;

Any ideas?


(This post was edited by dprogrammer on Mar 25, 2013, 9:45 AM)


Edit Log:
Post edited by dprogrammer (New User) on Mar 25, 2013, 9:41 AM
Post edited by dprogrammer (New User) on Mar 25, 2013, 9:45 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives