The output read in from STDIN is correct -- how do I get the output from readdir to be correct -- NOTE: the filenames returned by readdir aren't usable (i.e. testing them with "-f" or such returns "no such file"....)...> 'ls' -1|tail -6 |perl -CSD -e'use 5.14.0; while (<>) { print } print "opening dir\n"; opendir(my $dh, "."); my @files = grep { /^[^.]/ } readdir $dh; my @sfiles=sort @files; my $start= @sfiles-6; for (my $i=$start; $i<@sfiles;++$i) { printf "%s\n", ${sfiles[$i]}; } ' zwadobef.ttf -chan.ttf みかちゃん-p.ttf みかちゃん-pb.ttf みかちゃん-ps.ttf みかちゃん.ttf opening dir zwadobef.ttf œ-chan.ttf み‹ち‚ƒ‚“-p.ttf み‹ち‚ƒ‚“-pb.ttf み‹ち‚ƒ‚“-ps.ttf み‹ち‚ƒ‚“.ttf
Unfortunately you'll have to imagine how this would look, since <code> doesn't protect unicode chars... it encodes them. The first bit of output doesn't look that way on a terminal... it outputs japanese hiragana characters...
Where does someone file a bug against perlmonks?...sigh...
In reply to how to unicode filenames? by perl-diddler
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |