ampersand subroutine

N

News123

Nathan said:
If it's Perl code you're talking about, why not use something better
suited for that, if you might have code/routines/comments that could
create problems? exit() isn't the best method for preventing that
problem, as much as I agree that it's not a bad idea for the same
reasons, exit() isn't what I'd suggest.
What other command stops execution of a perl script non fatally and
without error?

For me this is exit() or exit(0)

For me exit() is the promise to the reader, that the script ends here.

What would you suggest as clearer less confusing method to indicate,
that one hasn't to look for any further top code snippets?
 
N

Nathan Keel

Uri said:
NK> If it's Perl code you're talking about, why not use something
NK> better suited for that, if you might have code/routines/comments
NK> that could create problems? exit() isn't the best method for
NK> preventing that problem, as much as I agree that it's not a bad
NK> idea for the same reasons, exit() isn't what I'd suggest.

huh?? use what is better? exit is to exit and also tell the reader
than no more main line code will be executed. it serves a dual
purpose. not much else can do that.

uri

How about __END__?
 
N

Nathan Keel

News123 said:
What other command stops execution of a perl script non fatally and
without error?

For me this is exit() or exit(0)

For me exit() is the promise to the reader, that the script ends here.

What would you suggest as clearer less confusing method to indicate,
that one hasn't to look for any further top code snippets?


How about __END__?
 
U

Uri Guttman

NK> If it's Perl code you're talking about, why not use something
NK> better suited for that, if you might have code/routines/comments
NK> that could create problems? exit() isn't the best method for
NK> preventing that problem, as much as I agree that it's not a bad
NK> idea for the same reasons, exit() isn't what I'd suggest.
NK> How about __END__?

you fell into the trap. what about the subs you want to put after the
top level main line code? if they are after __END__ they won't be
parsed. the issue is to notify the reader than main line code has ended
and to explicitly return a value to end the process. exit() is correct
here.

uri
 
N

Nathan Keel

Uri said:
NK> If it's Perl code you're talking about, why not use something
NK> better suited for that, if you might have code/routines/comments
NK> that could create problems? exit() isn't the best method for
NK> preventing that problem, as much as I agree that it's not a bad
NK> idea for the same reasons, exit() isn't what I'd suggest.

NK> How about __END__?

you fell into the trap.

Not really.
what about the subs you want to put after the
top level main line code?

You said you put an exit() at the end in case any comments or code you
didn't want executed followed it. In fact, invalid syntax following an
exit will still fail anyway. Which did you mean then?
if they are after __END__ they won't be
parsed.

Yes, that is correct, so I must have misread your reasoning for using
exit()? Why do you use exit again?
the issue is to notify the reader than main line code has
ended and to explicitly return a value to end the process. exit() is
correct here.

How about a comment that that's the end, or no further code, or? I get
what you mean about they know anything that follows is sub routines,
comments, documentation, etc., so I guess that's what you meant then.
I'd just throw in a commment if I felt it was needed, but I'm not
claiming your method isn't fine, I just don't think it's necessary.
 
U

Uri Guttman

NK> If it's Perl code you're talking about, why not use something
NK> better suited for that, if you might have code/routines/comments
NK> that could create problems? exit() isn't the best method for
NK> preventing that problem, as much as I agree that it's not a bad
NK> idea for the same reasons, exit() isn't what I'd suggest.
NK> Not really.

yes you did. sorry to tell you that.

NK> You said you put an exit() at the end in case any comments or code you
NK> didn't want executed followed it. In fact, invalid syntax following an
NK> exit will still fail anyway. Which did you mean then?

i said no more mainline code will be executed after the exit(). the subs
are to be put after the exit. they are not mainline code. learn the difference.

NK> Yes, that is correct, so I must have misread your reasoning for using
NK> exit()? Why do you use exit again?

read my posts again.

NK> How about a comment that that's the end, or no further code, or?
NK> I get what you mean about they know anything that follows is sub
NK> routines, comments, documentation, etc., so I guess that's what
NK> you meant then. I'd just throw in a commment if I felt it was
NK> needed, but I'm not claiming your method isn't fine, I just don't
NK> think it's necessary.

comments can lie. i said that before. code doesn't lie.

uri
 
N

Nathan Keel

Uri said:
NK> If it's Perl code you're talking about, why not use something
NK> better suited for that, if you might have code/routines/comments
NK> that could create problems? exit() isn't the best method for
NK> preventing that problem, as much as I agree that it's not a bad
NK> idea for the same reasons, exit() isn't what I'd suggest.

NK> Not really.

yes you did. sorry to tell you that.

Oh come on. Read what I said. See below and stop being such a jerk.
NK> You said you put an exit() at the end in case any comments or
code you
NK> didn't want executed followed it. In fact, invalid syntax
following an
NK> exit will still fail anyway. Which did you mean then?

i said no more mainline code will be executed after the exit(). the
subs are to be put after the exit. they are not mainline code. learn
the difference.

I know the difference, enough with the attitude already.

Here's what YOU said:

"i disagree. in my top level programs i always put an explicit exit()
after the main line code ends. comments can lie and there could be left
over code below that would execute that shouldn't."

Those are YOUR words. "left over code that could execute that
shouldn't", and your solution is "exit" by default?

NK> Yes, that is correct, so I must have misread your reasoning for
using
NK> exit()? Why do you use exit again?

read my posts again.

I did, you should do the same and not think any time someone discusses
something with you that they are trying to fight with you.
NK> How about a comment that that's the end, or no further code, or?
NK> I get what you mean about they know anything that follows is sub
NK> routines, comments, documentation, etc., so I guess that's what
NK> you meant then. I'd just throw in a commment if I felt it was
NK> needed, but I'm not claiming your method isn't fine, I just
don't NK> think it's necessary.

comments can lie. i said that before. code doesn't lie.

It's unfortunate that you'll have random lines of code that could
execute that you don't want, and your solution is to use exit. Your
choice, doesn't affect me, so by all means, go ahead... I just don't
agree (big deal).
 
N

News123

Hi Nathan,

Jumping in the midlle of a thread without reading the initial messages
is not always optimal.

This was my initial post starting the discussion about exit():
For 99% of perl code I would give following advise:

Don't use ampersand for calling functions
Don't use function prototypes
Don't declare functions separately before their definition.
Group your function definitions either roughly bottom up at the
beginning of your script or group them all top down at the end of your
script.
In the latter case I'd suggest an explicit exit() statement before the
function definitions in order to signal to a person reading the code,
that no more code outside of function definitions will follow (except of
course for potential BEGIN blocks)

exit() is the promise, that no more top level code will follow.

__END__ will not work in above scenario

comments may be wrong.

As so often: coding style especially in the perl community varies a lot.


bye

N
 
N

Nathan Keel

News123 said:
Hi Nathan,

Jumping in the midlle of a thread without reading the initial messages
is not always optimal.

Agreed, and top posting sucks.
This was my initial post starting the discussion about exit():
snip what I have already read.
exit() is the promise, that no more top level code will follow.

And it shouldn't anyway.
__END__ will not work in above scenario
True.

comments may be wrong.

Maybe, but irrelevant.
As so often: coding style especially in the perl community varies a
lot.
Indeed.


bye

Bye.
 
U

Uri Guttman

NK> It's unfortunate that you'll have random lines of code that could
NK> execute that you don't want, and your solution is to use exit. Your
NK> choice, doesn't affect me, so by all means, go ahead... I just don't
NK> agree (big deal).

you don't have a solution. __END__ is not one. keep barking and maybe
someone will pay attention to you. your perl skills don't warrant it.

as for your not agreeing with me, i will file that into /dev/null where
it belongs. yes, that is another insult. you seem to attract them. note
that others don't. seems to me you are the cause.

uri
 
N

Nathan Keel

Uri said:
NK> It's unfortunate that you'll have random lines of code that
could
NK> execute that you don't want, and your solution is to use exit.
Your NK> choice, doesn't affect me, so by all means, go ahead... I
just don't NK> agree (big deal).

you don't have a solution.

I do, we just disagree.
__END__ is not one.

It can be, if you're worried about comments having code that will
potentially run that you don't want to run.
keep barking and maybe
someone will pay attention to you.

You're a dick, you always are a dick here to anyone that doesn't
mindlessly agree with you.
your perl skills don't warrant it.

A true dick thing to say. My skills have nothing to do with disagreeing
with you (oh God, AGAIN). Grow up.
as for your not agreeing with me, i will file that into /dev/null
where it belongs.

Yes, you've said that before, but you seem to enjoy being a dick and
fighting with people. Learn to use your shift key while you're at it.
yes, that is another insult.

Yes, that's all you seem to do.
you seem to attract
them.

You seem to think more highly of yourself than you are deserving of.
You just can't deal with the fact I don't put up with your bullshit.
You're not that important to me, I've got to be honest. I'm just
posting here, and you being an arrogant twat doesn't really mean dick.
note that others don't.

I guess that explains the literally thousands of archived posts of you
being an arrogant prick to people any time that discuss something and
don't agree with your stubborn methods. Who really cares? Get thicker
skin, for God's sake!
seems to me you are the cause.

Yes, I'm aware you think everyone else but YOU have the attitude
problem. I also realize that you're such a fucking prick that you
can't help yourself and you could never accept that anyone but you
could be right about anything, including their own feelings about a
topic. In closing, I don't give a damn who you think you are and how
you think you can treat people, you're a piece of shit in my opinion.

nal cake.
 
U

Uri Guttman

NK> Maybe, but irrelevant.

your views on what is irrelevent is what makes your comments
irrelevent. try to listen to what others who know more than you. but you
won't as you have to have your say.

NK> Indeed.

and some styles are inherently better than others. just because some
code like c or worse doesn't make it good perl. check out this for some
horrible coding style. of course you will probably like it:

http://search.cpan.org/~domizio/

uri
 
U

Uri Guttman

NK> I do, we just disagree.

you can disagree and still be wrong. see creationists and ID types. or
cheney.

NK> It can be, if you're worried about comments having code that will
NK> potentially run that you don't want to run.

comments having code??

NK> You're a dick, you always are a dick here to anyone that doesn't
NK> mindlessly agree with you.

nope. i amnot a dick. i am an uri. and i have no issue with reasonable
discourse. you see incapable of it because you never defend anything
with facts, logic or deep understanding of perl.

NK> A true dick thing to say. My skills have nothing to do with
NK> disagreeing with you (oh God, AGAIN). Grow up.

EWWW!! i will switch to python now just because of that.

NK> Yes, you've said that before, but you seem to enjoy being a dick
NK> and fighting with people. Learn to use your shift key while
NK> you're at it.

and learn to use the delete key.

NK> Yes, that's all you seem to do.

nope. i help people who help themselves. plenty of proof of that. i
don't tolerate fools and you keep proving yourself to be one.

NK> You seem to think more highly of yourself than you are deserving
NK> of. You just can't deal with the fact I don't put up with your
NK> bullshit. You're not that important to me, I've got to be honest.
NK> I'm just posting here, and you being an arrogant twat doesn't
NK> really mean dick.

you don't put up with much. like studying perl. but don't worry, i won't
ever have to try to place you in a perl job.

NK> I guess that explains the literally thousands of archived posts of
NK> you being an arrogant prick to people any time that discuss
NK> something and don't agree with your stubborn methods. Who really
NK> cares? Get thicker skin, for God's sake!

my skin is as thick as it needs to be. you are the one who seems to be
prickly. but you won't detect that. too bad.

NK> Yes, I'm aware you think everyone else but YOU have the attitude
NK> problem. I also realize that you're such a fucking prick that you
NK> can't help yourself and you could never accept that anyone but you
NK> could be right about anything, including their own feelings about
NK> a topic. In closing, I don't give a damn who you think you are
NK> and how you think you can treat people, you're a piece of shit in
NK> my opinion.

ooohh! cursing now. the last refuge of the incompetent.i have yet to
spew vulgar invective at you as you aren't worthy of such bile. simple
off-hand comments are plenty of trigger for you. try learning some more
perl soon. it may cure your attitude.

have fun!

and finally, exit() is the correct and inarguable solution to marking
the end of executable code in a top level perl script. let's start to
discuss explicit or implicit return values next!

uri
 
A

A. Sinan Unur

check out this for some horrible coding style. of course you will
probably like it:

http://search.cpan.org/~domizio/

Oh my.

I know it makes no difference to perl but I don't think I could get used
to this:

; my $exec = \&CGI::Builder::_::exec

; sub CGI::Builder::_::exec
{ my $s = shift
; my $h = shift
; Class::Util::gather { $s->$_(@_) } '&OH_'.$h
, $s->overrun_handler_map($h)
}



--
A. Sinan Unur <[email protected]>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/
 
N

Nathan Keel

Uri said:
NK> I do, we just disagree.

you can disagree and still be wrong.

Of course, and YOU need to realize that as well! For once in your usenet
life.
see creationists and ID types. or
cheney.

Off topic banter.
NK> It can be, if you're worried about comments having code that
will NK> potentially run that you don't want to run.

comments having code??

What you said, not what I said.
NK> You're a dick, you always are a dick here to anyone that doesn't
NK> mindlessly agree with you.

nope. i amnot a dick.

Yes, you are.
i am an uri (nal cake).
and i have no issue with reasonable
discourse.

I guess that explains why you snap at so many people with rude,
inconsiderate and arrogant attacks so often?

you see incapable of it because you never defend anything
with facts, logic or deep understanding of perl.

Actually, that's just what YOU *always* claim when you don't agree with
someone. You've once again provided nothing of substance to dispute
it.
NK> A true dick thing to say. My skills have nothing to do with
NK> disagreeing with you (oh God, AGAIN). Grow up.

EWWW!! i will switch to python now just because of that.

I wish.
NK> Yes, you've said that before, but you seem to enjoy being a dick
NK> and fighting with people. Learn to use your shift key while
NK> you're at it.

and learn to use the delete key.

Uh huh, you say such things, but you can't HELP yourself but to reply
and argue.
NK> Yes, that's all you seem to do.

nope.

Yes, in fact.
i help people who help themselves.

Irrelevant, I didn't ask for your help, and I don't need your help.
plenty of proof of that.

You sometimes help people, only because it's self serving, but you're
also a dick to a lot of people without any reason. If you have a
reason, it's all fair game, but you rarely do... because you're a dick.
i
don't tolerate fools

How do you live with yourself?
and you keep proving yourself to be one.

Not really, you just don't like me because I don't tolerate your shit,
so of course you'll make such claims.
NK> You seem to think more highly of yourself than you are deserving
NK> of. You just can't deal with the fact I don't put up with your
NK> bullshit. You're not that important to me, I've got to be
honest. NK> I'm just posting here, and you being an arrogant twat
doesn't NK> really mean dick.

you don't put up with much.

I put up with plenty, until some asshole like you shows a persistent
pattern of arrogance.
like studying perl.

I'm sure you do, but that's irrelevant to your shitty attitude on this
group towards a lot of people.
but don't worry,

Why would you worry? You think too highly of yourself to ever worry
about anything but how you think any discussion on usenet means you
have to win some fight with someone.
i
won't ever have to try to place you in a perl job.

You've said that before, which is just another pathetic means you try
and act like you're a big shot. In fact, you're a dick. Like I said
last time, I would never WANT you to place me in a job, I would NEVE
seek your help. Your attempts to act like you are a god here are
ridiculous and pathetic.
NK> I guess that explains the literally thousands of archived posts
of NK> you being an arrogant prick to people any time that discuss
NK> something and don't agree with your stubborn methods. Who
really
NK> cares? Get thicker skin, for God's sake!

my skin is as thick as it needs to be.

Apparently not.
you are the one who seems to be
prickly.

I suppose some arrogant **** like you would believe that when someone
doesn't put up with their shitty attitude, that it's THAT person whom
has the problem. I'm simply reacting to the way you treat people. I
don't give a damn who you think you are, you're not even half the man
you wish you were.
but you won't detect that. too bad.

Yes, it's too bad you don't own a mirror. At least I admit I can be
wrong, and I can be a jerk, but that's your entire existence. Don't
worry, I'm sure other long time members here will back you up and say
I'm the troll (like I care). To hell with any sarcastic, petty arrogant
prick that wants to jump on the bandwagon.
NK> Yes, I'm aware you think everyone else but YOU have the attitude
NK> problem. I also realize that you're such a fucking prick that
you NK> can't help yourself and you could never accept that anyone
but you NK> could be right about anything, including their own
feelings about
NK> a topic. In closing, I don't give a damn who you think you are
NK> and how you think you can treat people, you're a piece of shit
in NK> my opinion.

ooohh! cursing now.

Yes, it's pretty scary.
the last refuge of the incompetent.

Not really, since I'm just stating the facts that you are what you are.
You'll say anything to try and win your usenet fight.
i have yet to
spew vulgar invective at you as you aren't worthy of such bile.

Irrelevant. Unlike you, I don't base my opinions and claims of the
person you are on such trivial things of no consqeuence.
simple
off-hand comments are plenty of trigger for you.

You could easily be speaking of yourself there. I'm not emotional about
it, I'm just calling it how I see it.
try learning some
more perl soon.

Again, you act like you aren't being lowly, yet you will never pass up a
chance to try and insult someone. You have no idea what I do or do not
know, and I'm not the only one that disagreed with you (some of those
people are known to be people that are just as, or more experienced
than even the great uri(nal cake).
it may cure your attitude.

My attitude has nothing to do with Perl, it has to do with your shitty
attitude.
have fun!

You leave and we'll see what happens. Oh, that's never going to happen,
you think you run this group. You don't.
and finally, exit() is the correct and inarguable solution to marking
the end of executable code in a top level perl script.

It's perfectly fine, but it's not the most appropriate and your excuses
about WHY you use it, are pathetic (and yet you want to claim you're so
much more of an expert than anyone else).
let's start to
discuss explicit or implicit return values next!

No need.

nal cake.
 
N

Nathan Keel

Tad said:
Huh, that's funny.

I'd thought the same of you (Nathan).

Nothing funny about it. I have no problem with people thinking the same
as me, and I'm not the only one that thinks that about some members
here. It sucks when the regulars have the attitude like anyone that's
not a regular is the enemy and are the targets of insults. Besides, I
never denied I wouldn't give an attitude to someone that's being a
dick.

Well, I would, but then I wouldn't see your pretty (font) face.

Indeed you'll agree with "uri", since he's a long time member here, as
you are. Anyone doesn't put up with either of your guy's shit and
you're both foaming at the mouth ready to claim this and that about the
person. Why not consider WHY someone reacts the way they do and either
move on, take it with a grain of salt, or at least have the common
sense to understand why they copped an attitude in response. Anything
else is nothing more than arrogance.
What would be the point of that?

I agree.
Even a fucking prick would know that explicit return values rock!

Okay then...
 
U

Uri Guttman

NK> nal cake.

wow! high school attempts at humor. i am shocked! i say SHOCKED that you
went there. now begone with ye and get thee to python. they need
humorists like you since high school humor is a step up from where they
are.

in the mean time, keep your trap shut. you won't win as you have nothing
to stand on. but you will reply as you are commanded by the crazy voices
inside your skull. keep on listening to them. and i have outlasted
moronzillas and more. you aren't even a speck of sand on this perly
beach.

have fun being you!

and one more thing: exit( 'keel' ) ;

uri
 
N

Nathan Keel

Uri said:
NK> Maybe, but irrelevant.

your views on what is irrelevent is what makes your comments
irrelevent.

Spoken like a person suffering from truly biased and unearned arrogance.
try to listen to what others who know more than you.

The problem here, is that you think you know more than everyone else,
even if you are wrong.
but
you won't as you have to have your say.

Are you speaking for yourself again? Because that completely applies to
you.
NK> Indeed.

and some styles are inherently better than others.

I agree.
just because some
code like c or worse doesn't make it good perl.

Of course not. I never said otherwise.
check out this for
some horrible coding style.

I need not look, I've already agreed. You just can't accept that your
style isn't agreed to be the best by everyone else. I even corrected
myself a few posts earlier in this thread when I saw that you
elaborated on. Instead of just acknowledging that I therefore agreed
in that aspect, you chose to insult. You enjoy egging people on, and
you're so damned arrogant that you would rather fight with someone than
to find common ground. Why? Because you think you're so much better
than everyone else.
of course you will probably like it:

Oh, you're so funny. You should take that bit out on the road.
 
N

Nathan Keel

Uri said:
NK> nal cake.

wow! high school attempts at humor.

Sorry that I'm not an old butter jerk, like you. Wait, no I'm not! :)

...snip...
in the mean time, keep your trap shut.

**** you, you aren't my boss. I know that's difficult for you to
accept, but you don't control everyone and you're not always right.
Not that I care if you can't accept that, until you fight with me for
no good reason. You're just going to have to accept that I won't put up
with your attempts to bully me. You're a joke.
you won't win as you have
nothing to stand on.

Just saying such things out of arrogance doesn't make them true. I
believe the same about you. However, unlike you, I don't make claims
because I'm so arrogant that I can't stand to be wrong.
but you will reply as you are commanded by the
crazy voices inside your skull.

Is that what motivates you to respond? It's sure not why I do, so maybe
this puzzle is starting to fit together and I'm starting to understand
why you can't help yourself. Don't worry, I get it. If I reply, I
have a mental disorder, but you're free to reply and egg people on,
because you're immune to your own rules and sarasm. Yawn.
keep on listening to them. and i have
outlasted moronzillas and more. you aren't even a speck of sand on
this perly beach.

Yes, yes, yes... I know you think you're special and anyone else is
insignificant. Thank God you have no actual power to do anything in
this world.
have fun being you!

I do. You seem miserable though, which might explain your attitude.
and one more thing: exit( 'keel' ) ;

Yawn.
 

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,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top