in reply to div in cgi

Continuing to make life difficult for yourself I see. Your script prints what you tell it:

CGI::Pretty is DEPRECATED and will be removed in a future release. Ple +ase see https://github.com/leejo/CGI.pm/issues/162 for more informati +on at /home/marto/perl5/perlbrew/perls/perl-5.26.1/lib/site_perl/5.26 +.1/CGI/Pretty.pm line 21. <li><div class=class=inforno /> <div><img <img src=''</div></li>

You ask it to print invalid HTML, which it does.

use CGI::Pretty ":standard"; print li ( div({"class=inforno"}, "<img src=''>") );

Produces:

CGI::Pretty is DEPRECATED and will be removed in a future release. Ple +ase see https://github.com/leejo/CGI.pm/issues/162 for more informati +on at /home/marto/perl5/perlbrew/perls/perl-5.26.1/lib/site_perl/5.26 +.1/CGI/Pretty.pm line 21. <li><div class=inforno><img src=''></div></li>

You seem to be ignoring good advice, choosing to use modules which are deprecated, even when this module was supported it was ~10x slower than just using CGI, and recommended for debugging purposes only.

Replies are listed 'Best First'.
Re^2: div in cgi
by LanX (Saint) on Sep 13, 2018 at 15:12 UTC
    I don't understand the wording "DEPRECATED" here.

    The fact that it will be removed from CORE doesn't mean it will cease to exist in CPAN, right?

    Mind you large parts of this monastery is using such functions from CGI, a hypothetical update to a newer Perl would be impossible without such a module for backwards compatibility.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

      In so much that it no longer does what it's supposed to, notice that the output isn't 'pretty', from the docs:

      'It will be removed from the CGI distribution in a future release, so you should no longer use it and remove it from any code that currently uses it.

      For now it has been reduced to a shell to prevent your code breaking, but the "pretty" functions will no longer output "pretty" HTML.'

      It then continues to give examples of better ways of doing this. Regardless OP has already had templating systems and other frameworks suggested to them.

        There is some confusion about CGI::Pretty and CGI::HTML::Functions .

        At least in my head...

        update

        the OP is using functions which are (currently) exported by CGI and not by CGI::Pretty, but documented in CGI::HTML::Functions

        X:\>perl -MCGI=:standard print li ( div({"class=inforno"}, "<img src=''>") ); __END__ <li><div class=inforno><img src=''></div></li>

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

Re^2: div in cgi
by bigup401 (Pilgrim) on Sep 13, 2018 at 15:11 UTC

    thanks