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

I thought my$match,$res; the same as writing

my$match; my$res;

I'm just declaring both on one line.
Anyway it was just a rough (working) code fart. If I was gonna bother with strict then I'd even add the shebang! and a "use warning" , but yeah nah, point taken. I'll leave out the local or global declarations next time to make it more obvious, cheers -SJ-

Replies are listed 'Best First'.
Re^4: Comparison between a string and an array
by GotToBTru (Prior) on Sep 26, 2016 at 11:59 UTC
    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)

      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)