in reply to not able to get the output using split function
my $i; for ($i = 0; $i < scalar(@words); $i++) { print "$i: " . $words[$i] . "\n"; }
is better written:
for my $i (0 .. $#words) { print "$i: $words[$i]\n"; }
or could be written using for as a statement modifier as:
print "$_: $words[$_]\n" for 0 .. $#words;
True laziness is hard work
In Section
Seekers of Perl Wisdom