I have split a string successfully into two variables. No big feat.
The problem I am having is that the string I have set the script to look for
occurs twice.
So I encounter the string. split is as necessary, and assign the variables.
It then encounters the string and does the above again.
What I would like to do is separate the values into "dynamic" variables of a
sort.
while (defined ($line = <$remote>)) {
$line = substr("$line",1);
if ($line =~ /^ inet/){ # if line begins with space and inet, grab and
$line =~ s/^\s+//; # and remove the blank space preceding the line.
($interface, $ipaddress) = split(/\s+/, $line); # split the line into two
variables.
}
This happens twice, as the output lists both interfaces.
I would like to assign a different variable each time it encounters the
string. e.g. $ipaddress1 , $ipaddress2, etc...
I looked at for loops, but could not figure it out...
Thanks for any help...
Craig
[EMAIL PROTECTED]
Pager
Numeric: 1-877-895-3558
Email pager: [EMAIL PROTECTED]
--------------------------------------------------------------
You will never find time for anything.
If you want time, you must make it.
Charles Buxton