#!usr/bin/perl use warnings; use strict; use 5.012; # 923276 my @bands = qw(red green blue yellow black brown); my $test = "green"; for my $band(@bands) { if ($test eq $band) { say "matched $test and $band"; } }
Output: matched green and green
In reply to Re: If condition operator
by ww
in thread If condition operator
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |