"Jonathan E. Paton" wrote: > You don't want to, reading one character > at a time is VERY slow. At worst, the > operating system will cut short your > time slot whilst it waits for the file > access - perhaps limiting you to a few > dozen characters per second... > > if you care much for that approach, > have a look at sysopen/sysread. > > A better approach is to read a line at > a time, and split it down into symbols. > However, it's unlikely you actually need > to do this in Perl. This works: > > my @chars = split //, $string; > > The best approach, is to read fixed sized > blocks with sysread and then split into > symbols. > > NB: I said you rarely need to split into > symbols, why? Because Perl has one of the > most expressive regular expression engine > in existance, that does almost all the text > manipulation you could ever require. > > If it's not text manip, I'd like to know > what happens to these symbols :) > > Take care, > > Jonathan Paton I want to translate text files on Russian koi-8r under Linux into Microsoft Windows-1251 keytables. So why I need read ALL symbols (also CR and LF). And, anymore, I want to change the lenght of the lines during this recoding. I am trying this:
$char=getc TXT; -- -----------! My blessing! Ramis. ! -----------! http://www.samtan.fromru.com mailto: [EMAIL PROTECTED] -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]