Find the cookies expiring, Programming Languages

Your program can be invoked with option: -d date, where date is entered in dd/mm/yyyy format. In this case, it must only print the following string:

Found cookies expiring before or on

To find the cookies expiring before, or on, the date given in the option, your program must convert this date to the Unix epoch format and compare it with the dates stored in cookies_file. The time of the date is always assumed to be 0 hours, 0 minutes, 0 seconds and the time used is the Coordinated Universal Time (UTC), also often referred to as Greenwich Mean Time (GMT). Perl has a function for converting a GMT time to the Unix epoch time.

Example with the example cookies_file given above:

Command line:

cookiemgr.pl cookies_file -d 31/12/2012

The Unix epoch format for 31/12/2012, midnight, is 1356912000. In file cookies_file there are three dates which are smaller or equal than 1356912000. Therefore, the output must be:

Found 3 cookies expiring before or on 31/12/2012 Option -d date can only be used once per command line (you can only ask for the cookies for a given date at a time).

In the case in which file  cookies_file contains no cookies expiring before or on the given date, your program must instead only print:

No cookies found expiring before or on

Example with the example cookies_file given above:

Command line:

cookiemgr.pl cookies_file -d 31/05/2010

The Unix epoch format for 31/05/2010, midnight, is 1275264000. In file cookies_file there are no dates which are smaller or equal than 1275264000. Therefore, the output must be: No cookies found expiring before or on 31/05/2010

Posted Date: 3/30/2013 1:20:26 AM | Location : United States







Related Discussions:- Find the cookies expiring, Assignment Help, Ask Question on Find the cookies expiring, Get Answer, Expert's Help, Find the cookies expiring Discussions

Write discussion on Find the cookies expiring
Your posts are moderated
Related Questions
All programs have to be done in console application. Program 1, 2 and 3 are due on 2/11/12 Program 4, 5, and 6 are due on 2/18/12 Program 7, 8, and 9 are due on 2/25/12 Program 10

Selfcare Project:   Technology Used Strut Frame work, WAS 5.1, WPS 6.0, DB2, AJAX, Eclipse, Rational Application Developer 6 and  DB2 Selfcare is a big umbrella under whic

UNIX Operating System 1. Explain all the layers present in a UNIX Architecture? List and explain each of them. 2. Describe the term Inter-Process Communication. What are var

how to save bulk entries at a time using collections?

Detailed Description: • The program will take temperature readings as input from user for specified number of consecutive days. • Program will store these temperature values into

Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4

Prepare an XML document that contains calendar information such as the following text describes: The calendar is owned by a person (e.g. John Smith) and has a few paragraphs tha

Problem: (i) Define Remote Procedure Call (RPC). (ii) Explain with diagram how RPC works? (iii) A remote procedure is uniquely defined by (a) Program number. (b)

What are the Functions in Computer Programming? A program is completed up of one or more functions, with one of these being main(). Function is a self-contained block of progra

ASP.NET Support for AJAX and JavaScript IntelliSense IntelliSense for Enthusiasm JScript makes it accessible client-script selection components in the value manager in Vision Facil