in reply to Re: Unmatched right curly bracket ...
in thread Unmatched right curly bracket ...

Here is the code, I decided to take the Html out to make it less unwieldly...
sub section2 { print <<ENDHTML; # Html goes in here ENDHTML unless ($home_fax eq ""){ print <<ENDHTML; # Html goes in here ENDHTML } print <<ENDHTML; # Html goes in here ENDHTML unless ($Company eq "") { print <<ENDHTML; # Html goes in here ENDHTML } unless ($position eq "") { print <<ENDHTML; # Html goes in here ENDHTML } unless ($company_address1 eq "") { print <<ENDHTML; # Html goes in here ENDHTML } unless ($company_postal1 eq ""){ print <<ENDHTML; # Html goes in here ENDHTML } unless ($company_phone eq "") { print <<ENDHTML; # Html goes in here ENDHTML } unless ($company_fax eq "") { print <<ENDHTML; # Html goes in here ENDHTML } print <<ENDHTML; # Html goes in here ENDHTML }
Cheers, Gerard.

Replies are listed 'Best First'.
Re: Re: Re: Unmatched right curly bracket ...
by strat (Canon) on Feb 27, 2002 at 11:39 UTC
    Kill the spaces after each ending tag ENDHTML, because after ENDHTML there must immediately follow a \n; otherwise it is not interpreted as the end of a HERE-Document and an error like this occurs...

    Best regards,
    perl -le "s==*F=e=>y~\*martinF~stronat~=>s~[^\w]~~g=>chop,print"

      Excellent, by using a combination of simon.proctor'ss and strat's replies, I have been able to solve the problem. Thanks heaps all.
      Regards,

      Gerard
Re: Re: Re: Unmatched right curly bracket ...
by PrakashK (Pilgrim) on Feb 27, 2002 at 15:42 UTC
    I know I am not addressing your question, but why use unless when you are checking for truth values?

    I'd rather use if:

    if ($company_fax) { .... }
    instead of:
    unless ($company_fax eq "") .... }
    /prakash