Re: MS SQL geek wants to jump ship, plz help on first Perl script



Henry Law wrote:
Paul Lalli wrote:

Same thing for warn() as for die() above. The line numbers are only
printed if you omit a terminating newline in your error/warning
message.

My total failure to know that is an interesting comment on how languages
are learnt. I don't think I've ever read up on "die"; early in the time
I was learning I saw it used, grasped the basic concept, and have coded
it the same way ever since; same for "warn". That the presence of a
terminating new line has an effect on how "die" and "warn" actually
behave isn't intuitive and I've never have thought to find out.

I guess I too could have done with reading the camel more carefully,
this is news to me also. :-)

From page 701, 3rd edition of The Camel, regarding die():

"If the final value of LIST does not end in a newline (and you're not
passing an exception object), the current script filename, line number
and input line number (if any) are appended to the message, as well as a
newline."

At the risk of sounding like I do part-time sales for O'Reilly, Henry, I
highly recommend that you get hold of a copy of Perl Best Practices by
Damian Conway. Mine arrived last week and I have not been able to put it
down. A lot of the advise given I find I already do, but the book is
literally filled with useful information like the above that has been
essentially bullet pointed for you with meaningful reasons as to why.

--
David Pea*** - davidjpea***@xxxxxxxx
.