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(/\|/,
$router_tables{i});
if ($router_table{i} ne "") {
print SH "\"$router_table{i}\" ";
}
else {
print SH "\"$router_tables{$i}\" ";
}
}
I want the split to give $router_table = 1.1.1.1 $router_type = cisco
for instance, but instead, the split just gives a blank and the script
prints out $router_tables{i} (1.1.1.1|cisco)
I'm figuring it's the {i} causing the problem, but can anyone help me
out...
Thanks
Andy