in reply to How to get each character in string value
You may want something like this?
use strict; use warnings; my $string = "Hello World"; while($string =~/./g){ print "$&\n"; }
Or,
use strict; use warnings; my $string = "Hello World"; my @string = split(//,$string); for my $str (@string){ print "$str\n"; }
Punitha
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: How to get each character in string value
by linuxer (Curate) on Dec 02, 2008 at 09:26 UTC |
In Section
Seekers of Perl Wisdom