On Wed, 23 May 2001, Me wrote:
> > ($router_table{i},$router_type{i}) = split(/\|/,
> > $router_tables{i});
>
> All those indices should be {$i} rather than {i}.
They are actually $i in the script, just typos in the mail...
appologies...
> > I'm figuring it's the {i} causing the prob
> ($router_table{i},$router_type{i}) = split(/\|/,
> $router_tables{i});
All those indices should be {$i} rather than {i}.
> I'm figuring it's the {i} causing the problem
You had it figured...
On May 23, Andy Roden said:
>($router_table{i},$router_type{i}) = split(/\|/,
>$router_tables{i});
You probably want that to be $i, not i.
>if ($router_table{i} ne "") {
>print SH "\"$router_table{i}\" ";
>}
There too.
>else {
>print SH "\"$rout
ANyone help me out with a problem I'm having splitting some | separated
variables...
%router_tables contains entries like 0.0.0.0|unknown 1.1.1.1|cisco
2.2.2.2|juniper
foreach $i (sort keys %router_tables)
{
next if ($i =~ "unknown");
($router_table{i},$router_type{i}) = split