b310 has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

I'm trying to add a hyperlink in the middle of a paragraph and it's not working.

Can someone take a look at the code and help me out?

$page .= p ({-style=>"font-family: verdana; font-size: 10pt;"}, "Shipp +ing and tax may be added to your order.\n" . "For estimated shipping and tax, see (a ({-href => " +../shiptax.htm"}, Shipping and Tax Estimate))");
Thanks.

Replies are listed 'Best First'.
Re: Trying add a hyperlink problem
by particle (Vicar) on Mar 03, 2003 at 21:25 UTC

    clear formatting might help you see the function was embedded in a double-quoted string, and was not interpolated as a function. try (untested)

    $page .= p( { -style => "font-family: verdana; font-size: 10pt;" }, "Shipping and tax may be added to your order.\n" . "For estimated shipping and tax, see " . a( { -href => "../shiptax.htm" }, "Shipping and Tax Estimate" ) );

    ~Particle *accelerates*

      Hi.

      Thanks for the help. It worked.
Re: Trying add a hyperlink problem
by Zaxo (Archbishop) on Mar 03, 2003 at 21:27 UTC

    Quoting problems, subroutines are not evaluated within double quotes. You are also tryint to nest double quotes.

    $page .= p({-style=>"font-family: verdana; font-size: 10pt;"}, 'Shipping and tax may be added to your order. For estimated shipping and tax, see ' . a({-href => '../shiptax.htm'},'Shipping and Tax Estimate.'));

    Update: Fixed a thinko with quoted newline, ++VSarkiss for the spot.

    After Compline,
    Zaxo