Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today

Thread Tools Search this Thread Display Modes
Old 02-16-2005, 01:44 PM   #1
Baseband Member
Join Date: Feb 2005
Posts: 68
Default Perl/cgi Help!

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.
REGNARTS_ is offline   Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

All times are GMT -5. The time now is 07:20 AM.

Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0