Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

runrig (3385)


Just another perl hacker somewhere near Disneyland

I have this homenode [] of little consequence on Perl Monks [] that you probably have no interest in whatsoever.

I also have some modules [] on CPAN [] some of which are marginally [] more [] useful [] than others.

Journal of runrig (3385)

Thursday February 20, 2003
06:26 PM

Useless use of division

[ #10714 ]
Noticed this sort of thing several times over while editing a 4gl report:

if rpt.value/1000 < 0 then
  print 0
  print rpt.value/1000
end if

On another note, I wonder how much demand there would be for 4gl-like text report module in perl, with things like page headers and trailers, group headers and trailers, among other things. Back when I was first looking at perl formats, these were the things I was missing, and now I finally might be ready to code such a thing. Or is there something on CPAN I'm just not seeing yet?

Then again, a co-worker says I should just skip plain text reports and go straight to something more Crystal Reports-like, but I don't know where I'd start there (XML FO's? How to tell where to print page trailers w/variable fonts? etc).

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • So rpt.value can't be negative? Maybe they wanted to report negative values as 0.
    • The useless part is in the boolean section of the 'if' statement. It's not a real big deal, but I haven't seen a number yet that flips its sign when you divide by a positive number. Unless you overload '/', but let's not get into that, and you can't do it in this 4gl anyway :-)
  • A Perl Report Generator - somewhat like format, but with headers and footers, and breaks and running sums and ...[takes a firm grip on himself and tries to remain calm]

    I would just love it!

    It should be possible already, The Damian is probably doing a proof of concept - or will soon, as promised in apocalypse 7 [] (look at the very end of the page).