G'day Mike,
Welcome to the monastery.
In what way does '-f' "not work any more"?
Please provide more information on "I cannot copy or move $scandir."/".$files[0]". How are attempting to copy and move? What's happening? What errors, warnings or other feedback are you getting?
Are you asking Perl to point out problems to you (e.g. strict, warnings, autodie, etc.)? The documentation shows opendir reporting problems in "$!": you're using "$@".
You're using package global variables exclusively (in the code you've shown): this could be causing any number of problems. Without seeing all of your code, it's impossible to tell. Use lexical variables and avoid the issue altogether.
I created this directory (some characters may not render in your browser but the filenames indicate the code points):
$ ls -al pm_1080490_utf8_readdir total 0 drwxr-xr-x 5 ken staff 170 1 Apr 21:01 . drwxr-xr-x 599 ken staff 20366 1 Apr 21:02 .. -rw-r--r-- 1 ken staff 0 1 Apr 20:47 Fehler für Projekt x.txt -rw-r--r-- 1 ken staff 0 1 Apr 20:58 ᚠᚡᚢᚣᚤᚥᚦ (U+16a0 to U+16a6) -rw-r--r-- 1 ken staff 0 1 Apr 21:01 🜁 🜂 🜃 🜄 (U+01f701 to U+01f704)
I ran this script:
#!/usr/bin/env perl -l use strict; use warnings; use autodie; my $scandir = './pm_1080490_utf8_readdir'; opendir(my $dh, $scandir); my @files = grep { -f "$scandir/$_" } readdir $dh; print for @files;
And got this output:
Fehler für Projekt x.txt ᚠᚡᚢᚣᚤᚥᚦ (U+16a0 to U+16a6) 🜁 🜂 🜃 🜄 (U+01f701 to U+01f704)
So, I'm unable to reproduce your problem.
Try running exactly the same code as I did (except with a different value for $scandir) and report the result. Show the full output of any errors, warnings, or other messages: vague references to "does not work" and the like are of no use at all. The guidelines in "How do I post a question effectively?" explain what information is useful and how to present it.
-- Ken
In reply to Re: treat files with umlauts (utf)
by kcott
in thread treat files with umlauts (utf)
by mike.scharnow
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |