Any per/cgi gurus out there?
Hi, I'm new to perl/cgi. I'm trying to learn this for work. I know java pretty well and had program in C++ before.
Here's what I need help with:
I'm suppose to read in a file (data.txt) containing the following:
w277a:29:RABR-A T1 (AT&T DHEC963777):1544
w277a:30:RATL-A T1 (AT&T DHEC659252):1544
The script should represent each line of the file as a hash.
w277a is the router
29 is the interface index
RABR-A T1 (AT&T DHEC963777) is the descrition
1544 is the speed
Here is the instruction I was given:
reads $router, $index, $description, $speed from file line
populates the hash:
$lines{$router}{$index}{name} = $router;
$lines{$router}{$index}{index} = $index;
$lines{$router}{$index}{description} = $description
$lines{$router}{$index}{speed} = $speed
then I need to print out the hash.
I have no idea on how to do that. It seems easy and I'm sure it is for some of you. I just don't have the knowledge of perl to do so. Any help would be appreciated.
Hi, I'm new to perl/cgi. I'm trying to learn this for work. I know java pretty well and had program in C++ before.
Here's what I need help with:
I'm suppose to read in a file (data.txt) containing the following:
w277a:29:RABR-A T1 (AT&T DHEC963777):1544
w277a:30:RATL-A T1 (AT&T DHEC659252):1544
The script should represent each line of the file as a hash.
w277a is the router
29 is the interface index
RABR-A T1 (AT&T DHEC963777) is the descrition
1544 is the speed
Here is the instruction I was given:
reads $router, $index, $description, $speed from file line
populates the hash:
$lines{$router}{$index}{name} = $router;
$lines{$router}{$index}{index} = $index;
$lines{$router}{$index}{description} = $description
$lines{$router}{$index}{speed} = $speed
then I need to print out the hash.
I have no idea on how to do that. It seems easy and I'm sure it is for some of you. I just don't have the knowledge of perl to do so. Any help would be appreciated.