I literally grew up with perl (digitally, not literally), starting in 1996. We used local..
That was about the only declaration used by the stuff we got. Everything else was global $x=whatever, cleared it when you needed to re-define again. Yeah I know, this is garbage can development.
So I've got a ton of code right now (a well built system) that does not use strict, has tons of subroutines and is very well organized that uses my $var, at every occassion, and, uses return(); when no return $var is required. It's clean, efficient and it works.
It uses a lot of requires IE 'process.pl', 'whatever.pl'. (files required only when necessary).
I'd like to convert this big thing to a complete use strict as well as convert my design philosophy to using strict 24/7.
One thing I've noticed, is that I can put use strict in the header on a particular included file and it works fine as long as everything is declared before use.
Everytime I work on this code, I feel like the Gods at perlmonks are looking down on me telling me I suck because I don't have 'use strict' at the top end of my script, and I have globals. But it works, yes I use taint and warnings... and many other things (fill in the blank to avoid variable screwups).
My real question is, how would I take a large group of files written in perl without use strict, convert it to one where I can use it, and comply with the mighty directives that are adored by professional perl programmers and the future me?
I guess I'm just tired of hiding in the shadows of "Use everything, ie declare all $vars as OUR".
Well, if anyone has some insight on how to go from idiot to somewhat pro, it would be appreciated.
Been working at this for almost 20 years now (with much success), now it's time to change.
Thanks for any advice/help.
I'm new, this is my first post, but I've been here forever.
Thanks folks...
:-)
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.