Hi,
I am new to programming and new to Perl and I could definitely use some help. I have a .csv file from which I am reading lines, I used the following code:
foreach my $cell (@cells_array) {
$attr1_value = shift(@attr1s);
while ($attr1_value ne "") {
$_ = $attr1_value;
/inet filter\s+/;
@after=split(/\s+/,$');
/term\s+/;
@after2=split(/\s+/,$');
print "ACL Name is ";
print $after[0],"\n";
print "term is ";
print $after2[0],"\n";
$attr1_value = shift(@attr1s);
}
}
The problem I have is that if there is no match in @after2, then it will print the value from after. i tried changing the name of the $_ variable but when I do so I get an error complaining about the ' after the $ in line @after=split(/\s+/,$');
Any help is greatly appreciated.
trhead I sued for reference:
thread219-444636
I am new to programming and new to Perl and I could definitely use some help. I have a .csv file from which I am reading lines, I used the following code:
foreach my $cell (@cells_array) {
$attr1_value = shift(@attr1s);
while ($attr1_value ne "") {
$_ = $attr1_value;
/inet filter\s+/;
@after=split(/\s+/,$');
/term\s+/;
@after2=split(/\s+/,$');
print "ACL Name is ";
print $after[0],"\n";
print "term is ";
print $after2[0],"\n";
$attr1_value = shift(@attr1s);
}
}
The problem I have is that if there is no match in @after2, then it will print the value from after. i tried changing the name of the $_ variable but when I do so I get an error complaining about the ' after the $ in line @after=split(/\s+/,$');
Any help is greatly appreciated.
trhead I sued for reference:
thread219-444636