Can someone explain to me why this is just wrong and if it is not too much to ask, what is the solution ?#! /usr/bin/perl use strict ; use warnings ; my @a ; $a[0] = "a" ; $a[1] = "a" ; $a[2] = "b" ; $a[3] = "a" ; my $b = 0 ; $b ++ if ( $_ eq "b" ) foreach @a ; print "$b\n" ;
In reply to problem with foreach by jeanluca
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |