My output shows as below.use strict; use warnings; my $sentence = shift; my @words = split(/\s+/, $sentence); my $i; for($i=0;$i<scalar (@words);$i++) { print "$i: " . $words[$i] . "\n"; }
0: i
In reply to not able to get the output using split function by ulaksh
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |