Jason Balicki wrote:
Some people emailed me privately and asked that I do post
what I've come up with to the list.

I wrote this program over the course of the last week,
starting with very little perl experience (I've modified
others code, and small things like that) and acomplished
a goal that prior to last week I considered unobtainable.

Here is the current version.  I expect to continue tweaking
(one of the goals is to put the data in a database instead
of a flat text file) but otherwise the program is doing
what I want it to do.

I want to say thanks again to the guys on this list
who helped me crank out my very first, actual, useable,
from-scratch perl program.  I know it's simple, but
I'm still proud. :)

Comments are appreciated.

Anyway, it can be found here:

http://nothingimportant.net/perl-stuff/alcatel_readserial

You should really enable warnings and strict:

$ perl -Mwarnings -c alcatel_readserial
Scalar value @_[0] better written as $_[0] at alcatel_readserial line 257.
Scalar value @_[0] better written as $_[0] at alcatel_readserial line 326.
Scalar value @_[1] better written as $_[1] at alcatel_readserial line 327.
Name "main::tbs" used only once: possible typo at alcatel_readserial line 82.
alcatel_readserial syntax OK


98 if ($lograw=="yes"){

   101  if ($logerrors=="yes"){

   126      if ($lograw=="yes") {

   144          if ($logerrors=="yes"){

== is the numerical equality operator. If you want to determine if strings are equal then you have to use 'eq' instead.


You are opening and closing $csvlog six times in the program. It would probably be better to just open it once at the start of the program.




John
--
use Perl;
program
fulfillment

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to