I am trying to do this boolean expression in perl and my code is supposed to be like this
enter code here
$flag = 0;
while (<INFILE>)
{
if(/name/ && $flag==0)
{
$flag = 1;
print "HELLO\n";
}
elsif($flag)
{
print "Bye\n";
My plan is to write something like this
flag=0
while<>
if(/name/ && !flag)
flag=1;
elsif(flag)
last;
So is there anything wrong in what i did in the code what i reproduced? Is this the way of declaring a true and false value in perl
Based on your comment below:
Or you can do: