I just started learning Perl.  I need help in writing a solution for the 
following:

# Write data validation routines to -
#       Ignore blank lines...
#       Ignore comments...
#       Ignore complete pod sections
#       Process the following data, as described:

792910171010163200|http://web.fccj.org/~wcjones/|WCJones Home Page
552910171010163200|http://www.fccj.org/~wcjones/|Bill's Home Page
552910171010163200|http://www.jacksonville.net/sneex/|My Home Page
552913171010163200|http://jacksonville.pm.org/|Jax.PM Home Page
552909171010163200|http://web.fccj.org/~wcjones/|WCJones Home Page
552909171010163200|http://web.fccj.org/~wcjones/|WCJones Home Page
552910171010163200|http://web.fccj.org/~wcjones/|WCJones Home Page
552910171010163200|http://web.fccj.org/~bill/|WCJones Home Page
552910171010163200|http://web.fccj.org/~wcjones/|WCJones Home Page
552910171010163200|http://web.fccj.org/~wcjones/|WCJones Home Page
552910171011163200|http://sneex.fccj.org/|WCJones Home Page
552910171011163200|http://web.fccj.org/~wcjones/|WCJones Home Page
552910171012163200|http://www.fccj.org/|FCCJ Home Page

Here is the data validation description to my previous email:

=head1 TEMP     # To ignore pod...cut statements....this does not work though
Format of the above:

The | (pipe) is a data field (HINT: split) separator;

The 552910171010163200 which is Sat Nov 17 10:29:55 2001,
(HINT: localtime) should be parsed into HH:MM:SS (Zero padded) and
WDay MMM DD, YYYY - which should look like Sat Nov 17, 2001
55: 29:  10: 17:10:  101:                                     6:      320:0
HH:MM:SS:17:Nov: year (1900 +101= 2001):Sat:  320thday of the year
The rest of the line is a URL and URL Comment

This data should be validated for -

Correctness of time, of date, and check to see if the URL
is reachable.


#End of Assignment...



Here is what I have done so far:

#!C:/Perl/bin/Perl.exe -w

use strict;
use diagnostics;

my ($line, $time, $url, $title);
my @list;

    while (<DATA>) {
        chomp;          # To remove newlines
                        # To delete blank lines  I have to write this

        s/#.*//;                # To remove comments

        my @list = "$_";

        foreach $line (@list) {
        ($time, $url, $title)=split(/|/, $line);     # this does not seem to work
        print "$line\n";
        }

}

sleep  5;

__END__

Thank you so much for your help.

Sandeep
[EMAIL PROTECTED]

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to