We don't bite newbies here... much | |
PerlMonks |
Re3: Conditionally Changing a Variableby Hofmator (Curate) |
on Dec 17, 2001 at 23:53 UTC ( [id://132635]=note: print w/replies, xml ) | Need Help?? |
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
In Section
Seekers of Perl Wisdom
|
|