capture return value from a perl program

E

Eckstein C.

Tad said:
[ text rearranged into chronological order, please stop posting
upside-down.
]




Does that mean that you _have_ read the posting guidelines for this
group?

If so, then why do you continue to post upside-down?

Are you trying to make folks mad on purpose?

Christ all mighty. Why do you always have to jump on people like this?
Is he really doing something to hurt you deeply? He seems like someone
who is trying to get a grasp on all this, I certainally don't think this
sort of harshess is necissary, nor does it help him in any way.

No offense intended, but if you really feel the way you indicate above,
then please do everyone a favor and take a healthy break from your
computer and find a little side hobby; this level of obsession just
isn't healthy, and frankly, you jsut come across as mean sprirted, even
if it's not your intent.

All I'm asking is to jsut calm down and stop assuming when something
like what your replied to occurs, it's not someone intentionally trying
to piss everyone off or start a fight. Not everyone sees through your
eyes you know, and sometimes people might make a mistake. It happens.
Theres just no need to make 'em walk the plank for it.
 
V

Vronans

J. Gleixner said:
Yes. Learning how to debug your own scripts will save you, and us, a
lot of time.

With all due respect, who is forcing you to debug it, if you feel it's
taking up too much time? Yes it's good to learn, but I don't feel it's
correct to make that sort of implication.
 
T

Tad McClellan

Eckstein C. said:
I really don't mean to appear rude


Then you have failed.

All I'm saying thre are far too manythings you cna do in life then
simply sit and monitor a news group for off topic posts all day.


He doesn't monitor all day for off-topic posts, he monitors all
day to find questions that he can answer.

It is during that monitoring that he comes across off-topic postings.

Like is
too short, and not to mention it's jsut better to get out from time to
^^^^
^^^^
Uh oh.
 
T

Tad McClellan

Eckstein C. said:
Tad said:
[ text rearranged into chronological order, please stop posting
upside-down.
]


A. Sinan Unur wrote:
(e-mail address removed) wrote in

any feedback much appreciated.

I am thinking you need to stop, take a deep breath, and read the
posting guidelines for this group. You started out with an
off-topic posting, and now you are rapidly shooting TOFU at us.


Does that mean that you _have_ read the posting guidelines for this
group?

If so, then why do you continue to post upside-down?

Are you trying to make folks mad on purpose?

Christ all mighty. Why do you always have to jump on people like this?
Is he really doing something to hurt you deeply? He seems like someone
who is trying to get a grasp on all this, I certainally don't think this
sort of harshess is necissary, nor does it help him in any way.


Yes it does.

It helps him to avoid becoming widely ignored forevermore.

No offense intended,


I am afraid that I do not believe you.

but if you really feel the way you indicate above,
then please do everyone a favor and take a healthy break from your
computer and find a little side hobby; this level of obsession just
isn't healthy, and frankly, you jsut come across as mean sprirted, even
^^^^
^^^^
Uh oh.

All I'm asking


I care not one whit about what you would like.

it's not someone intentionally trying
to piss everyone off


How do you know?

I sure looks that way to me...
 
R

Randal L. Schwartz

Eckstein> Christ all mighty. Why do you always have to jump on people
Eckstein> like this?

In real life, people queue up for lines, because "that's the right thing
to do". However, on this newsgroup, sometimes people mob up, instead
of standing in line.

Is standing in line a "natural" action? Not really. It's a learned
behavior.

If everyone "stood in line" here, there'd be ZERO posts on netiquette.
But as it turns out, a lot of people here "mob" instead. And that's
when the "line police" come out.

Yeah, we wish the line police could be using their time to help people.
But apparently, some people haven't learned to stand in line.

That's it. Don't fret about it.

If you're standing in line, you won't get yelled at. If you aren't,
expect a nasty-gram from the dozen people people on this channel
WHO REALLY CARE or else they wouldn't spend their time doing it.

Stand in line. Is it inherent? no. Is it the right thing to do? yes.
 
A

Alan J. Flavell

Christ all mighty. Why do you always have to jump on people like this?
[...]

Oh dear. You've just put on record that you're ostentatiously
ignorant of the benefits of working together with the group in
accordance with its social norms (which are basically the rules of any
big-8 usenet group, anyway). That tells me I'm going to have a better
life by putting you in the killfile, and I'd dare suspect that I'm not
the only one (except that most won't bother to mention it to you).
All I'm asking is to jsut calm down
_______________________^^^^

hmmm.
 
A

Anno Siegel

Alan J. Flavell said:
Christ all mighty. Why do you always have to jump on people like this?
[...]

Oh dear. You've just put on record that you're ostentatiously
ignorant of the benefits of working together with the group in
accordance with its social norms (which are basically the rules of any
big-8 usenet group, anyway). That tells me I'm going to have a better
life by putting you in the killfile, and I'd dare suspect that I'm not
the only one (except that most won't bother to mention it to you).
All I'm asking is to jsut calm down
_______________________^^^^

Now I'm waiting for someone else to chime in and argue that it proves
nothing, and don't you ever misspell a word, and it's jsut a typo.

Anno
 
A

A. Sinan Unur

Sinan, what is with this attitude?

There is no attitude. The statement above is a statement of fact. It's
like saying: "You just stepped on my foot, and your are now throwing
food at my face. Stop doing that".
Perl has always had a rather symbiotic realtionship with unix,

The original question was not really about Unix, but programming in a
particular shell.
Thee is no need ot be so harsh when you encounter them.

I wasn't harsh. I answered the question. But, when the person keeps
making off-topic posts, I think it is kinder to warn them than not.
Just step back a moment, relax, take a vaction,

Actually, I read this group to relax. When I find a question that helps
me learn new stuff, I feel a sense of accomplishment.
do something to get your mind off computers,

My mind is off computers for most of the day.
too long if you're getting worked up about a bloody news group posting

I am not sure who is getting worked up here.
liek this.

So worked up that
I really don't mean to appear rude or callas,

he is thinking he could be an opera singer?

(See: said:
or demeaning

Far from demeaning, you are very entertaining.
Like is too short, and not to mention it's jsut better

Huh?

Sinan
 
C

ced

ahh.. but of course.. my apologies...

learning too many new thigns and confusing them..

it should be

if [ $VALUE -eq 1 ]
....

Thanks again for your help.. w/that change, I am also able to process
the value extracted from the perl script..

Just a couple more questions about perl in general..

- regarding the above issue, what is better practive... to capture the
output in this way from perl or use the return code from perl for my
purpose?

I would capture the output. For one thing, it is not clear to me that the
value you wish to relay will always fit into whatever integer range it is
that your system allows for return values. For another thing, if your
program fails for some unforeseen reason, you probably don't want that
failure-inspired return value to be interpreted as if it were an answer,
rather than the non-answer which it is.

I agree totally. Also, your shell script should probably explicity
check
$? after the backtick call to trap error conditions. I'm not sure how
the
shell handles backticks but if there's an implicit fork that failed,
you'd
probably want to know that there was an internal error. Even if the
error was Perl's, you'll only get that from $? ( assuming a 'die', eg.,
what if the initial DBI connect failed for example).

If checking $? seems like a pain, you could overload the output
returned
by Perl and parse its value. The output could for example contain
"FATAL: DBI connect failed: ..." but you'd need to parse that in the
shell.
Ugh.

Much better in my opinion:

VALUE=`/path/to/foo.pl`;
if [ $? != 0 ]; then
....
fi

At some point, I'd look really hard to see if the excellent suggestion
to drop
the shell script entirely and go all Perl was a possibility.

hth,
 

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
474,176
Messages
2,570,950
Members
47,503
Latest member
supremedee

Latest Threads

Top