Hi, I've the following snippet of code;
foreach my $match (@matchlist) {
if ($hndlread =~ /$match/) {
$match =~ s/ORA/Oracle based error, see log file for details/;
push (@temp, "$space$cause$match");
}
}
My understanding is that the above says, if $match contains ORA then replace with "Oracle base....." etc. This then gets pushed to @temp instead of "ORA".
However what I'm seeing is that on the first ORA detection in the @matchlist array it works fine. However this little loop runs in a bigger foreach loop, and on subsequent loops through this one the substitution does not find the ORA match and prints out nothing.
My guess is that $match is permanently replaced but I don't understand why
cheers
simmo
foreach my $match (@matchlist) {
if ($hndlread =~ /$match/) {
$match =~ s/ORA/Oracle based error, see log file for details/;
push (@temp, "$space$cause$match");
}
}
My understanding is that the above says, if $match contains ORA then replace with "Oracle base....." etc. This then gets pushed to @temp instead of "ORA".
However what I'm seeing is that on the first ORA detection in the @matchlist array it works fine. However this little loop runs in a bigger foreach loop, and on subsequent loops through this one the substitution does not find the ORA match and prints out nothing.
My guess is that $match is permanently replaced but I don't understand why
cheers
simmo