> -----Original Message-----
> From: Timothy Johnson [mailto:[EMAIL PROTECTED]]
> Subject: RE: reading one character at a time
> 
> I can't check this right now, but I believe you can do it like this:
> 
> $Line = "some string";
> @array = split //,$Line;  #split on null
> foreach(@array){
>    $char = read_char($_);
> }

Actually, this will generate an error on the read_char because perl will see
that as a subroutine.  This is almost the same, but will do what you want
without giving errors:

use strict;
my $Line = "some string";
my @array = split (//,$Line);  #split on null
foreach my $char (@array){
  print "$char\n";
}

would return:
s
o
m
e

s
t
r
i
n
g


Hope this helps...
Jason


CONFIDENTIALITY NOTICE:

************************************************************************

The information contained in this ELECTRONIC MAIL transmission
is confidential.  It may also be privileged work product or proprietary
information. This information is intended for the exclusive use of the
addressee(s).  If you are not the intended recipient, you are hereby
notified that any use, disclosure, dissemination, distribution [other
than to the addressee(s)], copying or taking of any action because
of this information is strictly prohibited.

************************************************************************

Reply via email to