}
sub clean_my_title {
my $old_title = shift;
$old_title =~ s/\(¦\/¦\\¦%¦,¦\@¦\[¦\]¦>¦<¦"¦\+¦\*¦\?¦$¦=¦:¦\)¦\&¦\$¦'¦,¦\#¦\!//g;
$old_title =~ s/ ¦__¦___/_/g;
$old_title =~ s/_-_/-/g;
$old_title =~ s/-_/-/g;
return $old_title;
}
1;
Would one of those marks need a \ before it?
With the older version that code is replaced with....
}
1;
}
\_
and look up the documentation on using underscores in variable names, particularly beginning characters. I say to look it up because I forget what it said, only that using underscores can cause some odd results. Just remember what
@_
and
$_ do and you'll see why. :-)
I hope that helps.
EDIT: on second look, think about what
[a-z][0-9]
does and you may want to backslash your hyphens too.
I wouldn't expect that to produce an ISE, but I suppose it's possible. Otherwise the code should run on any release of Perl 5. There might be something else going on, maybe line ending problems for the latest version of the file, caused by transfer from Unix to Windows or vice versa.
You could simplify the first regex by reversing it:
$old_title =~ s/&//g;
$old_title =~ s/[^\w\d\-_. ]//g;
The last will drop anything but a "word character" (a-z and their accented versions depending on your locale settings), digits and anything extra you'd like to let through.