Cookies management with perl, Programming Languages

One of the main strengths of the Perl programming language are its powerful text manipulation features. In this assignment, you will put them to  use for writing a Perl program that can manage a simplified version of the so-called "browser cookies".

These are the specifications for your Perl program:

1.  The file with your program must be named cookiemgr.pl

2.  The program must be invoked as:

cookiemgr.pl cookies_file [options]

The program must check that its first argument exists, is a file and is readable. If not, it must print string:

Error: a valid file must be passed as first argument to the standard output, and exit. The first argument is compulsory while the following arguments are optional. The arguments are described in the following.

3.  File  cookies_file can have any arbitrary name. It must be a file of  text with the following format:

a.  The file consists of an arbitrary number of lines (including, possibly, zero lines).

b.  Each line must contain four fields separated by commas.

c.  The four fields are: cookie name, cookie value, hostname and expiry date.

d.  The first three fields are strings of arbitrary (yet reasonably limited) length; the characters in these strings can be any of: uppercase letters, lowercase letters, decimal digits, the underscore and the dot.

e.  The expiry date field is a string of decimal digits in the so-called  Unix epoch format.

The following example is the ultimate specification for the format of file cookies_file:

SessionID,029380,xyz.org.au,1385874000

ASPX_ANONYMOUS,CjnjrB,xyz.org.au,1356912000

SESSION_COLOUR,red,nosite.com.au,1341014400

SESSION_ACTIVE,FALSE,nosite.com.au,1341014400

username001,massimo.piccardi,hello.uts.edu.au,2145830400

username012,john.smith,hello.uts.edu.au,2145830400

username013,michael.zhang,hello.uts.edu.au,2145830400

Posted Date: 3/30/2013 1:18:38 AM | Location : United States







Related Discussions:- Cookies management with perl, Assignment Help, Ask Question on Cookies management with perl, Get Answer, Expert's Help, Cookies management with perl Discussions

Write discussion on Cookies management with perl
Your posts are moderated
Related Questions
As an XML expert you are required to model a system for an online bookshop. After an interview with the shop manager you have the following information: The detail of th

1.) Write a flowchart and program to do the following: A pressure sensor in a cooling system measures the pressure of the refrigerant and is connected to Port -1 of the 8051. If th

Windows Card Space Windows Card Space (codenamed Info Card), is Windows now-canceled customer application for the Identification Met system. Card Place is an instance of a class of

Part 1 Given the following Regular Expressions, explain in detail the pattern accepted by each. Pay attention to all the characters being used. Your answers need not appear with

Villa La Fourche Ltd is a small family business situated in the East Coast of Mauritius, more precisely Trou d'eau Douce.   The compound comprises of 6 independent villas, each of

Please explain about sub programming.

You should use the BToolkit to produce the answers to the questions below. Where applicable, please use the machine names and identifier names suggested in the question to help me

Write a shell script  (W.A.S.S) to calculate gross salary. Program # Write a shell script  (W.A.S.S) to calculate gross salary. echo "Enter any Basic Salary"     #echo is

Develop a socket program in UNIX/Linux that uses (i) TCP as the transport protocol and  (ii) UDP as the transport protocol for transferring  a short message between a client and  s

Question: (i) All Security authentication mechanism that run on the TRU64 Unix Operating system run under the Security Integration Architecture (SIA ) layer. Explain with di