If the $list is EMPTY, it will only contain a linefeed character(linux), which will be removed by chomp, so the following code should work:
More experienced programmers would probably use a regular expression, looking for a "word" character before collecting it.chomp $list; push @array,$list if length($list) > 0;
Potentia vobiscum ! (Si hoc legere scis nimium eruditionis habes)
In reply to Re: Adding element to Array?
by NetWallah
in thread Adding element to Array?
by cthar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |