[OT] Re: First and second rate programmers

2002-06-05 Thread John Brooking

On Wednesday, June 5, 2002, at 08:40 , Ovid wrote:
[..]
>
> First-rate mathematicians want to hang around
first-rate
> mathematicians.  Second-rate mathematicians want
to hang
> around third-rate mathematicians.
>
> The reason for that is left as an exercise for the
reader :)

   So, ignoring for the moment drieux's eloquent case
for calling this a bogus distinction (if I understood
what he said, which isn't always easy), if we assume
for the sake of argument that a newbie is a third-rate
Perl programmer (although granted s/he may be first
rate in another pond), what does that make you
experienced people hanging around with us? :-)  
[Besides wonderful and nice people, of course?]
   
And then drieux said:
> But what if 12 years in the industry helped me
better understand how
> frighteningly silly that Degree in Computer Science
really was to begin 
> with?

  Au contraire. I know it is fashionable to wonder
what all that education was good for, but after about
10 years myself, I find that I have repeatedly been
able to pick up new languages and packages at a faster
rate than many of my peers in the corporate IT world,
and I credit the value of the more conceptually
abstract 4-year CS degree as compared to the very
concrete and limited 2-year business programming
degree of some of my colleagues. Having learned
abstractly about algorithms, operating system
internals, compilers, and so on may not be something I
use everyday (not to even mention functional
programming and CS theory, much of which I've no doubt
forgotten), but it's given me a higher framework in
which to categorize and relate new knowledge, which is
what learning is all about. The tradeoff is that I
actually graduated knowing nothing about how to use
any particular commercial databases, for instance, but
I knew about tree structures and hash tables, and once
you know the concepts and theory, it's easy to pick up
specific commercial implementations.

  But then, I never went to grad school or into
academia, so perhaps I'm really just one of the
middle-tier people myself! :-)

> Or would this be the wrong place to propose that if
only Larry Wall
> had been a team player and been willing to do what
needed to be done
> to make things in sed/awk more ellegant - and be a
'real first water'
> programmer rather than someone out to impress the
3rd tier wankers...
> 
> But the same would also apply to the fact that those
CERN wankers
> really should have been content with telnet and ftp
- since clearly
> this whole skank with the lame, lame, lame HTTP
protocol was merely
> there because those were so clearly lame types who
were never going
> to be 'real programmers'..

Hey, for that matter, what was so wrong with assembly
language?  ;-)

- John

=
"Now it's over, I'm dead, and I haven't done anything that I want; or, I'm still 
alive, and there's nothing I want to do." - They Might Be Giants, http://www.tmbg.com

__
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Perl/CGI mysql book

2002-06-05 Thread Gregory Bertz

Oreilly "Programming the Perl DBI" is a good one
also "Managing and Using MySQL" also an Oreilly book...

Maureen E Fischer wrote:

> I am writing my first CGI application and after analysis of the data
> structure that is required I determined that a DBM file would not be
> sufficient.  Mysql was suggested to me.  Unfortunately I could not find
> A book that seemed based on Perl and sql.  Everything I found connected
> Mysql to PHP -- which I know nothing about.  Since I am new to almost
> Everyting except some ancient languages and systems I didn't want to
> Bite off yet another learning experience just yet.  I did find and
> purchase "Writing CGI Applications with Perl", which did have a chapter
> on sql, but since I am having trouble with my first connect I think I
> will need more
> Help then the brief chapter can give me.  Any suggestion would
> Be very welcome.
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Perl/CGI mysql book

2002-06-05 Thread charles

My personal opinion is that cutom databases are very easy to create in a
perl script and usually run faster and more efficient than cumbersome
packages. there are many perl freebies out there to start you in the right
direction and will also serve as a better learning tool. basically a
database is simply a function that takes input, formats it, opens a disk
file, and write the data to a disk file. In perl this can be done quite
easily. It still amazes me how all of these cumbersome packages evry make
it to the marketplace.

If you tell me what you are trying to do I can send you sections of code
that will make it easy.

Charles


Maureen E Fischer wrote:

> I am writing my first CGI application and after analysis of the data
> structure that is required I determined that a DBM file would not be
> sufficient.  Mysql was suggested to me.  Unfortunately I could not find
> A book that seemed based on Perl and sql.  Everything I found connected
> Mysql to PHP -- which I know nothing about.  Since I am new to almost
> Everyting except some ancient languages and systems I didn't want to
> Bite off yet another learning experience just yet.  I did find and
> purchase "Writing CGI Applications with Perl", which did have a chapter
> on sql, but since I am having trouble with my first connect I think I
> will need more
> Help then the brief chapter can give me.  Any suggestion would
> Be very welcome.
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Perl/CGI Website Ideas

2002-06-05 Thread John Pitchko

Yes thank you, those were/are the books I am working through at work. I guess, to be 
more specific, I am not looking to the syntax of it, but more of some design 
techniques and site authoring guidelines for Perl/CGI websites.

>>> "Scot Robnett" <[EMAIL PROTECTED]> 06/05/02 02:49pm >>>
The best place to start is with the books "Learning Perl" and "CGI
Programming with Perl" (you can find them on www.oreilly.com).

Check out this site, www.pm.org to find a Perl Mongers user group near you.

You can see what other people have done (so you can do it better) at sites
like

http://www.cgi-resources.com/Programs_and_Scripts/Perl/ and

http://www.scriptsearch.com/Perl/Scripts_and_Programs/

And stay on this list, of course. :)

Scot Robnett
inSite Internet Solutions
[EMAIL PROTECTED]
[EMAIL PROTECTED]







-Original Message-
From: John Pitchko [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 05, 2002 3:17 PM
To: [EMAIL PROTECTED]
Subject: Perl/CGI Website Ideas


Hello,

I am somewhat of a newbie to Perl and CGI. I have written several scripts
for use on a corporate website with great success. However, I am interested
in designing an entire website with Perl CGI, but I do not really know where
to begin or any inspiration for it.

Does anyone know where I can find some information about designing websites
with Perl CGI?

Thanks,
John Pitchko
Saskatchewan Government Insurance

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.368 / Virus Database: 204 - Release Date: 5/29/2002

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.368 / Virus Database: 204 - Release Date: 5/29/2002



Re: First and second rate programmers

2002-06-05 Thread charles

I don't think that "use strict" is necessary in a finished script. I think
anything that takes up machine cycles and isn't needed in the finished script
should remain mobile and this is probably the main reason they keep it
mobileyou might say "but how many macine cycles could it possibly eat up"
when you should really say "why not keep it an option".

good practice is to make things available that are not absolutely needed as
mobile functions.

Charles

Jake wrote:

> Im a bit worried that a few of my statements have been misconstrued, and I was
> concerned that would happen when I first posted.  Let me try to clarify - and
> I should also preface this with I am primarily a C/C++ programmer (I'm
> addicted to the Qt toolkit) who really uses perl only when he needs it.
>
> I was not questioning whether one should or shouldn't "use strict".  In the
> brief time I have spent coding in perl, I have learned the hard way how
> useful it is.
>
> my question is why the basic functionality of "use strict" isnt directly built
> into the perl compiler/interpreter?  Why, for instance, isnt it simply
> required by perl to use "my" or "our" or whatever when one first introduces a
> variable?  Sure, not using strict may save (advanced?) programmers a few
> keystrokes, but is that really the only reason?
>
> I'm sure that somewhere along the line, the designers of perl had to have at
> least considered this...and I'm also sure that they had very good reasons for
> having "strict" remain a module that one can choose to use or not use.
> I would simply like to know their reasons.
>
> As for the perlmonks, as far as I'm concerned, that is one of the best
> computer language websites/cultures that I have come across.  Almost
> everything I know about perl has come from either that site or this list, and
> I admire the fact that you and your colleagues are willing to hang out in
> newsgroups like this and patiently answer questions from hard headed newbies
> like myself :)
>
> As for your remark about quality leading to correctness, I couldn't agree
> more.  Jeez, I've read "Zen and the Art of Motorcycle Maintanance" 6 times.
>
> Respectfully,
> Jake
>
> On Wednesday 05 June 2002 11:40 am, Ovid wrote:
> > To all:
> >
> > Okay, there have been a few comments about the merits of using strict, but
> > I thought I would toss up a meta-argument.
> >
> > It's true that posters who post code without "strict" are generally
> > reminded by several replies that they should have used strict, but the
> > respondents also usually try to answer the question. Personally, I would
> > never think of dropping a note to Lincoln Stein for not using strict in
> > CGI.pm or Damian Conway for not using strict in anything.  People who are
> > reminded to use strict are usually (not always) people for whom strict
> > would be an enormous benefit.
> >
> > As for Perlmonks (brought up in one reply), the ones who have been around
> > for a while are usually very concerned not just about correctness (a
> > program does what it should and no more), but also about quality (a program
> > that works can still be an unmaintainable piece of crud).  So, when I see
> > someone who failed to use strict and then typed $recieved, I'll point out
> > the misspelling, but I'll also point out that using strict would have
> > caught that error *at compile time*, rather than have them pull their hair
> > out for hours trying to figure out what's buggy.
> >
> > Quality, thus, tends to lead to correctness.  I could go on for hours as to
> > why this is the case, but really, who *doesn't* want correct programs?
> >
> > I strongly recommend to every Perl programmer that they should hang out at
> > Perlmonks.  Why? Because of a saying amongst mathematicians (which applies
> > very strongly to programmers, too):
> >
> > First-rate mathematicians want to hang around first-rate
> > mathematicians.  Second-rate mathematicians want to hang
> > around third-rate mathematicians.
> >
> > The reason for that is left as an exercise for the reader :)
> >
> > Cheers,
> > Curtis "Ovid" Poe
> >
> > =
> > "Ovid" on http://www.perlmonks.org/
> > Someone asked me how to count to 10 in Perl:
> > push@A,$_ for reverse q.e...q.n.;for(@A){$_=unpack(q|c|,$_);@a=split//;
> > shift@a;shift@a if $a[$[]eq$[;$_=join q||,@a};print $_,$/for reverse @A
> >
> > __
> > Do You Yahoo!?
> > Yahoo! - Official partner of 2002 FIFA World Cup
> > http://fifaworldcup.yahoo.com
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Perl/CGI Website Ideas

2002-06-05 Thread Scot Robnett

The best place to start is with the books "Learning Perl" and "CGI
Programming with Perl" (you can find them on www.oreilly.com).

Check out this site, www.pm.org to find a Perl Mongers user group near you.

You can see what other people have done (so you can do it better) at sites
like

http://www.cgi-resources.com/Programs_and_Scripts/Perl/ and

http://www.scriptsearch.com/Perl/Scripts_and_Programs/

And stay on this list, of course. :)

Scot Robnett
inSite Internet Solutions
[EMAIL PROTECTED]
[EMAIL PROTECTED]







-Original Message-
From: John Pitchko [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 05, 2002 3:17 PM
To: [EMAIL PROTECTED]
Subject: Perl/CGI Website Ideas


Hello,

I am somewhat of a newbie to Perl and CGI. I have written several scripts
for use on a corporate website with great success. However, I am interested
in designing an entire website with Perl CGI, but I do not really know where
to begin or any inspiration for it.

Does anyone know where I can find some information about designing websites
with Perl CGI?

Thanks,
John Pitchko
Saskatchewan Government Insurance

---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.368 / Virus Database: 204 - Release Date: 5/29/2002

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.368 / Virus Database: 204 - Release Date: 5/29/2002


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Re[2]: Dynamically creating submit buttons

2002-06-05 Thread David T-G

Jason --

I don't have answers for your other questions, but ...

...and then Jason Ostrom said...
% 
...
% 
% I always start off my code by using CGI.pm object-oriented method:
% print $q->header( "text/html" ),
% $q->start_html( -title => "eDPS1 DS0 Monitor", -bgcolor => "#ff" ),
...
% $q->end_html;
% 
% But then can't use this format again, so have to "handroll" my HTML in
% the rest of the program because If I try to go back to using it, I get
% an error.

Isn't that because you just told the module to spit out the end of the
html page?  I'd think you'd save that part for when you're done writing
to the page!


HTH & HAND

:-D
-- 
David T-G  * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg!




msg05205/pgp0.pgp
Description: PGP signature


Perl/CGI Website Ideas

2002-06-05 Thread John Pitchko

Hello,

I am somewhat of a newbie to Perl and CGI. I have written several scripts for use on a 
corporate website with great success. However, I am interested in designing an entire 
website with Perl CGI, but I do not really know where to begin or any inspiration for 
it.

Does anyone know where I can find some information about designing websites with Perl 
CGI?

Thanks,
John Pitchko
Saskatchewan Government Insurance



Re: First and second rate programmers

2002-06-05 Thread charles

If your as lazy as I am and hate to type you wouldn't have this debate...I can't 
remember ever
writing a script that I started from scratch for years now. I almost always start with 
an existing
script cause 9 times out of 10 it has something in it I'll need anyway...and I am 
the cut 'n'
paste king of all times. I even have an array of smart key shortcuts on all of my 
computers.

But even still I don't think it would bug me to type in 2 little words :o)

Charles

PS I am know as the slopiest programmer in the world just for your edufication but I 
beleive it's the
end results that gets me by :o)

Ovid wrote:

> To all:
>
> Okay, there have been a few comments about the merits of using strict, but I thought 
>I would toss
> up a meta-argument.
>
> It's true that posters who post code without "strict" are generally reminded by 
>several replies
> that they should have used strict, but the respondents also usually try to answer 
>the question.
> Personally, I would never think of dropping a note to Lincoln Stein for not using 
>strict in CGI.pm
> or Damian Conway for not using strict in anything.  People who are reminded to use 
>strict are
> usually (not always) people for whom strict would be an enormous benefit.
>
> As for Perlmonks (brought up in one reply), the ones who have been around for a 
>while are usually
> very concerned not just about correctness (a program does what it should and no 
>more), but also
> about quality (a program that works can still be an unmaintainable piece of crud).  
>So, when I see
> someone who failed to use strict and then typed $recieved, I'll point out the 
>misspelling, but
> I'll also point out that using strict would have caught that error *at compile 
>time*, rather than
> have them pull their hair out for hours trying to figure out what's buggy.
>
> Quality, thus, tends to lead to correctness.  I could go on for hours as to why this 
>is the case,
> but really, who *doesn't* want correct programs?
>
> I strongly recommend to every Perl programmer that they should hang out at 
>Perlmonks.  Why?
> Because of a saying amongst mathematicians (which applies very strongly to 
>programmers, too):
>
> First-rate mathematicians want to hang around first-rate
> mathematicians.  Second-rate mathematicians want to hang
> around third-rate mathematicians.
>
> The reason for that is left as an exercise for the reader :)
>
> Cheers,
> Curtis "Ovid" Poe
>
> =
> "Ovid" on http://www.perlmonks.org/
> Someone asked me how to count to 10 in Perl:
> push@A,$_ for reverse q.e...q.n.;for(@A){$_=unpack(q|c|,$_);@a=split//;
> shift@a;shift@a if $a[$[]eq$[;$_=join q||,@a};print $_,$/for reverse @A
>
> __
> Do You Yahoo!?
> Yahoo! - Official partner of 2002 FIFA World Cup
> http://fifaworldcup.yahoo.com
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Capturing signal to cgi form

2002-06-05 Thread Bob Showalter

> -Original Message-
> From: Rob Roudebush [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 05, 2002 3:29 PM
> To: cgi cgi-list
> Subject: Capturing  signal to cgi form
> 
> 
> 
>  Does anyone know how to capture the carriage return to 
> prevent a user from accidentally submitting the form by 
> pressing 'return' before they actually finish completing the form?

Don't use a submit button; use a regular button instead.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re[2]: Dynamically creating submit buttons

2002-06-05 Thread Jason Ostrom

Bob,

Your comments did help.  My response below:

Bob Showalter> This is a "drill down" concept, right? Why not just use a simple link?
Bob Showalter> Details

I don't think this is just a "drill down" concept.  I need some way of
passing the variables between the pages so that a dynamically built
DBI/MySQL query is built.


Bob Showalter> If you want a form, I would use a Submit button. If you use a radio
Bob Showalter> button, you either need a Submit button somewhere else, or you need
Bob Showalter> to use onclick to submit the form, which seems counter-intuitive to
Bob Showalter> me. You'll have to name the submit button in such a way as to identify
Bob Showalter> the row selected.


Bob Showalter> Don't close the table row. Just put the form element inside a 

This is what I ended up doing, and it works great.


Bob Showalter> I don't see any evidence of CGI.pm being used in your code.
Bob Showalter> You're just handrolling your HTML, which is fine with me, but not
Bob Showalter> necessarily the "CGI.pm" way...

I always start off my code by using CGI.pm object-oriented method:
print $q->header( "text/html" ),
$q->start_html( -title => "eDPS1 DS0 Monitor", -bgcolor => "#ff" ),
$q->h2( "$jason DS0 Monitor" ),
$q->p("$tm" ),
$q->p("Select a T1 Below to see Status of individual DS0 Circuits" ),
$q->end_html;

But then can't use this format again, so have to "handroll" my HTML in
the rest of the program because If I try to go back to using it, I get
an error.

The last thing I want to do is become a target, but the only way to
show you what I am trying to do is show you the infant page:

http://monitor.natelnetwork.com/cgi-bin/ds0.cgi?rgrp=WORLDCOM

Two questions:
1.  Off to the right, what I am trying to do is be able to click one of
the rows, and then it will do a query for that "rls" column.  It will
then "expand" underneath that row and display all 24 of the element values
underneath whatever row I selected.  I can then hit a clear button,
and the 24 elements are collapsed so that you see only the first page
once again (so you can select another row instead of the previous one).

2.  How do you refresh the page and create the same dynamic content,
like say every 15 seconds?

I tried using:
print $q->header( -Refresh=>'15; URL=ds0.cgi' ),

But after the first time it re-freshes, it looses the 'Wworldcom'
variable / query string, and doesn't display any rows.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Capturing signal to cgi form

2002-06-05 Thread Rob Roudebush


 Does anyone know how to capture the carriage return to prevent a user from 
accidentally submitting the form by pressing 'return' before they actually finish 
completing the form?
-Rob



-
Do You Yahoo!?
Sign-up for Video Highlights of 2002 FIFA World Cup


Re: DBI newbabe

2002-06-05 Thread Dave K

There are many possible sources of error. Please include the actual error
you received, and you will get the help you need.
I have posted a few DBI/CGI scripts here
http://www.geocities.com/k2001evad/pindex.html
They are abit crude, but if you have MySql up and running on you machine and
the CGI, DBI and DBD::Mysql installed you should be able to use them.
HTH
"Sujitra Kungi" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> hi
>
> i want to connect mysql with perl , first i try
> ---
> #!c:\perl\bin\perl.exe
> print "Content-type: text/html\n\n";
> use Msql;
> 
> so i change to
> 
> #!c:\perl\bin\perl.exe
> print "Content-type: text/html\n\n";
> use DBI;
> 
> i still got error. do i need to install any module? i use perl on WIN.
> regards
> kung sujitra
>
> _
> Send and receive Hotmail on your mobile device: http://mobile.msn.com
>



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




creating a session

2002-06-05 Thread Hytham Shehab

 hi guys,
 i got the cgi::session module, but it is a front end to Apache::Session
 which is not available for win32, how come the cgi::session is available
but
 the apache::session is not??!!, so weared, but this is not the problem, the
 problem is how to create session in win32 without that apache::session??

 thx very much

 Hytham Shehab



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Perl/CGI mysql book

2002-06-05 Thread Scot Robnett

Programming the Perl DBI
http://www.oreilly.com/catalog/perldbi/


SAMS Teach Yourself SQL in 10 Minutes
(It's a lie but it's still a helpful book)
http://www.amazon.com/exec/obidos/ASIN/0672321289/qid=1023301413/sr=1-1/ref=
sr_1_1/002-4842183-8613640





-Original Message-
From: Maureen E Fischer [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 05, 2002 1:12 PM
To: [EMAIL PROTECTED]
Subject: Perl/CGI mysql book




I am writing my first CGI application and after analysis of the data
structure that is required I determined that a DBM file would not be
sufficient.  Mysql was suggested to me.  Unfortunately I could not find
A book that seemed based on Perl and sql.  Everything I found connected
Mysql to PHP -- which I know nothing about.  Since I am new to almost
Everyting except some ancient languages and systems I didn't want to
Bite off yet another learning experience just yet.  I did find and
purchase "Writing CGI Applications with Perl", which did have a chapter
on sql, but since I am having trouble with my first connect I think I
will need more
Help then the brief chapter can give me.  Any suggestion would
Be very welcome.




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---
Incoming mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.368 / Virus Database: 204 - Release Date: 5/29/2002

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.368 / Virus Database: 204 - Release Date: 5/29/2002


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Perl/CGI mysql book

2002-06-05 Thread Kevin Meltzer

Um.. what did the book not cover about this? We used DBI to connect to
MySQL in about every chapter. What did the simple example on page 57
not provide for connecting to a DB?

Cheers,
Kevin

On Wed, Jun 05, 2002 at 11:12:13AM -0700, Maureen E Fischer ([EMAIL PROTECTED]) said 
something similar to:
> 
> 
> I am writing my first CGI application and after analysis of the data
> structure that is required I determined that a DBM file would not be
> sufficient.  Mysql was suggested to me.  Unfortunately I could not find
> A book that seemed based on Perl and sql.  Everything I found connected
> Mysql to PHP -- which I know nothing about.  Since I am new to almost
> Everyting except some ancient languages and systems I didn't want to 
> Bite off yet another learning experience just yet.  I did find and
> purchase "Writing CGI Applications with Perl", which did have a chapter
> on sql, but since I am having trouble with my first connect I think I
> will need more
> Help then the brief chapter can give me.  Any suggestion would
> Be very welcome.  
> 

-- 
[Writing CGI Applications with Perl - http://perlcgi-book.com]
I think you should leave it up to the parent, because not all parents want to
keep their children totally ignorant. 
-- Frank Zappa (response to a question from Senator Hollings)

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Perl/CGI mysql book

2002-06-05 Thread Brent Michalski


Hi,

What kind of trouble are you having with your first connect?  Are you
having a MySQL issue or is it with the Perl DBI?

I am one of the authors of "Writing CGI Applications with Perl" and I would
love to help you out and also see what other details may need to be added
to any future versions of the book.

Brent




   

  "Maureen E   

  Fischer" To:   <[EMAIL PROTECTED]>  

  <[EMAIL PROTECTED]cc:   (bcc: Brent 
Michalski/STL/MASTERCARD) 
  com> Subject:  Perl/CGI mysql book   

   

  06/05/02 01:12 PM

   

   







I am writing my first CGI application and after analysis of the data
structure that is required I determined that a DBM file would not be
sufficient.  Mysql was suggested to me.  Unfortunately I could not find
A book that seemed based on Perl and sql.  Everything I found connected
Mysql to PHP -- which I know nothing about.  Since I am new to almost
Everyting except some ancient languages and systems I didn't want to
Bite off yet another learning experience just yet.  I did find and
purchase "Writing CGI Applications with Perl", which did have a chapter
on sql, but since I am having trouble with my first connect I think I
will need more
Help then the brief chapter can give me.  Any suggestion would
Be very welcome.




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Perl/CGI mysql book

2002-06-05 Thread Kristofer Hoch

Try O'Reilly's MySql & mSQL. Also use the Online reference at www.mysql.org 
(documentation, MySQL APIs)

Kristofer


Original Message Follows
From: "Maureen E Fischer" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Subject: Perl/CGI mysql book
Date: Wed, 5 Jun 2002 11:12:13 -0700



I am writing my first CGI application and after analysis of the data
structure that is required I determined that a DBM file would not be
sufficient.  Mysql was suggested to me.  Unfortunately I could not find
A book that seemed based on Perl and sql.  Everything I found connected
Mysql to PHP -- which I know nothing about.  Since I am new to almost
Everyting except some ancient languages and systems I didn't want to
Bite off yet another learning experience just yet.  I did find and
purchase "Writing CGI Applications with Perl", which did have a chapter
on sql, but since I am having trouble with my first connect I think I
will need more
Help then the brief chapter can give me.  Any suggestion would
Be very welcome.




--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: AW: AW: parsing xml files for variables

2002-06-05 Thread Kristofer Hoch

Johannes,
  That is the output that the program is supposed to output. I am terribly 
sorry that my comments are not clear (Good thing I am not a teacher).

  It may be easier to understand if you analyze what calls produce the 
variable values that are displayed.

  Example: the value 'Test System 3' is produced from the call '$TESTSYS_3 = 
eval Dumper($XMLFileHandle->{Other}->{Other}->{testsystem})'. If you put 
this call next to the XML file you may see the relation ...

$XMLFileHandle->{Other}->{Other}->{testsystem}

  

  Test System 3

  



Again I am sorry for my grammar and cloudly descriptions.

Kristofer Hoch

Original Message Follows
From: Theuerkorn Johannes <[EMAIL PROTECTED]>
To: "'kris hoch'" <[EMAIL PROTECTED]>
CC: [EMAIL PROTECTED]
Subject: AW: AW: parsing xml files for variables
Date: Wed, 5 Jun 2002 14:12:59 +0200

Hmm, somehow your script seems not to work,... :-(

I just get this Kind of Output after parsing the sample file below,...

 >First Test System:  Test System 1 (MyTest: Main area to get crap
 >Second Test System: Test System 2 (misc: Other information to confuse 
code)
 >Third Test System:  Test System 3 (misc: More confusing crap)
Are there any real easy to understand Sampples about XML::Parser?

btw: I already opend a document when calling the XML Parser Modul. Is this 
possible like:

$filenameDefinedBefore=$_


my $XMLFileHandle = XMLin("$filenameDefinedBefore");

 > -Urspr> üngliche Nachricht-
 > Von: kris hoch [SMTP:[EMAIL PROTECTED]]
 > Gesendet am: Dienstag, 4. Juni 2002 16:53
 > An:  [EMAIL PROTECTED]
 > Cc:  [EMAIL PROTECTED]
 > Betreff: Re: AW: parsing xml files for variables
 >
 > Johannes,
 >   I have copied and pasted some same code and data. Look for the "Sample
 > Code" and Sample Data" in this message.
 >
 >   Let me know if this helps
 >
 > Kristofer
 >
 > 
=
 >
 > -[ Sample Code file (TestSystem.pl) 
]--
 > #!/bin/perl
 > # perl -MCPAN -e 'install XML::Parser'
 > # perl -MCPAN -e 'install XML::Simple'
 > # perl -MCPAN -e 'install Data::Dumper'
 > use XML::Parser;
 > use XML::Simple;
 > use Data::Dumper;
 >
 > # Create an array reference with XMLin (XML input)
 > my $XMLFileHandle = XMLin("TestSystem.xml");
 >
 >
 > # Get the Main name and THEN the first test system.
 > $XMLFileName = eval Dumper($XMLFileHandle->{name});
 > $XMLFileDesc = eval Dumper($XMLFileHandle->{description});
 > $TESTSYS_1   = eval Dumper($XMLFileHandle->{testsystem});
 >
 > # No get the other test system
 > $OTHER_ONE_NAME = eval Dumper($XMLFileHandle->{Other}->{name});
 > $OTHER_ONE_DESC = eval Dumper($XMLFileHandle->{Other}->{description});
 > $TESTSYS_2 = eval Dumper($XMLFileHandle->{Other}->{testsystem});
 >
 > #Now get the final test system
 > $OTHER_TWO_NAME = eval Dumper($XMLFileHandle->{Other}->{Other}->{name});
 > $OTHER_TWO_DESC = eval
 > Dumper($XMLFileHandle->{Other}->{Other}->{description});
 > $TESTSYS_3 = eval Dumper($XMLFileHandle->{Other}->{Other}->{testsystem});
 >
 > print << "//ENDOFOUTPUT";
 > =
 > First Test System:  $TESTSYS_1 ($XMLFileName: $XMLFileDesc
 > Second Test System: $TESTSYS_2 ($OTHER_ONE_NAME: $OTHER_ONE_DESC)
 > Third Test System:  $TESTSYS_3 ($OTHER_TWO_NAME: $OTHER_TWO_DESC)
 > //ENDOFOUTPUT
 >
 > -[ Sample XML file (TestSystem.xml) 
]--
 >   date="06/04/2002"
 >   description="Main area to get crap">
 >
 >   Test System 1
 >
 >description="Other information to confuse code">
 > Test System 2
 >
 > description="More confusing crap"
 >testsystem="Test System 3" />
 >   
 > 
 >
 >
 >
 >
 >
 >
 > _
 > Join the world> '> s largest e-mail service with MSN Hotmail.
 > http://www.hotmail.com

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Perl/CGI mysql book

2002-06-05 Thread Maureen E Fischer



I am writing my first CGI application and after analysis of the data
structure that is required I determined that a DBM file would not be
sufficient.  Mysql was suggested to me.  Unfortunately I could not find
A book that seemed based on Perl and sql.  Everything I found connected
Mysql to PHP -- which I know nothing about.  Since I am new to almost
Everyting except some ancient languages and systems I didn't want to 
Bite off yet another learning experience just yet.  I did find and
purchase "Writing CGI Applications with Perl", which did have a chapter
on sql, but since I am having trouble with my first connect I think I
will need more
Help then the brief chapter can give me.  Any suggestion would
Be very welcome.  




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: First and second rate programmers

2002-06-05 Thread drieux


On Wednesday, June 5, 2002, at 08:40 , Ovid wrote:
[..]
>
> First-rate mathematicians want to hang around first-rate
> mathematicians.  Second-rate mathematicians want to hang
> around third-rate mathematicians.
>
> The reason for that is left as an exercise for the reader :)
>
> Cheers,
> Curtis "Ovid" Poe


First let us address the logic fault in your opening premise.

The reason that many Perl Module Writers do not impose 'use strict'
and/or 'use warning' - is precisely because of their obligation to
'backward compatibility' - and is done with a clear understanding
that a core tenant of Perl Orthodoxy is that while we do not wish
folks to rummage around in one's living room - we are not planning
to put up trip mines to keep them out.

Hence whining at any of the 'canonical' perl module writers for
following Orthodoxy over 'good advice' - would be less than useful.

Let us now move onto the problem of resolving 'ranking of programmers'
as a concept in itself - and specifically SILLY in the perl environment
to begin with Perchance the pinnacle of FOLLY in the cgi/mod_perl
space - since this is a place where we have to deal with the fact that
the 'standards committee' was functionally clueless to begin with
when they ginned up the HTTP/HTML "standards" from the gitGo - and have
compounded that folly by openly admitting their total cluelessness
with XHTML - the 'we have no hope of formalization at all'!

How exactly were we planning to rank programmer's who are great
kernel hackers - but write, well, lame perl code? My old sense
who is now in the bowels of VxWork based solutions for 802.11
work - had that coffee break moment that he had to actually 'work it'
to understand some of the new perl tricks i use is he better than
me or worse than me

Or put the other way around - if the requirements are for this OS
and to hit these performance numbers for the OLTP system - is it 'better'
to dodge the whole 'portability' game - and get those XS's tied tightly
to this OS's implementation of their unique wonders - for the speed...
knowing that were we to change platforms we have some serious porting
issues to address down the road??? But at least we have the basic perl
inteface into the OLTP exposed in a reasonable way???

I can appreciate for the devotee's of the academic world - there is the
clear moral imperative to having 'ranking and orders' - since without
them how would one know if one had to write the valedictorian speach,
or be the person working the 'back up strategy' incase the valedictorian
takes a bullet But what about out here in the real world???

You know, where code gets generated by folks who are not worrying about
the inter-departmental politics of how their pious posturing will be
perceived one way or the other??? The 'dumb grunts' who merely have to
get it to work.

But clearly - if i felt that Perl were a specific field of mathematics,
then I would of course find your argument so compelling - If I were
worried at all about how I 'ranked' in the academic world to begin with.

But what if 12 years in the industry helped me better understand how
frighteningly silly that Degree in Computer Science really was to begin 
with?

What if the process is really about seeing how others solve problems?
Or finding interesting problems to solve for real people with real
concerns about how to really do FOO

What if the best thing to happen to the Shaolin Monasteries was that
they were sacked and burned - and allowed them to find the same level
of 'friar' { that old english phrase for 'free monk' } that helped
them get in touch with their 'ronin' ways???

What if wandering the lanes with nothing more than a rice bowl
was a great way to see the world and actually do good?

Or would this be the wrong place to propose that if only Larry Wall
had been a team player and been willing to do what needed to be done
to make things in sed/awk more ellegant - and be a 'real first water'
programmer rather than someone out to impress the 3rd tier wankers...

But the same would also apply to the fact that those CERN wankers
really should have been content with telnet and ftp - since clearly
this whole skank with the lame, lame, lame HTTP protocol was merely
there because those were so clearly lame types who were never going
to be 'real programmers'

But barring that, we so clearly agree that providing best practices
and something like a standard is probably the best that we will be
able to do - since most RealProgrammers[tm] will wind up doing things
in ways we might not have expected - just like RealEndUsers[tm] tend
to do with the code we wrote things we hadn't thought about

God, if Only we had been First Water Wonders...

Rather than merely Perl Coders

ciao
drieux

---


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: First and second rate programmers

2002-06-05 Thread Ovid

--- Jake <[EMAIL PROTECTED]> wrote:
> Im a bit worried that a few of my statements have been misconstrued, and I was 
> concerned that would happen when I first posted.

Jake,

No worries, I didn't misconstrue your comments.  I deliberately changed the subject in 
hopes that
no one would think I was directly replying to what you asked.  Unfortunately, by 
making a
reference to something you wrote, *I* was possibly misconstrued.  I was just trying to 
make a
general statement to the effect that "we improve by understanding best practices", 
though perhaps
I was a bit ham-handed in getting the point across.

In fact, I deliberately did not answer your question since I was trying to make that 
other point,
so I guess I'll go ahead and answer the question now.

> my question is why the basic functionality of "use strict" isnt directly built 
> into the perl compiler/interpreter?

If you check out some of my modules on the CPAN, you find that I regularly need to 
disable
portions of strict in my code.  Some programmers (Damian Conway springs to mind) do 
this with such
frequency that it would be annoying to turn strict off, then on, then off, then on 
again, etc. 
Personally, I'll take the annoyance.

It's not the default because many who use Perl are just using it for a lightning quick 
tool to get
things done.  They want to focus on the task and not on "am I having a scoping issue 
here?"  Many
disagree with this (I have my reservations), but this is so prevalent that it was 
decided to
retain this feature.

Cheers,
Curtis "Ovid" Poe

=
"Ovid" on http://www.perlmonks.org/
Someone asked me how to count to 10 in Perl:
push@A,$_ for reverse q.e...q.n.;for(@A){$_=unpack(q|c|,$_);@a=split//;
shift@a;shift@a if $a[$[]eq$[;$_=join q||,@a};print $_,$/for reverse @A

__
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Why do we even HAVE to... (was: Why using use strict;)

2002-06-05 Thread Joel Hughes

because Perl has evolved over time?

joel

-Original Message-
From: Jake [mailto:[EMAIL PROTECTED]]
Sent: 05 June 2002 13:56
To: [EMAIL PROTECTED]
Subject: Why do we even HAVE to... (was: Why using use strict;)


So, in post after post after post I see the comment "always use strict"...

I have seen threads where people are insulted because they dont...

Every perl tutorial I've seen says you should always "use strict"...

It apparently doesnt slow down code execution...

If you dont "use strict", the perl monks will come and flay you...

All of this begs the obvious question(s)...

Why the hell isnt "use strict" built into the language?  Why doesnt perl
just
do all that automatically?


just a question

Cheers
J-


On Tuesday 04 June 2002 02:03 am, Octavian Rasnita wrote:
> Hi all,
>
> I know why I should use "use strict;"   but what happen if I use "use
> strict;" then if the code is OK, I delete this line?
>
>
> Shouldn't it work the same without this line if the code has no problems?
>
> Thanks.
>
> Teddy,
> [EMAIL PROTECTED]


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




DBI newbabe

2002-06-05 Thread sujitra kungi


hi

i want to connect mysql with perl , first i try
---
#!c:\perl\bin\perl.exe
print "Content-type: text/html\n\n";
use Msql;

so i change to

#!c:\perl\bin\perl.exe
print "Content-type: text/html\n\n";
use DBI;

i still got error. do i need to install any module? i use perl on WIN.
regards
kung sujitra

_
Send and receive Hotmail on your mobile device: http://mobile.msn.com


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: First and second rate programmers

2002-06-05 Thread Nikola Janceski

The problem lies within the one liner code.
But also some just don't understand it, and don't use perl often enough to
care about it.

This issue was brought up in the Apocalypse for Perl 6:
http://dev.perl.org/perl6/apocalypse/1 (scroll to RFC 16)

RFC 16: Keep default Perl free of constraints such as warnings and strict.





> -Original Message-
> From: Jake [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 05, 2002 11:43 AM
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: First and second rate programmers
> 
> 
> Im a bit worried that a few of my statements have been 
> misconstrued, and I was 
> concerned that would happen when I first posted.  Let me try 
> to clarify - and 
> I should also preface this with I am primarily a C/C++ 
> programmer (I'm 
> addicted to the Qt toolkit) who really uses perl only when he 
> needs it.
> 
> I was not questioning whether one should or shouldn't "use 
> strict".  In the 
> brief time I have spent coding in perl, I have learned the 
> hard way how 
> useful it is.   
> 
> my question is why the basic functionality of "use strict" 
> isnt directly built 
> into the perl compiler/interpreter?  Why, for instance, isnt 
> it simply 
> required by perl to use "my" or "our" or whatever when one 
> first introduces a 
> variable?  Sure, not using strict may save (advanced?) 
> programmers a few 
> keystrokes, but is that really the only reason?   
> 
> I'm sure that somewhere along the line, the designers of perl 
> had to have at 
> least considered this...and I'm also sure that they had very 
> good reasons for 
> having "strict" remain a module that one can choose to use or not use.
> I would simply like to know their reasons.
> 
> As for the perlmonks, as far as I'm concerned, that is one of 
> the best 
> computer language websites/cultures that I have come across.  Almost 
> everything I know about perl has come from either that site 
> or this list, and 
> I admire the fact that you and your colleagues are willing to 
> hang out in 
> newsgroups like this and patiently answer questions from hard 
> headed newbies 
> like myself :)  
> 
> As for your remark about quality leading to correctness, I 
> couldn't agree 
> more.  Jeez, I've read "Zen and the Art of Motorcycle 
> Maintanance" 6 times.
> 
> Respectfully,
> Jake
> 
> On Wednesday 05 June 2002 11:40 am, Ovid wrote:
> > To all:
> >
> > Okay, there have been a few comments about the merits of 
> using strict, but
> > I thought I would toss up a meta-argument.
> >
> > It's true that posters who post code without "strict" are generally
> > reminded by several replies that they should have used 
> strict, but the
> > respondents also usually try to answer the question. 
> Personally, I would
> > never think of dropping a note to Lincoln Stein for not 
> using strict in
> > CGI.pm or Damian Conway for not using strict in anything.  
> People who are
> > reminded to use strict are usually (not always) people for 
> whom strict
> > would be an enormous benefit.
> >
> > As for Perlmonks (brought up in one reply), the ones who 
> have been around
> > for a while are usually very concerned not just about correctness (a
> > program does what it should and no more), but also about 
> quality (a program
> > that works can still be an unmaintainable piece of crud).  
> So, when I see
> > someone who failed to use strict and then typed $recieved, 
> I'll point out
> > the misspelling, but I'll also point out that using strict 
> would have
> > caught that error *at compile time*, rather than have them 
> pull their hair
> > out for hours trying to figure out what's buggy.
> >
> > Quality, thus, tends to lead to correctness.  I could go on 
> for hours as to
> > why this is the case, but really, who *doesn't* want 
> correct programs?
> >
> > I strongly recommend to every Perl programmer that they 
> should hang out at
> > Perlmonks.  Why? Because of a saying amongst mathematicians 
> (which applies
> > very strongly to programmers, too):
> >
> > First-rate mathematicians want to hang around first-rate
> > mathematicians.  Second-rate mathematicians want to hang
> > around third-rate mathematicians.
> >
> > The reason for that is left as an exercise for the reader :)
> >
> > Cheers,
> > Curtis "Ovid" Poe
> >
> > =
> > "Ovid" on http://www.perlmonks.org/
> > Someone asked me how to count to 10 in Perl:
> > push@A,$_ for reverse 
> q.e...q.n.;for(@A){$_=unpack(q|c|,$_);@a=split//;
> > shift@a;shift@a if $a[$[]eq$[;$_=join q||,@a};print 
> $_,$/for reverse @A
> >
> > __
> > Do You Yahoo!?
> > Yahoo! - Official partner of 2002 FIFA World Cup
> > http://fifaworldcup.yahoo.com
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the se

How to blank out a form?

2002-06-05 Thread Walt Sanders

This one is a little hard to explain.  I have a .cgi program that offers a 
textarea form box.  The contents are used to generate a text file that is 
then used as an SSI in an html program.  This text must be changed from 
time to time.

In order to make it easier to modify the text, I grab the previous text and 
put it into the form for editing.  Problem is: if one wants to blank out 
the text entirely by deleting everything and submitting it, to have nothing 
placed in the text tile, the entire previous message reappears.  The blank 
form doesn't take.

Work around has been to place at least one blank space in the form.  Then 
everything works fine; I get a blank text field file.  Rather than having 
to explain to all other users to do this, it would be much better if one 
could just delete the text (blank out the form) and submit, rather than 
having to remember to put a space in.  I don't know how to make this happen.

Here is the snippet:

my $textold;
open(EVENT, ";
close(EVENT) or die("Cannot close event2.txt: $!");

print <
Event Title: 

Enter Event Description & Details Here:
$textold



$textold is forwarded even when the blank is submitted empty.  How to fix?

Thanks, Walt Sanders.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: First and second rate programmers

2002-06-05 Thread Jake

Im a bit worried that a few of my statements have been misconstrued, and I was 
concerned that would happen when I first posted.  Let me try to clarify - and 
I should also preface this with I am primarily a C/C++ programmer (I'm 
addicted to the Qt toolkit) who really uses perl only when he needs it.

I was not questioning whether one should or shouldn't "use strict".  In the 
brief time I have spent coding in perl, I have learned the hard way how 
useful it is.   

my question is why the basic functionality of "use strict" isnt directly built 
into the perl compiler/interpreter?  Why, for instance, isnt it simply 
required by perl to use "my" or "our" or whatever when one first introduces a 
variable?  Sure, not using strict may save (advanced?) programmers a few 
keystrokes, but is that really the only reason?   

I'm sure that somewhere along the line, the designers of perl had to have at 
least considered this...and I'm also sure that they had very good reasons for 
having "strict" remain a module that one can choose to use or not use.
I would simply like to know their reasons.

As for the perlmonks, as far as I'm concerned, that is one of the best 
computer language websites/cultures that I have come across.  Almost 
everything I know about perl has come from either that site or this list, and 
I admire the fact that you and your colleagues are willing to hang out in 
newsgroups like this and patiently answer questions from hard headed newbies 
like myself :)  

As for your remark about quality leading to correctness, I couldn't agree 
more.  Jeez, I've read "Zen and the Art of Motorcycle Maintanance" 6 times.

Respectfully,
Jake

On Wednesday 05 June 2002 11:40 am, Ovid wrote:
> To all:
>
> Okay, there have been a few comments about the merits of using strict, but
> I thought I would toss up a meta-argument.
>
> It's true that posters who post code without "strict" are generally
> reminded by several replies that they should have used strict, but the
> respondents also usually try to answer the question. Personally, I would
> never think of dropping a note to Lincoln Stein for not using strict in
> CGI.pm or Damian Conway for not using strict in anything.  People who are
> reminded to use strict are usually (not always) people for whom strict
> would be an enormous benefit.
>
> As for Perlmonks (brought up in one reply), the ones who have been around
> for a while are usually very concerned not just about correctness (a
> program does what it should and no more), but also about quality (a program
> that works can still be an unmaintainable piece of crud).  So, when I see
> someone who failed to use strict and then typed $recieved, I'll point out
> the misspelling, but I'll also point out that using strict would have
> caught that error *at compile time*, rather than have them pull their hair
> out for hours trying to figure out what's buggy.
>
> Quality, thus, tends to lead to correctness.  I could go on for hours as to
> why this is the case, but really, who *doesn't* want correct programs?
>
> I strongly recommend to every Perl programmer that they should hang out at
> Perlmonks.  Why? Because of a saying amongst mathematicians (which applies
> very strongly to programmers, too):
>
> First-rate mathematicians want to hang around first-rate
> mathematicians.  Second-rate mathematicians want to hang
> around third-rate mathematicians.
>
> The reason for that is left as an exercise for the reader :)
>
> Cheers,
> Curtis "Ovid" Poe
>
> =
> "Ovid" on http://www.perlmonks.org/
> Someone asked me how to count to 10 in Perl:
> push@A,$_ for reverse q.e...q.n.;for(@A){$_=unpack(q|c|,$_);@a=split//;
> shift@a;shift@a if $a[$[]eq$[;$_=join q||,@a};print $_,$/for reverse @A
>
> __
> Do You Yahoo!?
> Yahoo! - Official partner of 2002 FIFA World Cup
> http://fifaworldcup.yahoo.com


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: AW: parsing xml files for variables

2002-06-05 Thread drieux


On Wednesday, June 5, 2002, at 08:31 , Theuerkorn Johannes wrote:

> Ok, found one easy solution: as I need to parse the whole file anyway, i 
> am removing all newline by doing:
>
> if (open(LOG,"$fileName")) {
>
>open (temp1,"$temp");
>while ()
>{
>  chomp;
> my $line =$_;
>   $lastline .= "$line" ;
>   }
> print temp1 "$lastline";
>
> So I get a new file temp1 which I can parse as usual.

I personally would avoid creating a temp file in the process
and would instead read in the $fileName - and find the stuff
that I need and 'use it' in the code unless you
really need to create a new file that will be used elsewhere.

> Only Problem: when joining the Lines to one line I get ^M where used to 
> be the newline char...
[..]

http://www.wetware.com/drieux/pbl/RegEx/eolOut.txt

provides way that this can be done...

so I would be working all of the sneek and peek
that I recommend in


http://www.wetware.com/drieux/pbl/RegEx/paraHablarRegular.txt

all inside of the

while() {

}

then again I would also do something of the form

open(LOG,"$fileName") or webSafeWhine($thisAngst);

which is mostly implied in your

if(open(LOG,"$fileName")) {

} else {

# have problem with LOG here
}


ciao
drieux

http://www.wetware.com/drieux/pbl/

--

This space left intentionally blank.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




First and second rate programmers

2002-06-05 Thread Ovid

To all:

Okay, there have been a few comments about the merits of using strict, but I thought I 
would toss
up a meta-argument.

It's true that posters who post code without "strict" are generally reminded by 
several replies
that they should have used strict, but the respondents also usually try to answer the 
question. 
Personally, I would never think of dropping a note to Lincoln Stein for not using 
strict in CGI.pm
or Damian Conway for not using strict in anything.  People who are reminded to use 
strict are
usually (not always) people for whom strict would be an enormous benefit.

As for Perlmonks (brought up in one reply), the ones who have been around for a while 
are usually
very concerned not just about correctness (a program does what it should and no more), 
but also
about quality (a program that works can still be an unmaintainable piece of crud).  
So, when I see
someone who failed to use strict and then typed $recieved, I'll point out the 
misspelling, but
I'll also point out that using strict would have caught that error *at compile time*, 
rather than
have them pull their hair out for hours trying to figure out what's buggy.  

Quality, thus, tends to lead to correctness.  I could go on for hours as to why this 
is the case,
but really, who *doesn't* want correct programs?

I strongly recommend to every Perl programmer that they should hang out at Perlmonks.  
Why? 
Because of a saying amongst mathematicians (which applies very strongly to 
programmers, too):

First-rate mathematicians want to hang around first-rate 
mathematicians.  Second-rate mathematicians want to hang
around third-rate mathematicians.

The reason for that is left as an exercise for the reader :)

Cheers,
Curtis "Ovid" Poe

=
"Ovid" on http://www.perlmonks.org/
Someone asked me how to count to 10 in Perl:
push@A,$_ for reverse q.e...q.n.;for(@A){$_=unpack(q|c|,$_);@a=split//;
shift@a;shift@a if $a[$[]eq$[;$_=join q||,@a};print $_,$/for reverse @A

__
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Why do we even HAVE to... (was: Why using use strict;)

2002-06-05 Thread Nikola Janceski

I was referring to those just touching the water, not the ones already waist
deep.
yes after you have your feet wet you should be using "use strict" at all
times,
and don't forget "use warnings" to help with those foolish mistakes we all
make.

If only I knew that back in Perl 4, when I was getting feet wet... now my
work is over my head and I am rewriting all my crappy code.

P.S. to all newbies COMMENT, wish I knew what I was doing with my code a
year ago.

Nikola Janceski

May the forces of evil become confused on the way to your house.
-- George Carlin



> -Original Message-
> From: Jake [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 05, 2002 9:19 AM
> To: Nikola Janceski; [EMAIL PROTECTED]
> Subject: Re: Why do we even HAVE to... (was: Why using use strict;)
> 
> 
> IMHO only the first of these may be a valid reason.  But I 
> dont know much 
> about "perl one liners".
> 
> Your second reason is particularly bad, beginners are the 
> ones who need "use 
> strict" the most!
> 
> On Wednesday 05 June 2002 10:12 am, Nikola Janceski wrote:
> > because it would reek havoc on all the perl one liners.
> > And deter many beginners that are touching perl for the first time.
> > And would annoy those who have to write a quick 5 line 
> script in 3 seconds
> > that forget a my for $line.
> >
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Why do we even HAVE to... (was: Why using use strict;)

2002-06-05 Thread Bob Showalter

> -Original Message-
> From: Jake [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 05, 2002 8:56 AM
> To: [EMAIL PROTECTED]
> Subject: Why do we even HAVE to... (was: Why using use strict;)
> 
> 
> So, in post after post after post I see the comment "always 
> use strict"...

It's a good suggestion. I've seen several instances of code
posted to this list because it had a problem that "use strict"
could have caught, but wasn't used.

> 
> I have seen threads where people are insulted because they dont...

Really? Where are these threads? Maybe on c.l.p.m

> 
> Every perl tutorial I've seen says you should always "use strict"...
> 
> It apparently doesnt slow down code execution...
> 
> If you dont "use strict", the perl monks will come and flay you...

Oh, come on.

>  
> All of this begs the obvious question(s)...
> 
> Why the hell isnt "use strict" built into the language?  Why 
> doesnt perl just 
> do all that automatically?

Backward compatibility is the short answer. That's why I suggest
"use strict" for new code.

But it really is like "wear your seatbelt". You don't need it
until you crash.

(Now -w (or use warnings) is another beast altogether. I for one,
*never* use -w (or use warnings) in my code. Yet all the tutorials 
say you should. But note to module writers: you should make your
code -w safe for those folks who are being good and using -w)


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Why do we even HAVE to... (was: Why using use strict;)

2002-06-05 Thread Jake

IMHO only the first of these may be a valid reason.  But I dont know much 
about "perl one liners".

Your second reason is particularly bad, beginners are the ones who need "use 
strict" the most!

On Wednesday 05 June 2002 10:12 am, Nikola Janceski wrote:
> because it would reek havoc on all the perl one liners.
> And deter many beginners that are touching perl for the first time.
> And would annoy those who have to write a quick 5 line script in 3 seconds
> that forget a my for $line.
>


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Why do we even HAVE to... (was: Why using use strict;)

2002-06-05 Thread Nikola Janceski

because it would reek havoc on all the perl one liners.
And deter many beginners that are touching perl for the first time.
And would annoy those who have to write a quick 5 line script in 3 seconds
that forget a my for $line.

> -Original Message-
> From: Jake [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 05, 2002 8:56 AM
> To: [EMAIL PROTECTED]
> Subject: Why do we even HAVE to... (was: Why using use strict;)
> 
> 
> So, in post after post after post I see the comment "always 
> use strict"...
> 
> I have seen threads where people are insulted because they dont...
> 
> Every perl tutorial I've seen says you should always "use strict"...
> 
> It apparently doesnt slow down code execution...
> 
> If you dont "use strict", the perl monks will come and flay you...
>  
> All of this begs the obvious question(s)...
> 
> Why the hell isnt "use strict" built into the language?  Why 
> doesnt perl just 
> do all that automatically?
> 
> 
> just a question
> 
> Cheers
> J-
> 
> 
> On Tuesday 04 June 2002 02:03 am, Octavian Rasnita wrote:
> > Hi all,
> >
> > I know why I should use "use strict;"   but what happen if 
> I use "use
> > strict;" then if the code is OK, I delete this line?
> >
> >
> > Shouldn't it work the same without this line if the code 
> has no problems?
> >
> > Thanks.
> >
> > Teddy,
> > [EMAIL PROTECTED]
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: The Cannons of True Faith

2002-06-05 Thread Mark Rowlands

On Tuesday 04 June 2002 6:02 pm, fliptop wrote:
> drieux wrote:
> > one of the problems I keep bumping my head into
> > is that fundamentally perl is a Kult - and as such
> > tends to not always be a well organized kult - since
> > they are never clear as to which are the true cannons of the faith
> > and which are the apostate ramblings of the merely deranged.
> >
> > Is there an official site dedicated to the True Cannons of Perl?

of course there is 

www.perlmonks.org

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Why do we even HAVE to... (was: Why using use strict;)

2002-06-05 Thread Jake

So, in post after post after post I see the comment "always use strict"...

I have seen threads where people are insulted because they dont...

Every perl tutorial I've seen says you should always "use strict"...

It apparently doesnt slow down code execution...

If you dont "use strict", the perl monks will come and flay you...
 
All of this begs the obvious question(s)...

Why the hell isnt "use strict" built into the language?  Why doesnt perl just 
do all that automatically?


just a question

Cheers
J-


On Tuesday 04 June 2002 02:03 am, Octavian Rasnita wrote:
> Hi all,
>
> I know why I should use "use strict;"   but what happen if I use "use
> strict;" then if the code is OK, I delete this line?
>
>
> Shouldn't it work the same without this line if the code has no problems?
>
> Thanks.
>
> Teddy,
> [EMAIL PROTECTED]


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




beginners-cgi@perl.org

2002-06-05 Thread Nikola Janceski

I'd suggest using prototypes if you are going to be passing more than
3 variable references, or 3 or more different types of varible references.
This is for your own sanity.

> -Original Message-
> From: Bob Showalter [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 05, 2002 9:30 AM
> To: 'Octavian Rasnita'; [EMAIL PROTECTED]
> Subject: RE: subroutine or &subroutine
> 
> Here are my recommendations for new code (others may want to 
> debate these):
> 
> 1. Always "use strict;"
> 
> 2. Don't use prototypes.
> 
> 3. Don't use the &foo or &foo(args) calling styles.
> 
> 4. To call a sub with no arguments, use an empty set of
>parens: foo() (Exception: method calls can leave
>off the parens, e.g: $sth->execute; since there is
>no ambiguity with a method call).
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 



The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Why using use strict;

2002-06-05 Thread drieux


On Wednesday, June 5, 2002, at 05:51 , Bob Showalter wrote:
>> -Original Message-
>> From: Janek Schleicher [mailto:[EMAIL PROTECTED]]
>> Sent: Wednesday, June 05, 2002 6:19 AM
>> Octavian Rasnita wrote at Tue, 04 Jun 2002 08:03:21 +0200:
>>>
>>> I know why I should use "use strict;"   but what happen if
>>
>> use strict has (e.g.) the benefit for checking for undef values.
>
> Nope. That's one of the things "use warnings" (or -w) does.

Hence why the question really should be

what if i drive down the street without the lap and
shoulder belt on - the buzzer will finally go off

The 'use strict' helps one with the stuff more protected
in 'refs' and 'vars'.

Perchance not as important once one has

a) opted to harden the code and never ever, ever, ever
go with changing a line in it

b) ported it completely to being a tomcat java servlet

The problem that we are protecting ourselves from is the
moment in the future when we have to take this piece of
code down for some maintanance.

ciao
drieux

---

ps: as for driving with safety equipage - its the time
that you THINK it is ok, that will be the night you
get to sit up in ER having a chat with the radiologist
as you look at the X-rays and say:

"Damn I thought that part of the facial bone
structure was designed to prevent cracking that
part of the bone structure over the sinuses..."

Or should I park this story in the context of my LIFE NRA
member cousin who capped a 9mm round through his tigh one
evening from an unloaded handgun he was planning to clean
because, well, he'd cleaned enough of them... and now has
no problem understanding why we all consider all of them
LOADED and LEATHAL - PERIOD - no discussion, no debate.

UNPROTECTED PERL CODE CAN CREEP IN AND EAT YOU!



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




beginners-cgi@perl.org

2002-06-05 Thread Bob Showalter

> -Original Message-
> From: Octavian Rasnita [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, June 04, 2002 2:06 PM
> To: [EMAIL PROTECTED]
> Subject: subroutine or &subroutine
> 
> 
> Hi all,
> 
> I've seen some subroutines are ran without the & sign in front of the
> subroutine name, like:
> 
> subroutine_name;
> instead of
> &subroutine_name;
> 
> Is it the same thing or there is a difference?

Janek gave you the difference, and it's fully documented in perldoc perlsub.

Note that the first is not allowed under "use strict" unless the sub has
been declared or defined above the usage, or imported.

Here are my recommendations for new code (others may want to debate these):

1. Always "use strict;"

2. Don't use prototypes.

3. Don't use the &foo or &foo(args) calling styles.

4. To call a sub with no arguments, use an empty set of
   parens: foo() (Exception: method calls can leave
   off the parens, e.g: $sth->execute; since there is
   no ambiguity with a method call).

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Why using use strict;

2002-06-05 Thread Bob Showalter

> -Original Message-
> From: Octavian Rasnita [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, June 04, 2002 2:03 AM
> To: [EMAIL PROTECTED]
> Subject: Why using use strict;
> 
> 
> Hi all,
> 
> I know why I should use "use strict;"   but what happen if I use "use
> strict;" then if the code is OK, I delete this line?

Nothing happens.

> 
> 
> Shouldn't it work the same without this line if the code has 
> no problems?

Yep. And it won't run any faster.

A-L-W-A-Y-S "use strict". :)

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Why using use strict;

2002-06-05 Thread Bob Showalter

> -Original Message-
> From: Janek Schleicher [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 05, 2002 6:19 AM
> To: [EMAIL PROTECTED]
> Subject: Re: Why using use strict;
> 
> 
> Octavian Rasnita wrote at Tue, 04 Jun 2002 08:03:21 +0200:
> 
> > Hi all,
> > 
> > I know why I should use "use strict;"   but what happen if 
> I use "use strict;" then if the code is
> > OK, I delete this line?
> > 
> 
> use strict has (e.g.) the benefit for checking for undef values.

Nope. That's one of the things "use warnings" (or -w) does.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Dynamically creating submit buttons

2002-06-05 Thread Bob Showalter

> -Original Message-
> From: Jason Ostrom [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, June 04, 2002 10:06 PM
> To: [EMAIL PROTECTED]
> Subject: Dynamically creating submit buttons
> 
> 
> To those in the know, I have a couple of questions about the best way
> to create dynamic form elements.
> 
> I have a script that queries a database and dynamically generates a
> table, as shown below in the code.  What I am attempting to do is have
> a form element off to the right of each Table Row that the user can
> select.  The problem is I don't know for sure what the variables will
> be retrieved from the database, but need to have it off to the right,
> and created on the fly.
> 
>  The user will then select the "Submit" or "Radio button" for the
>  element, and this will create a query to the database, 
> returning several
>  elements.  Within these elements created, I then need to have another
>  way of selecting another "Submit" button within each of the values
>  that are returned the first time.
> 
>  My questions are:
>  1.  What is the best type of form element that will send the request
>  to the database?  For example, submit, radio, etc.??

This is a "drill down" concept, right? Why not just use a simple link?
Details

If you want a form, I would use a Submit button. If you use a radio
button, you either need a Submit button somewhere else, or you need
to use onclick to submit the form, which seems counter-intuitive to
me. You'll have to name the submit button in such a way as to identify
the row selected.

> 
>  2.  How can I have perl create a form element off to the right of
>  each table row that is separate from the table?

Don't close the table row. Just put the form element inside a 

> 
>  3.  Am I using the HTML to create the table correctly given what I am
>  trying to do?
> 
> 
> Any help would be very appreciated.  I'm basically just confused on
> how to implement this with CGI.pm.

I don't see any evidence of CGI.pm being used in your code.
You're just handrolling your HTML, which is fine with me, but not
necessarily the "CGI.pm" way...

[snip code for brevity]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




AW: AW: parsing xml files for variables

2002-06-05 Thread Theuerkorn Johannes

Hmm, somehow your script seems not to work,... :-( 

I just get this Kind of Output after parsing the sample file below,...

>First Test System:  Test System 1 (MyTest: Main area to get crap
>Second Test System: Test System 2 (misc: Other information to confuse code)
>Third Test System:  Test System 3 (misc: More confusing crap)
Are there any real easy to understand Sampples about XML::Parser?

btw: I already opend a document when calling the XML Parser Modul. Is this possible 
like:

$filenameDefinedBefore=$_


my $XMLFileHandle = XMLin("$filenameDefinedBefore");

> -Urspr> üngliche Nachricht-
> Von:  kris hoch [SMTP:[EMAIL PROTECTED]]
> Gesendet am:  Dienstag, 4. Juni 2002 16:53
> An:   [EMAIL PROTECTED]
> Cc:   [EMAIL PROTECTED]
> Betreff:  Re: AW: parsing xml files for variables
> 
> Johannes,
>   I have copied and pasted some same code and data. Look for the "Sample 
> Code" and Sample Data" in this message.
> 
>   Let me know if this helps
> 
> Kristofer
> 
> 
>=
> 
> -[ Sample Code file (TestSystem.pl) ]--
> #!/bin/perl
> # perl -MCPAN -e 'install XML::Parser'
> # perl -MCPAN -e 'install XML::Simple'
> # perl -MCPAN -e 'install Data::Dumper'
> use XML::Parser;
> use XML::Simple;
> use Data::Dumper;
> 
> # Create an array reference with XMLin (XML input)
> my $XMLFileHandle = XMLin("TestSystem.xml");
> 
> 
> # Get the Main name and THEN the first test system.
> $XMLFileName = eval Dumper($XMLFileHandle->{name});
> $XMLFileDesc = eval Dumper($XMLFileHandle->{description});
> $TESTSYS_1   = eval Dumper($XMLFileHandle->{testsystem});
> 
> # No get the other test system
> $OTHER_ONE_NAME = eval Dumper($XMLFileHandle->{Other}->{name});
> $OTHER_ONE_DESC = eval Dumper($XMLFileHandle->{Other}->{description});
> $TESTSYS_2 = eval Dumper($XMLFileHandle->{Other}->{testsystem});
> 
> #Now get the final test system
> $OTHER_TWO_NAME = eval Dumper($XMLFileHandle->{Other}->{Other}->{name});
> $OTHER_TWO_DESC = eval 
> Dumper($XMLFileHandle->{Other}->{Other}->{description});
> $TESTSYS_3 = eval Dumper($XMLFileHandle->{Other}->{Other}->{testsystem});
> 
> print << "//ENDOFOUTPUT";
> =
> First Test System:  $TESTSYS_1 ($XMLFileName: $XMLFileDesc
> Second Test System: $TESTSYS_2 ($OTHER_ONE_NAME: $OTHER_ONE_DESC)
> Third Test System:  $TESTSYS_3 ($OTHER_TWO_NAME: $OTHER_TWO_DESC)
> //ENDOFOUTPUT
> 
> -[ Sample XML file (TestSystem.xml) ]--
>   date="06/04/2002"
>description="Main area to get crap">
> 
>   Test System 1
> 
> description="Other information to confuse code">
> Test System 2
> 
> description="More confusing crap"
>testsystem="Test System 3" />
>   
> 
> 
> 
> 
> 
> 
> 
> _
> Join the world> '> s largest e-mail service with MSN Hotmail. 
> http://www.hotmail.com

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Why using use strict;

2002-06-05 Thread Janek Schleicher

Octavian Rasnita wrote at Tue, 04 Jun 2002 08:03:21 +0200:

> Hi all,
> 
> I know why I should use "use strict;"   but what happen if I use "use strict;" then 
>if the code is
> OK, I delete this line?
> 

use strict has (e.g.) the benefit for checking for undef values.
They can come from the input.
(User typed only enter, the file was empty, didn't exist,
 a library couldn't found, ...)
That's no problem when your code works.
But anytime, anywhen, that will happen.

Without use strict; you will search many months for a simple error.
Why ? An undef value means 0, "", (), {}, empty file in the right context.
That means your script will at a random point recognise that the values
are crazy. So you'll search the error somewhere else where it occurs.

And even with use strict; your program won't really be slower. 
(Perhaps 0.1 %, but in the one week you're searching for errors,
 the processors have been become quicker (> 0.1 %)).

Cheerio,
Janek


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




beginners-cgi@perl.org

2002-06-05 Thread Janek Schleicher

Kevin Christopher wrote at Wed, 05 Jun 2002 04:58:38 +0200:

> Yes, you can call subroutines either way, with or without the "&". The only case 
>when the
> subroutine must be prefixed with an ampersand is, I believe, when you're assigning a 
>reference
> variable, eg:
> 
> $reference_x = \&subroutine_y;
> 
> But that's another story.
> 

Oh, I'm afraid that's not the truth :-)

&subroutine without any arguments calls the subroutine with the implicit @_ array,
while subroutine only calls subroutine() without any argument.

Look at this snippet:
@_ = qw(A B C);

print 'foo:'; foo; print "\n";
print '&foo:'; &foo; print "\n";

sub foo {
   print @_;
}

It prints:
foo:
&foo:ABC


Greetings,
Janek

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Why using use strict;

2002-06-05 Thread Joel Hughes

why would you want to do that Octavian?

"use strict" is a sanity safety net. What your saying is like "I know why I
should use safety belt whilst driving my car but what if I took it off?" -
of course you can do it but beware of the consequences.

joel

-Original Message-
From: Octavian Rasnita [mailto:[EMAIL PROTECTED]]
Sent: 04 June 2002 07:03
To: [EMAIL PROTECTED]
Subject: Why using use strict;


Hi all,

I know why I should use "use strict;"   but what happen if I use "use
strict;" then if the code is OK, I delete this line?


Shouldn't it work the same without this line if the code has no problems?

Thanks.

Teddy,
[EMAIL PROTECTED]



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




beginners-cgi@perl.org

2002-06-05 Thread kevin christopher

Yes, you can call subroutines either way, with or without the "&".
The only case when the subroutine must be prefixed with an
ampersand is, I believe, when you're assigning a reference
variable, eg:

$reference_x = \&subroutine_y;

But that's another story.

Kevin


-- Original Message --
From: "Octavian Rasnita" <[EMAIL PROTECTED]>
Date:  Tue, 4 Jun 2002 21:06:19 +0300

>Hi all,
>
>I've seen some subroutines are ran without the & sign in front of the
>subroutine name, like:
>
>subroutine_name;
>instead of
>&subroutine_name;
>
>Is it the same thing or there is a difference?
>
>Thank you.
>
>
>Teddy,
>[EMAIL PROTECTED]
>
>
>
>-- 
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]