Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^4: renaming filenames

by remiah (Hermit)
on Aug 17, 2012 at 15:29 UTC ( #987997=note: print w/ replies, xml ) Need Help??


in reply to Re^3: renaming filenames
in thread renaming filenames

Some questions.

1. Active Perl or Strawberry Perl ?

2. What shows your $_ in your program ? With my XP, it shows 8.3 style file names(For example, "Program Files"=> Progra~1).

foreach (@files) { print "$_\n"; my $original = $_; s/canción/poesía/; rename "$directory\\$original", "$directory\\$_"; }
What would $_ with Windows 7?.

3. When you install Win32::Unicode,Win32::Unicode::Dir, Does this work ?

use strict; use warnings; use utf8; use Win32::Unicode; use Win32::Unicode::Dir; my $wdir = Win32::Unicode::Dir->new; $wdir->open('./'); while ( my $file=$wdir->fetch ) { next if( $file !~ /^canción/ ); my $file_new=$file; $file_new =~ s/canción/poesía/; printW "$file ==> $file_new\n"; #moveW($file, $file_new) or die $!; } $wdir->close;
I tried with ActivePerl. As "andalou" says, I also met the same error when calling moveW. It seems lacking XS's function which is calling Win32API. I guess Strawberry Perl works ... fine?

Update:
I understand OP="andalou" now. If you are using Active Perl,

ppm install "http://sourceforge.jp/frs/g_redir.php?m=jaist&f=%2Fassp%2 +FASSP+V2+multithreading%2Fpackages%2FWin32-Unicode.ppd"
will remove your Win32::Unicode error messages. </code>


Comment on Re^4: renaming filenames
Select or Download Code
Re^5: renaming filenames
by andalou (Novice) on Aug 21, 2012 at 22:44 UTC

    Thanks remiah. How did you find the workaround for installing Win32::Unicode using ActivePerl?
    Is it better to uninstall ActivePerl and install Strawberry perl?

    Regards
      I googled with Win32::Unicode.ppd and found it. I always do this when my ppm-shell find no suitable package.

      But I am just tired of searching package for Active Perl...

      I can't uninstall Active Perl, because there is some working script. I would like to migrate gradually.

      regards

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://987997]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (10)
As of 2014-09-15 04:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (145 votes), past polls