Getting a warning


I am getting following warning-
Found = in conditional, should be == at line 63.
part of the code is here
$status ='incomplete'
CHECK: for my $file ( @files ) 
	$size= -s $file;
	sleep 1;
	$size_later= -s $file;

    if ($size==$size_later)
        $status= 'complete';
    else {$status='incomplete';
         last CHECK;}

until ($status='complete');
if ($status ='complete')  # this is line 63
#things to do

Open in new window

I cannot figure it out.  If I remove the If, it compiles fine.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Steven CarnahanNetwork ManagerCommented:
if ($status ='complete')  # this is line 63


if ($status == 'complete')  # this is line 63

A single "=" is an assignment operator (you assign complete to $status)
A double "=" is a comparison operator (is $status the same as complete)
perlwhiteAuthor Commented:
I get this with if ($status == 'complete')  twice.

Argument 'complete'  isn't numeric in numeric eq (==) at line 62 
Argument 'complete'  isn't numeric in numeric eq (==) at line 62 

Open in new window

Steven CarnahanNetwork ManagerCommented:
You are using numeric instead of string comparison operators.

Equal to
•Numeric: ==
 •String operator: eq

Not equal to
•Numeric: !=
 •String operator: ne

Example line 62:

until ($status='complete');

should be

until ($status eq 'complete');

since it is a string comparison.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.