http://www.perlmonks.org?node_id=990938


in reply to How can I store a scalar variable, coming out of a do-until loop, as an element in an array for further operations?

print "Cannot open file \"$filename\"\n\n"; # Line 16 exit;
You can use die instead of print and exit. Also, die throws exceptions, so they can be catched and handled outside the running code. This can be useful for generating backtraces and other debugging things.

 @all_sentences=(my $sentence);                 # Line 34
Did you mean push? push @all_sentences,$sentence;

 my $diff_letters="code?????";             # Line 38
You can use ... when you don't know what to write, Perl will automatically throw "Unimplemented" exception at this point. Anyway, did you mean for (1..$#all_sentences) {print abs(length $all_sentences[$_-1] - length $all_sentences[$_]), "\n";}? See abs, length, perlsyn for more information.

Sorry if my advice was wrong.