Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re3: Conditionally Changing a Variable

by Hofmator (Curate)
on Dec 17, 2001 at 23:53 UTC ( #132635=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: Conditionally Changing a Variable
in thread Conditionally Changing a Variable

I had a similar problem in the past with variables such as: $n = $filenameB if ($n = $filenameA);

No wonder you are having problems with this, two errors in the same line :). First of all you are doing an assignment in the if-condition so this should be '==' instead of '='. And second '==' only works for numbers which is probably not what you want ($filename !!). You should use 'eq' instead. $n = $filenameB if ($n eq $filenameA);

-- Hofmator


Comment on Re3: Conditionally Changing a Variable
Select or Download Code
Re: Re3: Conditionally Changing a Variable
by Anonymous Monk on Dec 18, 2001 at 00:05 UTC
    Ah....the answers I had forgotten and needed. Thanks.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://132635]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2014-11-23 04:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (128 votes), past polls