develooper Front page | perl.beginners | Postings from March 2002

RE: reading one character at a time

Thread Previous | Thread Next
From:
Timothy Johnson
Date:
March 4, 2002 08:27
Subject:
RE: reading one character at a time
Message ID:
C0FD5BECE2F0C84EAA97D7300A500D5002581025@SMILEY
 
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($_);
}

-----Original Message-----
From: richard noel fell
To: beginners@perl.org
Sent: 3/3/02 6:28 PM
Subject: reading one character at a time

Is there a perl function that reads one character at a time from a
string and and returns that character? Something like the following:
$Line = some string;
foreach ($Line){
$char=read_char($_);}

Thanks,
Dick Fell

-- 
To unsubscribe, e-mail: beginners-unsubscribe@perl.org
For additional commands, e-mail: beginners-help@perl.org


--------------------------------------------------------------------------------
This email may contain confidential and privileged 
material for the sole use of the intended recipient. 
If you are not the intended recipient, please contact 
the sender and delete all copies.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About