in reply to Re: intersection of scalar with 1D array and 2D array Matlab=>Perl
in thread intersection of scalar with 1D array and 2D array Matlab=>Perl

This will accommodate the case when $seclar is Zero
Not needed:
$ perl -MO=Deparse -e 'while (my $scalar = <$TEST>) {1}' while (defined(my $scalar = <$TEST>)) { do { '???' }; } -e syntax OK

Relevant: To Kill a Meme: while(defined($line = <>))

لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
  • Comment on Re^2: intersection of scalar with 1D array and 2D array Matlab=>Perl
  • Download Code

Replies are listed 'Best First'.
Re^3: intersection of scalar with 1D array and 2D array Matlab=>Perl
by NetWallah (Canon) on Aug 31, 2014 at 01:20 UTC
    Correct, scary, and certainly not obvious.

    Thanks for the education.

    More discussion on this issue is at stack overflow.

            "You're only given one little spark of madness. You mustn't lose it."         - Robin Williams