in reply to Assign scalar to array

References Quick Reference

for $dec (@arr10)
becomes
for $dec (@$LFILE)

Replies are listed 'Best First'.
Re^2: Assign scalar to array
by topteam (Initiate) on May 18, 2010 at 15:31 UTC

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

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