I have a generic PERL script that contains basic sub routines. Everything has been working for over five years until the upgrade to Perl 5.10. It seems that the pattern matching $* is not supported in this newer version. I understand that there are two functions (/s and /m) which would be used instead. I do not know the correct syntax to replace the code in my script. Please, is there anyone out there who can fix this problem with my code. I use this script on over 50 web sites.
There are only two simple routines. the code is shown below:
sub PrintVariables {
local (%in) = @;
local ($old, $out, $output);
$old = $; $ =1;
$output .= “”;
) =~ s/\n/
foreach $key (sort keys(%in)) {
foreach (split("\0", $in{$key})) {
($out = $
/g;
$output .= “
”;
}
}
$output .= “”;
$* = $old;
return $output;
}
PrintVariablesShort
Nicely formats variables in an associative array passed as a parameter
Using one line per pair (unless value is multiline)
And returns the HTML string.
sub PrintVariablesShort {
local (%in) = @;
local ($old, $out, $output);
$old = $; $ =1;
foreach $key (sort keys(%in)) {
foreach (split("\0", $in{$key})) {
($out = $) =~ s/\n/
/g;
$output .= “$key is $out
”;
}
}
$* = $old;
return $output;
}