in reply to Re^3: Comparison between a string and an array
in thread Comparison between a string and an array

my ($match,$res);

would do what you were trying to do.

But God demonstrates His own love toward us, in that while we were yet sinners, Christ died for us. Romans 5:8 (NASB)

Replies are listed 'Best First'.
Re^5: Comparison between a string and an array
by sir_jeff (Novice) on Sep 27, 2016 at 03:04 UTC
    Declaring (not assigning) $match & $res as local vars. Just a habit (I always write it this way). The long way would be :
    my $match; my $res;
    or to declare and assign :
    my $match=""; my $res="";
    But as I said earlier - I won't use "my" if it's just rough code (as it's not a Strict script - just example code)