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

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: Need help with pagination
by Corion (Patriarch) on Dec 30, 2022 at 19:33 UTC

    Where exactly do you need help?

    What is not working, and how is it failing?

    Also, you should not interpolate user-supplied data into strings and then pass them to your SQL database. Use DBI placeholders instead.

    Also, this code looks suspicious:

    while( ($ARTICLE{'name'},$ARTICLE{'author'},$ARTICLE{'label'},$ART +ICLE{'price'},$ARTICLE{'pochette'},$ARTICLE{'genre'})=$c->fetchrow()) + { $total +=1; }

    Maybe you wanted to do a select count(*) from ... instead, to make the database do the work?

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Need help with pagination
by AnomalousMonk (Archbishop) on Dec 31, 2022 at 01:16 UTC
    $depot =~ s/[^A-Za-z0-9 ]/;

    And this statement looks very wonky. Should it be
        $depot =~ s/[^A-Za-z0-9 ]//g;
    instead? (And might
        $depot =~ tr/A-Za-z0-9 //cd;
    be a better choice?)

    See s/// and tr/// in perlop.


    Give a man a fish:  <%-{-{-{-<

Re: Need help with pagination
by karlgoethebier (Abbot) on Dec 30, 2022 at 22:48 UTC

    Did you perhaps mean formatting instead of pagination?

    «The Crux of the Biscuit is the Apostrophe»

Re: Need help with pagination (Bobby Tables)
by LanX (Saint) on Dec 31, 2022 at 02:36 UTC
Re: Need help with pagination
by karlgoethebier (Abbot) on Dec 31, 2022 at 11:59 UTC

    In case you meant "formatting" this is the first address: Perltidy.

    If you're tinkering strings together and want to improve readability, something like this is an option:

    my $string = qq(Lorem ipsum kizuaheli); my $gizmo = qq( and the crux of the biscuit is the apostrophe); $string .= $gizmo;

    Take a look at Re: What is the best way to produce a formal pdf report autonomously?. A very basic Templating System, so to speak. And certainly good enough to get a feel for it.

    «The Crux of the Biscuit is the Apostrophe»

Re: Need help with pagination
by Anonymous Monk on Dec 31, 2022 at 09:16 UTC
    here is the code I'm been using $depot =~ s/[^A-Za-z0-9 ]/;

    don't lie