On 11-01-26 01:06 PM, Sunita Rani Pradhan wrote:
I think , this is like : index( $string, 'at', index( $string, 'at' ) +
1); Please let me know , if I am wrong.
I think you are correct.
#!/usr/bin/perl
use strict;
use warnings;
my $string = "The cat is sat on the mat";
for my $i ( 0 .. length( $string )){
printf "% 3d % 3d\t" , $i, index( $string, 'at', $i );
printf "% 3d % 3d\t" , $i, index( $string, 'at', index( $string,
'at', $i ));
printf "% 3d % 3d\t" , $i, index( $string, 'at', index( $string,
'at', $i ) + 1);
print "\n";
}
__END__
--
Just my 0.00000002 million dollars worth,
Shawn
Confusion is the first step of understanding.
Programming is as much about organization and communication
as it is about coding.
The secret to great software: Fail early & often.
Eliminate software piracy: use only FLOSS.
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/