in reply to Re: Assign scalar to array
in thread Assign scalar to array

Thank you for you're reply, but this did not produce any different results

Replies are listed 'Best First'.
Re^3: Assign scalar to array
by ikegami (Patriarch) on May 18, 2010 at 16:24 UTC

    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();