When I run this in upload.cgi, it comes up as:print STDERR "Filename 1: $filename \n"; my $test = $filename =~ tr{&[]ÀÂÄàâäÇçÉÊÈËéêèëÏÌÎïìîÖÔÒöôòÜÛÙüûù?! +;«»()" íóñÑáéóúÁÉÍÓÚ}{___aaaaaacceeeeeeeeiiiiiioooooouuuuuu_________i +onnaeouaeiou}; print STDERR "FOO REPLACE: $test \n"; print STDERR "Filename 2: $filename \n";
Notice the space got replaced with _... but thats it. Yet in my test script on my Strawberry Perl on my PC, I get:Filename 1: regular-expressions-cheat-sheet áíé-v2.pdf FOO REPLACE: 1 Filename 2: regular-expressions-cheat-sheet_áíé-v2.pdf
..give me (as I would expect);my $test = "tegular-expressions-cheat-sheet_áíé-v2.pdf"; $test =~ tr{&[]ÀÂÄàâäÇçÉÊÈËéêèëÏÌÎïìîÖÔÒöôòÜÛÙüûù?!;«»()" íóñÑáéóúÁÉÍÓ +Ú}{___aaaaaacceeeeeeeeiiiiiioooooouuuuuu_________ionnaeouaeiou}; print "now: $test \n";
can anyone suggest what I may be doing wrong? Its driving me up the wall!C:\Users\Andy>perl test2.pl now: tegular-expressions-cheat-sheet_aie-v2.pdf
In reply to tr{}{} doesn't wanna work.. what am I doing wrong? by ultranerds
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |