On Feb 7, 2008 10:53 PM, vijay krishna <[EMAIL PROTECTED]> wrote: > Hi, > This might just be a little too trivial. > I was just wondering if someone could give me a condition where I can > traverse across a complete string and perform operation until I encounter End > of Line. > This is what I tried snip
Well, you can use substr: for my $i (0 .. length($str)-1) { my $chr = substr($str, $i, 1); #do stuff with $chr } Or you can use split: for my $chr (split //, $str) { #do stuff with $chr } -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/