Help: Debug perl codes

A

Amy Lee

Hello,

Is there any way to debug perl codes like shell script with "sh -x"?

Thank you very much~

Best Regards,

Amy
 
J

Jürgen Exner

Amy Lee said:
Is there any way to debug perl codes like shell script with "sh -x"?

Is there anything wrong with the answer to 'perldoc -q debug':
How do I debug my Perl programs?

jue
 
T

Tad J McClellan

Is there any way to debug perl codes like shell script with "sh -x"?


Please do not continue to use this newsgroup as a service
that reads the docs to you.

Make at least some small effort to answer your questions yourself
before resorting to asking here.

Have you seen the Posting Guidelines that are posted here frequently?


perldoc -q debug

How do I debug my Perl programs?
 
J

Jürgen Exner

Peter Scott said:
Perhaps that it doesn't answer Amy's question? She wants:

Fair enough.
Devel::Trace Print out each line before it is executed (like sh -x)

Because 'sh' is not a Perl command if would have helped to explain what
it does, just like you did in just half a sentence.

jue
 
M

Michael Carman

Thrill5 said:
Or else what? You'll stop posting and we all wont be able to read your
rants anymore?

Waahhhh!!!

Don't mock. Many highly knowledgeable Perl programmers *have* stopped
posting here -- to everyones loss -- because they've grown weary of
answering the same questions ad nauseum and of self-righteous whiners
throwing tantrums when they are told to RTFM.

I'd rather lose them than Tad.

-mjc
 
A

Amy Lee

If everyone were to RTFM then there wouldn't be any need to post any
messages here in the first place. Everything about Perl is documented ad
nauseam and at least a couple hundred books published on the subject. This
is a public newsgroup where ANYONE can post a ANY question they want that is
related to Perl even if it is printed in the FUCKING MANUAL. If someone
thinks the question is STUPID, SHUT THE **** UP and don't REPLY. No one is
forcing anyone to answer any question. If your too think your too smart to
answer stupid questions, don't waste YOUR time, or my bandwidth with a "your
stupid because you didn't RTFM" answer. The only self-righteous douchbags
on this newsgroups are the "highly knowledgeable Perl programmers" replying
with RTFM.
Actually speaking, I have read the manual before I post my problem. But I
hope I can trace every sentence in my perl codes not just 'debug'.
However, I suppose that someone really did as misunderstood.

As I think, experts might more be patient to newbies, right?

Regards,

Amy
 
S

Sherm Pendley

Amy Lee said:
As I think, experts might more be patient to newbies, right?

In my experience, I've found that the experts here are *far* more
patient and helpful than the whiners claim. Sadly, no matter how
patient one is, or how many helpful fishing lessons one gives, there
will inevitably be someone in the audience who feels entitled to a
free fish dinner instead.

I suggest you keep reading a while - you'll quickly get a good feel
for who is helpful here, and who's a self-entitled crank. A good
indication of the latter is a half-shouted rant about how useless the
regulars are, like the one to which you responded. :)

sherm--
 
S

Sherm Pendley

Vernan R. said:
I don't understand your reasoning. If you are saying the OP
was seeking free fish, then you are clearly mistaken. If
you are saying he who corected those presuming the question
to be a FAQ, then you are also wrong.

Please don't put words in my mouth - if I had meant to say either of
those things, I would have. The OP's question was perfectly valid, not
in the FAQ, and those who directed her to the FAQ were mistaken.

There are a handful of people here who *did* demand answers that would
have been *trivially* answered with the most cursory search in the
docs. I'm not referring to the OP, but to those "defending" her
question by carrying on about how "mean" the regulars are. They've
behaved badly in the past, been slapped down for it, and now they're
carrying a grudge. As I said, it's easy to see who they are, by simply
watching the group for a while, and observing who tries to be helpful
and who does nothing but complain.

I don't think it's a problem that's endemic to this group, btw, just
human nature. In my experience, whenever you get a large enough group
of people together, there will inevitably be a few freeloaders and
whiners among them.
I never got the impression anyone was attempting to say that
the "regulars", as you put it, are useless

Did you *read* the rant she responded to? :)
instead of letting it be, you are defending the error?

Of course not. What I take objection to is the popular notion among
whiners (including the one to whom the OP had responded) that such
things are intentional attacks. The picture that these people paint,
of being irrationally "attacked" by regulars who "hate newbies," is
nothing but a ridiculous caricature.

sherm--
 
S

Sherm Pendley

Thrill5 said:
My "rant" was directed only to the bullies that like to ridicule
posters because *they think* someone asked a dumb question.

Exactly my point. When regulars make mistakes, you describe them as
"bullies" who "like to ridicule" people. You refuse to consider that
it was an honest mistake brought about by misinterpreting the OP's
question; instead, you whine and rant about a hidden agenda that
exists only in your imagination.
was a valid one and the reply *quote*
*end quote* offers no help to anyone.

I'm not saying it did. What I find offensive is your claim that it was
a deliberate attack by someone who's just being a bully.
How does he know if the OP spent 2 hours
researching or spent none?

Well, given that Tad's response was off the mark, it's pretty obvious
that he *doesn't* know that 100%. Mistakes happen. *Your* mistake is
assuming that his response was intentional bullying.
Why does it that matter anyway?

Speaking for myself, I believe that being able to navigate reference
material is the single most useful skill that a programmer can have,
in any language. Operating systems, languages, and toolkits come and
go, far too quickly for anyone to do more than absorb general concepts
and principles; that makes it critical for a programmer to be able to
look up the relevant details on an as-needed basis.

So, when I answer someone's question with a reference to the docs, I
do so because I believe it's helpful on two levels. First, there's the
short-term help of answering their immediate question, and second, I
think it's helpful to encourage the long-term development of what I
consider to be a critical skill.

I think that most of the regulars are thinking along similar lines,
and trying to offer what we think is the most helpful advice we can
give. Sometimes we fail in the attempt, and our advice isn't as
helpful as it could be; but that's just a failure in execution, not
evidence of ill intent.

sherm--
 
T

Ted Zlatanov

T> Isn't one of the great things about a newsgroup is that your CAN use
T> this newsgroup as a service to read the docs for you?

If you don't seek knowledge on your own, no amount of external help will
make you a better programmer (or better at anything else).

Ted
 
M

Michael Carman

Thrill5 said:
There are no dumb questions, only dumb answers

That was in grade school. There are plenty of dumb questions in the
adult world.
Isn't one of the great things about a newsgroup is that your CAN use
this newsgroup as a service to read the docs for you?

Hell, no! It's incredibly rude and selfish to expect someone to do that
for you. Besides, if someone can't read the docs what makes you think
they can read them when they're quoted?
How does he know if the OP spent 2 hours researching or spent none?

Unless the OP tells us outright he can't. He can only make an educated
guess. The less information the OP provides the more likely she is to be
judged as having *not* tried to help herself first.
Why does it that matter anyway?

It matters because it's human nature to want to help people who deserve
it and to not want to be taken advantage of by people who don't.

For the record, I've never seen anyone flamed when they post a question
that follows this pattern:

I want to do X. I googled for Y and read the Z page in perldoc, but
couldn't find what I was looking for.

Even if X is a blatant FAQ the answers are usually "that's in the
perlfoo manpage" or maybe just "perldoc perlfoo." No-one says "RTFM"
when the OP demonstrates that they made an effort, however cursory.

-mjc
 
T

Tad J McClellan

Michael Carman said:
Thrill5 wrote:

Unless the OP tells us outright he can't. He can only make an educated
guess. The less information the OP provides the more likely she is to be
judged as having *not* tried to help herself first.


This OP has been here for quite some time, there is a history
of previous behavior here.

I clearly knee-jerked that she was asking a FAQ when she wasn't, but
that was because she has trained me to expect that in her posts.

I was feeling bad about the knee jerking at first, maybe she asked
for fish previously only because she didn't know how to fish, and
that it was no longer a problem...

.... until she posted a FAQ contemporary with this very thread:

http://groups.google.com/group/comp.lang.perl.misc/msg/265fc3649125bdab

It matters because it's human nature to want to help people who deserve
it and to not want to be taken advantage of by people who don't.


I expect that the "poster of the trollish persuasion" knee-jerked
on my motivation for the 1st part of my followup because it is not
a regular participant here, and so did not know what to expect
from this OP.

The 1st part of my followup was clearly an aside anyway (that's
why it was in [square brackets]).

My reason for following up was actually the 2nd part.

Past behavior indicated that she was missing out on several key
ways of fishing for help with Perl.

Current behavior indicated that she was missing out on several key
ways of fishing for help with Perl, since she had missed out on
"perldoc -q".

And even future behavior (after my followup in this thread)
indicated that she was missing out on several key
ways of fishing for help with Perl.

So my purpose was to point out (yet again) how to pick up on
several key ways of fishing for help with Perl.
 
P

Peter J. Holzer

Actually speaking, I have read the manual before I post my problem. But I
hope I can trace every sentence in my perl codes not just 'debug'.
^^^^^ ^^^^^

Well, that's two keywords you could search for. And in fact, if you
search for "trace" in "perldoc perldebug", you will discover AutoTrace,
which is another answer to your question.

hp
 

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

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top