kaarthikeyaan has asked for the wisdom of the Perl Monks concerning the following question:

Hi all,

if ($p4have !~ /$local/) { print "$local - Extra File\n"; $extra++; }

When $p4have contains value like "C:\Documents and Settings\All Users\Favorites" (i.e. without anyspecial character or german characters) it is working absolutely fine but if the $p4have contains any special chars or foreign chars (e.g. D:\docs\für_den_Integrator.pdf) it is always false.

Can someone help me to get rid of this problem.

Thanks in advance

Regards

Karthikeyaan A. R.

Replies are listed 'Best First'.
Re: How to handle Special characters and foreign characters in perl
by moritz (Cardinal) on Apr 04, 2012 at 13:21 UTC

      Thank you...

Re: How to handle Special characters and foreign characters in perl
by CountZero (Bishop) on Apr 04, 2012 at 17:28 UTC
    You will get better and more helpful answers when you show a (small) script that exhibits this behaviour.

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

    My blog: Imperial Deltronics