in reply to Use perl CGI to create <a href="url" target="t">text</a>?

HTML generating functions have been moved to CGI::HTML::Functions. $cgi->a isn't documented there, but the example right at the beginning of the linked section should be enough to understand how it works.

Nowadays, we usually use templates to generate HTML (Template::Toolkit, Text::Xslate). Going back to print is not the right way.

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^2: Use perl CGI to create <a href="url" target="t">text</a>?
by misterperl (Friar) on Jun 08, 2022 at 14:07 UTC
    TYVM yes I see that and got it working ! Well done..
Re^2: Use perl CGI to create <a href="url" target="t">text</a>?
by Anonymous Monk on Jun 08, 2022 at 20:41 UTC

    Nowadays, we usually use templates to generate HTML (Template::Toolkit, Text::Xslate). Going back to print is not the right way.

    a template by any other name ;)

    since it started in ~1995 it didn't take a lot of work with "CGI::HTML::Functions" to find bugs, then check the bug cue/Changes, and realize bugs remain and reappear way too frequently to be relied upon, so you start writing your own functions and soon

    soon you turn it into heredocs with escapeHTML... There is a reason a diy templating engine is a rite of passage