in reply to Loop Array - If $var is something write values until $var is something else
maikelnight: Further to Marshall's post: Please see Short, Self-Contained, Correct Example. The monks grow sullen and silent when you make them do a lot of work in order to give free advice.
Others have noted that you don't seem to have warnings and strictures enabled. Let me repeat: Especially if you're a beginning Perler, always have the two statements
use warnings;
use strict;
at the beginning of your script. See (and use!) warnings and strict.
Finally, you seem confused about just what is in the @cleared array; we certainly are. Using some kind of data dumper can bring much enlightenment. Popular are Data::Dumper::Dump() (which is core and so should already be loaded in your system), and Data::Dump::dd() (which I like better, but it's not core, so you may have to load it yourself). Use one or the other
use Data::Dumper;
...
print Dumper \@cleared;
or
use Data::Dump;
...
dd \@cleared;
and you may find yourself much further down the road to a working application!
Give a man a fish: <%-{-{-{-<
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Loop Array - If $var is something write values until $var is something else
by maikelnight (Sexton) on Sep 29, 2018 at 20:05 UTC | |
by BillKSmith (Monsignor) on Sep 30, 2018 at 00:58 UTC |