There is no such thing as "Unicode files".

Unicode is:

The things of interest here are the transfer formats: the most known are utf-8 and utf-16:

utf-8
maps the characters defined in ASCII into their usual representation as bytes with values under 128, allowing non-Unicode-aware programs to not make a mess of it (for example, utf-8-encoded strings can still be 0-terminated, the path separator doesn't change, and so on)
utf-16
is more compact for oriental scripts (a kanji in utf-8 can become 4 bytes long, but it's usually 2 bytes long in utf-16), but you can't use 0 to terminate you strings, because for example the character 'A' gets encoded as the two bytes 0 and 65. Moreover, utf-16 is sensitive to endianness

In the following, I'll assume you have utf-8-encoded files.

For Perl 5.005, you just have to handle them as binary files, i.e. you don't have support for Unicode strings.

Perl 5.8 does have support, you just have to tell it which encoding your files are in:

open UTF8FILE,'<:utf8','filename'; while (<UTF8FILE>) { /\p{Devangari}/ and print "A Devangari character!\n"; } close UTF8FILE;
This script would open the file assuming it is in utf-8, and print a message if it finds any character in the Devangari script.

Thing to look at (in the 5.8 docs):

And also The UTF-8 and Unicode FAQ

-- 
        dakkar - Mobilis in mobile

In reply to Re: reading unicode files by dakkar
in thread reading unicode files by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.