To Tad: Great perl class, and question

A

asdfasd

Thanks Tad. I enjoy your training class a lot during your visit here in
Lexington, Kentucky.

Just a quick question: We have some old perl scripts that don't really
conform to the new coding standard, mainly with the problem of variable
scoping. You mentioned in the class that the "my" keyword should be used in
the new perl; otherwise, the variables will be default to global.

Is there a tool, or some scripts, that will be able to parse the source
files and "suggest" the existance of local/global variable conflicts? We
are trying to upgrade our perl runtime (Windows) to 5.8x, but facing the
possibility of having an extensive code review. Any help will be greatly
appreciated.

Thanks in advance.

David
(e-mail address removed)
 
B

brian d foy

[[ This message was both posted and mailed: see
the "To," "Cc," and "Newsgroups" headers for details. ]]

asdfasd <[email protected]> said:
Thanks Tad. I enjoy your training class a lot during your visit here in
Lexington, Kentucky.
Is there a tool, or some scripts, that will be able to parse the source
files and "suggest" the existance of local/global variable conflicts? We
are trying to upgrade our perl runtime (Windows) to 5.8x, but facing the
possibility of having an extensive code review. Any help will be greatly
appreciated.


I've found that most places should probably leave existing code as
it is until they *need* to change it. If it works now, anything you
do to it can break it in new ways. I recommend using your new coding
skills for new projects.

That being said, there are a lot of tools in the Devel:: namespace
to do various sorts of inspections. Human eyeballs tend to be the
best tool, in my experience. :)
 
R

Robert

asdfasd said:
Thanks Tad. I enjoy your training class a lot during your visit here in
Lexington, Kentucky.

Just a quick question: We have some old perl scripts that don't really
conform to the new coding standard, mainly with the problem of variable
scoping. You mentioned in the class that the "my" keyword should be used
in
the new perl; otherwise, the variables will be default to global.

Is there a tool, or some scripts, that will be able to parse the source
files and "suggest" the existance of local/global variable conflicts? We
are trying to upgrade our perl runtime (Windows) to 5.8x, but facing the
possibility of having an extensive code review. Any help will be greatly
appreciated.

Thanks in advance.

David
(e-mail address removed)
I just want to recommend the book "Perl Medic" as an outstanding resource in
this area.

http://www.perlmedic.com/

HTH

Robert
 
T

Tad McClellan

^^^^
^^^^

[ I'd avoid using that particular string in the From header,
it is marked down in some scorefiles.
]

Thanks Tad. I enjoy your training class a lot during your visit here in
Lexington, Kentucky.


Cool!

It was my 1st time in Kentucky, I found I liked it a lot.

Just a quick question: We have some old perl scripts that don't really
conform to the new coding standard, mainly with the problem of variable
scoping. You mentioned in the class that the "my" keyword should be used in
the new perl; otherwise, the variables will be default to global.

Is there a tool, or some scripts, that will be able to parse the source
files and "suggest" the existance of local/global variable conflicts?


Apart from the Devel::* modules pointed out by my fellow
Stonehengian(?) putting "use strict;" in will point out all the
first uses of variables.

Whether they should be my()d or left local() will need to be
decided on a case-by-case basis (use my() unless it doesn't work).

I'd start by my()ing a few and then rerunning your test suite.
Then lather, rinse and repeat until all of the "explicit package name"
messages go away, and all of the test suite passes.
 
P

Peter Scott

asdfasd said:
Just a quick question: We have some old perl scripts that don't really
conform to the new coding standard, mainly with the problem of variable
scoping. [snip]
I just want to recommend the book "Perl Medic" as an outstanding resource in
this area.

Modesty forbids me from tooting my own horn. Therefore I shall instead
applaud this posting for its sagacity, judgement, relevance, and
the obvious intelligence of its author.

:)
 
U

Uri Guttman

PS> In article said:
asdfasd said:
Just a quick question: We have some old perl scripts that don't really
conform to the new coding standard, mainly with the problem of variable
scoping. PS> [snip]
I just want to recommend the book "Perl Medic" as an outstanding resource in
this area.

PS> Modesty forbids me from tooting my own horn. Therefore I shall instead
PS> applaud this posting for its sagacity, judgement, relevance, and
PS> the obvious intelligence of its author.

PS> :)

and i will also toot peter's horn. the book is well worth whatever you
pay for it. buy it so peter can pay for his mortgage. :)

<and check out the acknowledgement page (online) to see why i plug it :)>

uri
 
R

Ron Parker

Did you bring us back some J.D. :)

You mean Jack Daniels' Old No. 7 TENNESSEE Sour Mash Whiskey?
Why would he bring that back from Kentucky when thay have all
those fine bourbons?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top