I seem to be having an issue compiling a perl script of mine on an older version of perl that I was hoping someone could help me with. The system that I originally wrote and compiled the perl file on without issue is using perl v5.16.3, the system that I am now currently trying to compile and run it on is using perl v5.8.5 which is where I think the problem lies. I know there was a bunch of changes made in v5.10 as to how ~~ was used. Is v5.10 the first version that actually used the ~~ operator?
The following is the code that I'm getting the syntax error on:
if (/$SEARCH/x ~~ @{$pids{$mPID}{$key}}){
and this is the error I'm getting:
syntax error at /sysadm/shared/ftp_search.pl line 310, near "/$SEARCH/x ~"
syntax error at /sysadm/shared/ftp_search.pl line 310, near "})"
and this is the surrounding code so you have a better idea of what's going on:
foreach my $mPID (keys %pids){
foreach my $key (keys %{$pids{$mPID}}){
if (/$SEARCH/x ~~ @{$pids{$mPID}{$key}}){
} else {
delete $pids{$mPID}{$key};
}
}
}
So basically, I have a hash of hashes and basically if the statement ends up not matching up it will delete it from the hash. I'm working on trying to get the perl on the server upgraded but still trying to get approvals. Am I correct in assuming that this is due to the perl version being used?
Thank you.