in reply to If statement based on Radio Button Values

Thank you all for the info given thus far! I have done more research (not enough yet) and have made modifications so my IF statement now looks like this:
if (businessCall.value = "Yes_bus") { my $subject = "Branch Manager Business Call"; } else { my $subject = "Merchant Referral"; }
My error message is now a Software error: Can't modify concatenation (.) or string in scalar assignment near ""Yes_bus") " Global symbol "$subject" requires explicit package name at line 382 (which is where I use the smtp to send the email I am trying to generate).

If I just have a line of code stating:
my $subject = "Merchant Referral";
it works without issue. I am 100% messing up the If statement. I have tried without the ".value", with and without '==', as well as with an else if, and else. Most of the example I have looked at are dealing with "If (this happens) { Print statement here }; Not in setting value.

Replies are listed 'Best First'.
Re^2: If statement based on Radio Button Values
by poj (Abbot) on Nov 05, 2015 at 20:36 UTC
    businessCall.value is Javascript not Perl. Without seeing your script I can only guess you are using CGI and it should be something like
    my $subject = "Merchant Referral"; if (param('businessCall') eq "Yes_bus") { $subject = "Branch Manager Business Call"; }
    poj
Re^2: If statement based on Radio Button Values
by hippo (Archbishop) on Nov 05, 2015 at 22:22 UTC
    if (businessCall.value = "Yes_bus") {
    ...
    Can't modify concatenation (.) or string in scalar assignment near ""Yes_bus")

    That's an entirely descriptive message. You have a scalar assignment (=) when what you almost certainly want is a string equivalence test (eq). On the left hand side you have a concatenaction (.) between two barewords.

    Perhaps it's time to stop typing and have a nice cup of tea and a slow, steady read through perlintro and perlsyn?