Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re^3: Convert BMP to HTMLby Athanasius (Archbishop) |
on Nov 03, 2022 at 12:12 UTC ( [id://11147936]=note: print w/replies, xml ) | Need Help?? |
Hi harangzsolt33, The only reason I like to keep my scripts compatible with Perl 5.004 is because that way they work on the earliest Perl interpreter I have in my possession. ... And having a script that can run on anything is great. It's one less thing to worry about. Okay, but that just begs the question: why do you want to support legacy versions of the perl interpreter? Upgrading to shiny new1 versions gives you at least three benefits:
With a few minor exceptions,2 your old scripts should still run fine on the more modern perl interpreters. I have played around a lot with string variables and I noticed that if I have a very large string in a sub, exiting the sub will not destroy the big string in memory! ... and doing undef $VARIABLE causes Perl to free up that memory. Are you sure you were using lexical variables when you observed this? The super long sub is actually an experiment. I wrote a short one, and I noticed that there are a lot of variables, and passing them around to sub routines is no fun. ... So, I've tried to break up this sub into 5-6 smaller sub-routines, and the result is not nice. The code didn't look pretty. So, I don't know what to do... That’s a pretty good indication that an object oriented approach is called for. 1Well, new-ish. The latest poll made me realise that my version of Strawberry Perl (the newest they offer) is now two years out of date. :-( Cheers,
In Section
Cool Uses for Perl
|
|