First, start by using use strict; use warnings;. You also have extra quotes in $LFILE = "\@arr10"; use strict; would have caught that.
use strict; use warnings; my $LOGFILE12 = '...'; sub GetDecUser { my $LFILE = -e $LOGFILE12 ? \@arr12 : \@arr10; return grep /declared users/, @$LFILE; } print "$_\n" for GetDecUser();
In reply to Re^3: Assign scalar to array
by ikegami
in thread Assign scalar to array
by topteam
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |