[24210] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 6402 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 14 21:06:24 2004

Date: Wed, 14 Apr 2004 18:05:07 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 14 Apr 2004     Volume: 10 Number: 6402

Today's topics:
    Re: 3x3 simple puzzle <perl@my-header.org>
    Re: Changing from C thought to Perl <rob_perkins@hotmail.com>
    Re: Changing from C thought to Perl <rob_perkins@hotmail.com>
    Re: Changing from C thought to Perl <ittyspam@yahoo.com>
    Re: Changing from C thought to Perl <xxala_qumsiehxx@xxyahooxx.com>
    Re: Changing from C thought to Perl <vetro@online.no>
    Re: Changing from C thought to Perl <rob_perkins@hotmail.com>
    Re: Changing from C thought to Perl <remorse@partners.org>
    Re: Changing from C thought to Perl <rob_perkins@hotmail.com>
    Re: Earthquake and tornado data evaluation Perl program <tadmc@augustmail.com>
    Re: Earthquake and tornado data evaluation Perl program <1usa@llenroc.ude>
    Re: eval running external script <shailesh@nothing.but.net>
    Re: fixed the bbs... <robin @ infusedlight.net>
    Re: Is there any perl script for converting XML file to <shailesh@nothing.but.net>
    Re: Object oriented gui with Perl/Tk ... how can I make <xxala_qumsiehxx@xxyahooxx.com>
        Perl script to edit crontab <jcanfield@tshmail.com>
    Re: Perl script to edit crontab <glex_nospam@qwest.invalid>
    Re: perl's severe lack of in-line comment ability <jidanni@jidanni.org>
    Re: perldoc incompetence: perlre /s <bik.mido@tiscalinet.it>
    Re: perldoc incompetence: perlre /s <vetro@online.no>
    Re: Tough (for me) regex case <skuo@mtwhitney.nsc.com>
    Re: Tough (for me) regex case <rob_perkins@hotmail.com>
        using dbi module on windows to cancel a sql query (Charles)
    Re: Where To Go For Classroom Training in CGI? <jwcorpening@verizon.net>
    Re: Where To Go For Classroom Training in CGI? <ittyspam@yahoo.com>
    Re: Where To Go For Classroom Training in CGI? <spamtrap@dot-app.org>
    Re: Where To Go For Classroom Training in CGI? (dan baker)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Wed, 14 Apr 2004 20:36:42 +0200
From: Matija Papec <perl@my-header.org>
Subject: Re: 3x3 simple puzzle
Message-Id: <ijsq70tnu2dl6gf04v1lmccrhfu6cnctn4@4ax.com>

X-Ftn-To: ctcgag@hotmail.com 

ctcgag@hotmail.com wrote:
>> >It took 2 minutes on 1.13GHz pentium III.  (30 seconds of that was
>> >generating permutations of 0..8 using my rather inefficient subroutine.)
>> >
>> >I had started righting a very complicated decision-tree process with
>> >rules for quick pruning, but I discovered that that was unnecessary
>> >because no piece has the same color/anatomy combo on it more than once.
>> >That made things much simpler.
>>
>> Nice; I would like to see your code, mine is at
>> http://globalnet.hr/~mpapec/perl/turtles.txt
>
>Because each tile doesn't have the same color/anatomy combo more than once,

Actually there are two completely same cards (5 and 6), and all other
differ.

>There is no branching.  once one tile orientation is set, all the rest must
>fall into place or be impossible.   (The code would be a lot cleaner if I
>didn't change horses midstream.)

ok, I've managed to run it,

A solution is:
4:0	1:0	5:0
9:0	3:0	8:0
2:0	6:0	7:0
A solution is:
4:0	1:0	6:0
9:0	3:0	8:0
2:0	5:0	7:0

These two are ok (5th adn 6th changed places).

A solution is:
5:0	1:0	8:0
2:1	9:1	4:1
6:1	3:1	7:1
A solution is:
6:0	1:0	8:0
2:1	9:1	4:1
5:1	3:1	7:1

(here is similar situation with these two cards)
At first I thought this one is wrong combination, but then I spoted that
when you rotate whole
-------
|5 1 8|
|2 9 4|
|6 3 7|
-------
to the left, you come to
-------
|8 4 7|
|1 9 3|
|5 2 6|
-------

which I found as a second solution. >:)



-- 
Matija


------------------------------

Date: Wed, 14 Apr 2004 19:23:44 GMT
From: Rob Perkins <rob_perkins@hotmail.com>
Subject: Re: Changing from C thought to Perl
Message-Id: <12pq70lbrou7rf709bpgm6qkljk9vik7mg@4ax.com>

anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote:

>Rob Perkins  <rob_perkins@hotmail.com> wrote in comp.lang.perl.misc:
>> Brad Baxter <bmb@ginger.libs.uga.edu> wrote:
>
>[snip]
>
>> Side effects? I've already run into one: regex's don't behave the same
>> on every platform.
>
>That sentence makes me doubt you know what you are talking about.  What
>has the different behavior of regular expressions in different languages
>to do with side effects?

Well, now that I think about it, you're right. I picked a really bad
example. 

I come from a camp of programmers who think all variables ought to be
explicitly declared, and if the language permits it, (in a way that
Perl does not), explicitly typed. I don't like side effects. I do like
code to explicitly betray exactly how it's going to behave once
compiled or interpreted. 

Someone who doesn't know Perl, but knows programming, ought to be able
to read the code, much the same way as a well-read German speaker can
make out the gist of Dutch when he reads it. 

Side effects work against that kind of readability. Using side
effects, you assume that the reader knows Perl's platform. While you
can be confident that Perl is better at cross-platform-ness than
anything else I've ever seen, can you guarantee that (for example)
Perl 6 will not break your Perl 5 code? 

Rob


------------------------------

Date: Wed, 14 Apr 2004 19:26:35 GMT
From: Rob Perkins <rob_perkins@hotmail.com>
Subject: Re: Changing from C thought to Perl
Message-Id: <kv3r709ml1o6kl9ff9hlu4jneqmb3135mh@4ax.com>

James Willmore <jwillmore@remove.adelphia.net> wrote:

>On Wed, 14 Apr 2004 02:13:10 +0000, Rob Perkins wrote:
>
>> Brad Baxter <bmb@ginger.libs.uga.edu> wrote:
>
>[ ... ]
>
>> Side effects? I've already run into one: regex's don't behave the same
>> on every platform. Side effects aren't a bad thing per se. Unless you
>> want cross platform capability. Then you're screwed.
>
>And *where* did you read this?  I've *never* had an issue with regular
>expressions across platforms.

I didn't read it. I lived it. See the "Tough (for me) regex case"
thread. 

It's not a big deal. And as I've pointed out, it was a bad example. 

Rob


------------------------------

Date: Wed, 14 Apr 2004 15:49:45 -0400
From: Paul Lalli <ittyspam@yahoo.com>
Subject: Re: Changing from C thought to Perl
Message-Id: <20040414154658.X8440@dishwasher.cs.rpi.edu>

On Wed, 14 Apr 2004, Rob Perkins wrote:

> James Willmore <jwillmore@remove.adelphia.net> wrote:
>
> >On Wed, 14 Apr 2004 02:13:10 +0000, Rob Perkins wrote:
> >
> >> Brad Baxter <bmb@ginger.libs.uga.edu> wrote:
> >
> >[ ... ]
> >
> >> Side effects? I've already run into one: regex's don't behave the same
> >> on every platform. Side effects aren't a bad thing per se. Unless you
> >> want cross platform capability. Then you're screwed.
> >
> >And *where* did you read this?  I've *never* had an issue with regular
> >expressions across platforms.
>
> I didn't read it. I lived it. See the "Tough (for me) regex case"
> thread.

Er, I just read that whole thread, on your suggestion.  What I take from
that is that you use the word 'platform' when you mean 'language'.  Perl
regular expressions are Perl regular expressions, no matter what platform.
Platform, btw, means what hardware and software your system is running.

Your issue in that thread was due to your misunderstanding that somehow
"regular expressions" are a constant that every language implements in the
same way.  They are not.  What you are terming a 'platform' of ".NET" has
nothing at all to do with Perl.

Paul Lalli



------------------------------

Date: Wed, 14 Apr 2004 20:45:05 GMT
From: "Ala Qumsieh" <xxala_qumsiehxx@xxyahooxx.com>
Subject: Re: Changing from C thought to Perl
Message-Id: <lphfc.36841$uO6.23996@newssvr29.news.prodigy.com>

"Rob Perkins" <rob_perkins@hotmail.com> wrote in message
news:12pq70lbrou7rf709bpgm6qkljk9vik7mg@4ax.com...

> I come from a camp of programmers who think all variables ought to be
> explicitly declared, and if the language permits it, (in a way that
> Perl does not), explicitly typed. I don't like side effects. I do like
> code to explicitly betray exactly how it's going to behave once
> compiled or interpreted.

Fair enough. Those are all good points.

> Someone who doesn't know Perl, but knows programming, ought to be able
> to read the code, much the same way as a well-read German speaker can
> make out the gist of Dutch when he reads it.

But can a well-read German speaker make out the gist of Chinese when he
reads it?
I don't think this argument holds if the two languages being compared have
different roots. Have you ever looked at befunge?

> Side effects work against that kind of readability. Using side
> effects, you assume that the reader knows Perl's platform. While you
> can be confident that Perl is better at cross-platform-ness than
> anything else I've ever seen, can you guarantee that (for example)
> Perl 6 will not break your Perl 5 code?

Another bad example :)
Perl6 is purposefully designed with no backward compatibility in mind. In
fact, Larry contemplated naming it something else for that reason. But,
Perl5 does not break Perl4 code. Up until and including Perl5, backward
compatibility had been a very important concern, which has led to many
unfortunate design decisions. This also means that Perl5 ought to run Perl1
code without breaking anything.

--Ala




------------------------------

Date: Wed, 14 Apr 2004 22:51:14 +0200
From: Vetle Roeim <vetro@online.no>
Subject: Re: Changing from C thought to Perl
Message-Id: <m37jwip9kt.fsf@quimby.dirtyhack.org>

* Rob Perkins
>
> Someone who doesn't know Perl, but knows programming, ought to be able
> to read the code, much the same way as a well-read German speaker can
> make out the gist of Dutch when he reads it. 

  Why? Is the same true for languages like Common Lisp? For an
  example: if I know C++, should I be able to read CL code? :)

  I'm able to read languages that are _similar_ to languages I already
  know, but at some point the difference between languages becomes too
  much, and I don't understand a thing. That's true for both
  artificial and natural languages.

  If a programmer knows C and C++, he may be able to understand _some_
  Perl code, but not everything. He would understand even less Common
  Lisp.

  Errr... I think I have a point.


[...]

-- 
#!/usr/bin/vr


------------------------------

Date: Wed, 14 Apr 2004 21:13:00 GMT
From: Rob Perkins <rob_perkins@hotmail.com>
Subject: Re: Changing from C thought to Perl
Message-Id: <o6ar70173pl29ru5bg2d0p98sn4drpfvcd@4ax.com>

Vetle Roeim <vetro@online.no> wrote:

>* Rob Perkins
>>
>> Someone who doesn't know Perl, but knows programming, ought to be able
>> to read the code, much the same way as a well-read German speaker can
>> make out the gist of Dutch when he reads it. 
>
>  Why? Is the same true for languages like Common Lisp? For an
>  example: if I know C++, should I be able to read CL code? :)

Name six useful products written for a non-programming end user, in
Common Lisp. 

>  If a programmer knows C and C++, he may be able to understand _some_
>  Perl code, but not everything. He would understand even less Common
>  Lisp.
>
>  Errr... I think I have a point.

Well *my* point is that since Perl can be organized in such a way that
a C, Pascal, Java, or BASIC programmer could easily see the algorithm,
people who share code ought to program for readability. That's "why".

Rob


------------------------------

Date: Wed, 14 Apr 2004 18:13:20 -0400
From: Richard Morse <remorse@partners.org>
Subject: Re: Changing from C thought to Perl
Message-Id: <remorse-A2E958.18132014042004@plato.harvard.edu>

In article <scrn701n7amaig8ism9l81588cblhvjrrc@4ax.com>,
 Tigerhillside <Tigerhillsider@netscape.net> wrote:

> I am trying to understand Perl and having a hard time. I was a
> pretty good C programmer, but Perl seems to make much more sense
> for the kinds of things I am doing now. But I am having problems
> making it "intuitive". From my perspective Perl seems full of
> "side effects", I do something and some pre-defined variable
> changes. 

Can you give some examples?

>I was "taught" that side effects and (essentially)
> global variables are a "bad thing". ISTM that I have to keep some
> internal (to me) table of these variables in mind when I code.

In general, everybody here advocates keeping your variables non-global 
(try posting code without properly using 'my' (and 'our' and 'local' 
where needed) and watch...).

I assume that the "global" variable you are talking about is "$_".  It's 
probably better not to think of this as a variable, but rather as a 
topic.  I seem to remember a language (perhaps it was Pascal?) which 
allowed you to do something like:

   with my_record
      begin
         a = 5; { same as my_record.a = 5 }
         b = 6; { same as my_recond.b = 6 }
      end

(I know that Pascal has this construction, although it might not be 
called "with").  $_ can be considered in the same light -- it indicates 
what the current thing we are talking about is.

In general, any place where you use $_, you can use an explicit variable 
as well:

   while(my $line = <$in>) { }
   foreach my $item (@array) { }

HTH,
Ricky

-- 
Pukku


------------------------------

Date: Wed, 14 Apr 2004 23:51:32 GMT
From: Rob Perkins <rob_perkins@hotmail.com>
Subject: Re: Changing from C thought to Perl
Message-Id: <fbar70p0i93sip90q5kar6arma06brvg77@4ax.com>

Paul Lalli <ittyspam@yahoo.com> wrote:

>Your issue in that thread was due to your misunderstanding that somehow
>"regular expressions" are a constant that every language implements in the
>same way.  

That was my expectation going into this. That's why I bothered to come
here and ask. I thought a Perl answer would be relevant to my problem.
And it was, come to think of it. 

>They are not.  What you are terming a 'platform' of ".NET" has
>nothing at all to do with Perl.

Sure it does. Perl behaves consistently across platforms, with similar
services and a similar paradigm. Since it's interpreted/JIT-ed stuff,
that means there is an execution engine. 

In the context of Java or .NET's CLR, that makes Perl5 a "platform",
by a definition you are not using, but I am.

Rob


------------------------------

Date: Wed, 14 Apr 2004 19:55:23 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Earthquake and tornado data evaluation Perl program  Apr. 14, 2004
Message-Id: <slrnc7rnbr.cao.tadmc@magna.augustmail.com>

edgrsprj <edgrsprj@ix.netcom.com> wrote:

> This report has
> been posted here in an effort go see if anyone would like to comment on a
> demonstration version of that computer program.


> evaluation Perl program can now be downloaded for free 


It may well be worth less that what you charge for it...


> For the following reason and others I believe that this program has the
                                                     ^^^^^^^^^^^^
> potential to revolutionize the science of earthquake forecasting and perhaps
> also move the science of tornado forecasting forward:


"this program" moves computer science backwards though.

Your project would be very well served by finding a programmer to
help you with the programming part.


> The program has virtually unlimited room for improvement.


You said it Bub!


> This is not a sophisticated or even well written Perl program.  As the
> documentation explains, one of my primary goals was to get something running
> as quickly as possible.


Oh. Never mind the above then.


> Also, this new program was written with a very simple structure so that
> other people could easily add new data processing routines to it without
> having to be Perl programming experts


I find that suprising in the extreme.

The code is clearly NOT written with maintainablility in mind, it
will be much much harder to modify than it needs to be.

I find your claim of "easy for non experts" to be an absurd one.


> If this program has the potential to
> reduce those casualty numbers then more could be accomplished by producing
> better looking versions of the program than by moaning and groaning about
> its present code style.


I'll point out how it could be improved.

------

Ask for all the help you can get. Lord knows you need it:

Enable warnings!

Enable strict!

------

Refactor so as to not require 47 goto statements (all the bad kind).

This looks like spaghetti code from the 1960's. Maintenance will 
be a nightmare.

------

   grep open ETDPROG.pl

open file, '< '.$fileeqdatabase;
open file, '< '.$filetests;
open fileout, '> '.$fileresults;
open filein, '< '.$filedatasm.$mo.'.txt';
open filein, '< '.$filetideci;
open filein, '< '.$filetidela;
open filein, '< '.$filetidesa;
open fileout, '> '.$fileresults;
open file, '> '.$filedisplaycontrol;


You should always, yes *always*, check the return value from open():

   open FILE, $fileeqdatabase;


You should use UPPER CASE filehandles. The program will break when
a new perl version introduces a function named file() for instance.


Thosevariablenamessurearehardtoread!

   open FILE, $file_eq_database;


------

Refactor so as to not use dozens(?) of global variables.

A single configuration hash for the config variables would make
it nicer.

   my %cf = (
              program_directory  => 'C:/ETDPROG', # forward slashes work fine
              display_prob       => 100,
              gravity_ratio      => 2.5,
              file_eq_database   => 'dataeqs.txt',
            );

-----

A mere mortal is supposed to be able to figure out what value
will be going into $offset from this code?

(word wrapped)

   $offset = 1, 
             $prsigstrength = 1,  
             1, 
             $dbsigstrength[$num] = 1*(substr $qwlin[$num - 1], 
                                              $offset, 
                                              $prsigstrength);

What's with the rabid use of the comma operator?

-----

Use a "list assignment" instead of a bazillion individual assignments.

   my($percent_to_print, $fatal_cutoff, $output_choice) = @dataline;

-----

Use unpack() instead of a bazillion individual substr()s.

   my($yr, $mo, $da) = unpack 'A4 A2 A2', $timeline;

-----

Use a hash instead of a bazillion individual if's.

   my %mon_to_num = (
      Jan  => '01',
      Feb  => '02',
      Mar  => '03',
   }

   my $mo = $mon_to_num{ $mo1 };

-----

Indent the body of code blocks so as to reveal your program's structure.

-----

Avoid using superfluous semicolons, it will only confuse people.

None of these semicolons do anything, so they should not be there:

   for $npr(1..length($outputchoice)){;

   if ($sopc eq 'o'){$num = $dbsortlon[$num1]};

   toolow:};# not an earthquake line or percentage too low



> Throughout history we have waited for scientists (I am one myself) and other
> researchers to provide us with an answer to that question.


Find a programmer to contribute to your project.

You need this a lot more than you seem to realize.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: 14 Apr 2004 23:57:21 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude>
Subject: Re: Earthquake and tornado data evaluation Perl program  Apr. 14, 2004
Message-Id: <Xns94CBCB008812asu1cornelledu@132.236.56.8>

"edgrsprj" <edgrsprj@ix.netcom.com> wrote in
news:YZcfc.7030$zj3.3864@newsread3.news.atl.earthlink.net: 

> Summary:  If all goes according to plan, the earthquake and tornado
> data evaluation Perl program discussed in this report will be made
> available to researchers, governments, disaster mitigation personnel,
> and computer programmers around the world, possibly later this week. 

Well, your program managed to make me cry. Just two samples:

print 'Loading the earthquake and warning signal database file', "\n\n";
open file, '< '.$fileeqdatabase;
@qwlin = <file>;
close file;

and

goto exit;
programerror:;
print 'program error', "\a\n";
sleep 10;
exit:;
__END__


Writing BASIC in Perl is not a good idea. Please look into how to make 
your programs better. Buying 'Learning Perl' might be a good idea.


-- 
A. Sinan Unur
1usa@llenroc.ude (reverse each component for email address)


------------------------------

Date: Wed, 14 Apr 2004 23:10:29 GMT
From: Shailesh <shailesh@nothing.but.net>
Subject: Re: eval running external script
Message-Id: <Fxjfc.14829$B%4.13790@fe2.columbus.rr.com>

> You want to catch the external program's stderr (and probably stdout too).
> See "perldoc perlipc" for how to do that.  Also look at the module
> IPC::Open2.
> 
> Reading the script in a string and executing it is what "do FILE"
> does.  That is another possibility.
> 

I can't do file descriptor redirection, like it says here:
http://iis1.cps.unizar.es/Oreilly/perl/cookbook/ch16_08.htm
because my script needs to run on windows and linux.  Open2 also only 
works on Unix systems.  I think I will try eval { do 'run_task.pl'; };

c:\Shailesh> perl -e "do something or die shamefully"
shamefully at -e line 1.

c:\Shailesh>


------------------------------

Date: Wed, 14 Apr 2004 10:28:31 -0700
From: "Robin" <robin @ infusedlight.net>
Subject: Re: fixed the bbs...
Message-Id: <c5k1uf$7nc$1@reader2.nmix.net>


> Are you sure you're not the Alaskan electrician in a new life?
>
>
hahahahahahah.....
-Robin





------------------------------

Date: Wed, 14 Apr 2004 23:18:14 GMT
From: Shailesh <shailesh@nothing.but.net>
Subject: Re: Is there any perl script for converting XML file to tab-delimited file ?
Message-Id: <WEjfc.14830$B%4.5456@fe2.columbus.rr.com>

I wrote a script for Yahoo! stores to export XML product data to 
Froogle tab-delimited format.  It puts everything into a hash first, 
so you could just insert the hash directly into your database instead 
of putting it in a tab-delimited file first.  The script is online so 
you can read it for hints.

The hardest thing to understand about XML parsing (in Perl using 
expat) is that it is event driven.  The parser reads the XML file from 
beginning to end, and then calls your predefined functions to handle 
its events, like "I found a start_tag", and "I found an end_tag".  You 
just tell it what to do for each of the events.

http://www.somacon.com/docs/code.yahoo_store_export_to_froogle.pl.php

gongwuming@hotmail.com wrote:

> Hello..
> I want to load a very big XML file to MySQL database. Because I have
> already written a script for loading a tab-delimited file to database
> (specific column to specific field of table) before, I just need to
> convert the XML file to tab-delimited format.
> Is there a perl script for solving this kind of problem?
> I tried to write one this afternoon, but i felt it is not a very easy
> problem...Can someone give a some hits on it and what XML::* module
> should I use? ( I used XML::SimpleObject, but I think it is a little
> light-weighted.)
> Thanks in advance..


------------------------------

Date: Wed, 14 Apr 2004 20:49:45 GMT
From: "Ala Qumsieh" <xxala_qumsiehxx@xxyahooxx.com>
Subject: Re: Object oriented gui with Perl/Tk ... how can I make this work?
Message-Id: <Jthfc.36843$8Y6.2130@newssvr29.news.prodigy.com>

"Nataku" <Crapnut566@yahoo.com> wrote in message
news:7e48fc99.0404062030.16d0566b@posting.google.com...
>
> sub Populate {
>   my ($self, $args) = @_;
>   $self->SUPER::Populate($args);
>
>   my $browseEntry = $cardLabFrame->BrowseEntry( -variable =>
> \$currentSet,
>                                                 -browsecmd =>
> \&refreshList )->pack( -side => 'top' );

In the spirit of TMTOWTDI, Perl/Tk allows different ways to defined
callbacks, all explained well in the Tk::callbacks pods.

    -browsecmd => [\&refreshList, $self],

Btw, there is a newsgroup that deals with Perl/Tk, comp.lang.perl.tk. Please
post pTk related questions over there.

--Ala




------------------------------

Date: Wed, 14 Apr 2004 17:45:32 -0500
From: "Jim Canfield" <jcanfield@tshmail.com>
Subject: Perl script to edit crontab
Message-Id: <107rfoe6pa7pa0a@corp.supernews.com>

Greetings,

Anyone here have perl/cgi script for editing cron events? So far the only
thing I have been able to find is the cron module in webmin, but it does too
much.  Just a thought before I start from he ground up.

Thanks.




------------------------------

Date: Wed, 14 Apr 2004 18:05:56 -0500
From: "J. Gleixner" <glex_nospam@qwest.invalid>
Subject: Re: Perl script to edit crontab
Message-Id: <otjfc.70$IQ6.103871@news.uswest.net>

Jim Canfield wrote:
> Greetings,
> 
> Anyone here have perl/cgi script for editing cron events? So far the only
> thing I have been able to find is the cron module in webmin, but it does too
> much.  Just a thought before I start from he ground up.
> 
> Thanks.
> 
> 

When looking to see if something has been done before, start with CPAN 
or Google.

http://search.cpan.org

Searching on "crontab"

http://search.cpan.org/~scottw/Config-Crontab-1.03/Crontab.pm

Much quicker than posting here and waiting for a response.

See ya


------------------------------

Date: Thu, 15 Apr 2004 05:25:27 +0800
From: Dan Jacobson <jidanni@jidanni.org>
Subject: Re: perl's severe lack of in-line comment ability
Message-Id: <87llkytfp4.fsf@jidanni.org>

I don't know what you guys are talking about with /* */. It's not on
perldoc perlsyn, and
$ perl -we 'print 5 /* c style single line comment */ ,7'
Bareword found...

Maybe -P for CPP?
$ perl -Plwe 'print 1,3, */ ,5 /* ,7'
syntax error...

P.S. perlpod is no help for _in-line_ comments.


------------------------------

Date: Wed, 14 Apr 2004 22:54:43 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: perldoc incompetence: perlre /s
Message-Id: <qjeq70tiporp7kmouqsoiln1k4rk9u08oi@4ax.com>

On Tue, 13 Apr 2004 19:00:21 -0500, l v <lv@aol.com> wrote:

>>>>today i'm writing some perl code involving regex. I wanted to find out
>>>
>>>[snip]
>>>
>>>>Fucking no mention of it. Fuck Perl and fuck Perl coders.
>>>
>>>Am I the only one seeing the contradiction?!?
>> 
>>   What he does in the privacy of his own home is none of our business.
>> 
>I thought he was talking about himself as well.

Huh?!?

I was talking about why one that says "Fuck Perl and fuck Perl coders"
should also say "today i'm writing some perl code involving regex",
only two lines above... if I don't like language xyz then I don't
program in xyz. Why should I program in xyz just to complain that xyz
sucks?!?


Michele
-- 
you'll see that it shouldn't be so. AND, the writting as usuall is
fantastic incompetent. To illustrate, i quote:
- Xah Lee trolling on clpmisc,
  "perl bug File::Basename and Perl's nature"


------------------------------

Date: Wed, 14 Apr 2004 22:59:51 +0200
From: Vetle Roeim <vetro@online.no>
Subject: Re: perldoc incompetence: perlre /s
Message-Id: <m3wu4inum0.fsf@quimby.dirtyhack.org>

* l. v.
> Vetle Roeim wrote:
>
>> * Michele Dondi
>>
[...]
>>
>>>Am I the only one seeing the contradiction?!?
>>
>>   What he does in the privacy of his own home is none of our
>>   business.  ;-)
>>
> I thought he was talking about himself as well.

  Um... Who are you talking about? Michele or Lee?


-- 
#!/usr/bin/vr


------------------------------

Date: Wed, 14 Apr 2004 13:34:31 -0700
From: Steven Kuo <skuo@mtwhitney.nsc.com>
Subject: Re: Tough (for me) regex case
Message-Id: <Pine.GSO.4.21.0404141328380.14549-100000@mtwhitney.nsc.com>

On Tue, 13 Apr 2004, Rob Perkins wrote:


(snipped)

> TMTOWDI. But it represents a case which works desirably for me under
> Perl, and generates a bit more work for me under the .NET Framework's
> regex engine. 
> 
> OK, so that leads me then to a case where this particular regex fails,
> even in the Perl implementation. Consider the case of:
> 
> The "quick" brown "fox jumped ""over""" the lazy dog.


The fragility of the (previous) solution would indicate that this
type of problem isn't best handled with regular expressions.  You
should look at different approaches as shown by others in this
thread.


> The desirable matches are:
> 
> quick
> fox jumped ""over""
> 
> but this regex returns only
> 
> quick
> 
> If I stick whitespace between the second and third quote after "over"
> then it returns:
> 
> quick
> fox jumped ""over""<space>
> 
> Again, the plain-english description is "all text between a pair of
> doublequote characters, except that paired doublequotes inside a
> quoted string are part of the match."



Your specification of the problem is also incomplete.  For example,
how would you parse this string?

    $_ = q{""""};

One can claim that no matches are to be found as the string is two
pairs of quotes; one can also equally claim that it's a single pair
of quotes enclosed within quotes.

 
> What do you think the regex will be?


Regardless, if you're just interested in regular expressions, you
may want to try;

$_ = 'The "quick" brown "fox jumped ""over""" the lazy dog.';

# very ugly:

my @arr = m/(?<!")"(?=(?:"")*(?!"))(.*?(?:(?<!")(?:"")*|(?<!")))"(?!")/g;

print join "\n", @arr;

Again, this is an (untested) solution in Perl.  Any resemblence to
 .NET is coincidental.

-- 
Hope this helps,
Steven



------------------------------

Date: Wed, 14 Apr 2004 21:01:46 GMT
From: Rob Perkins <rob_perkins@hotmail.com>
Subject: Re: Tough (for me) regex case
Message-Id: <fg9r70dq53o9l715gmvldqltjj320vaaj9@4ax.com>

Steven Kuo <skuo@mtwhitney.nsc.com> wrote:

>Your specification of the problem is also incomplete.  For example,
>how would you parse this string?
>
>    $_ = q{""""};

Depending on the implementation of regexes, based on what I've learned
here, I'd expect a single match off of that string, with no text in
it. Which is what your Perl regex delivers, it seems.

>Again, this is an (untested) solution in Perl.  Any resemblence to
>.NET is coincidental.

Works very nicely, thank you!

These 

Rob


------------------------------

Date: 14 Apr 2004 14:04:31 -0700
From: charles-leonard.couvrette@polymtl.ca (Charles)
Subject: using dbi module on windows to cancel a sql query
Message-Id: <72405e4a.0404141304.4b190735@posting.google.com>

Hey,

Is there a way to cancel a sql query on windows? I got a perl script
who is lauch from a c++ application. The script does some query on a
remote database. The user can kill the script whenever they want
(closing main appl, pressing a cancel button you kill the script). Is
there a way to tell the perl script, using dbi, to cancel the current
query before dying... I check the dbi doc:

http://search.cpan.org/~timb/DBI-1.14/DBI.pm#Signal_Handling_and_Canceling_Operations

And the cancellation work only with signals and is not "safe". It look
impossible to cancel a query on windows since there is no signals, but
I don't beleive that anyone didint encounter the same problem before!

Thanks for any help.

Charles


------------------------------

Date: Wed, 14 Apr 2004 18:39:48 GMT
From: JC <jwcorpening@verizon.net>
Subject: Re: Where To Go For Classroom Training in CGI?
Message-Id: <Uzffc.19048$d8.2924@nwrdny01.gnilink.net>

Thanks for the lessons, and I apologize for being abrasive and ignorant. 
  Realizing it as a post-facto expansion, I still believe that PERL is 
an acronym, albeit an inappropriate or misplaced one.  I'm not sure that 
the use of PERL signals incompetence, though; rather, it might more 
identify an outsider (or newbie).  Nevertheless, I will never again use 
PERL.  (Maybe I should stick with my area of expertise, neuroscience, 
and wonder what makes me contentious.)

Thanks,
-jc



------------------------------

Date: Wed, 14 Apr 2004 15:57:25 -0400
From: Paul Lalli <ittyspam@yahoo.com>
Subject: Re: Where To Go For Classroom Training in CGI?
Message-Id: <20040414155356.T8440@dishwasher.cs.rpi.edu>

On Wed, 14 Apr 2004, JC wrote:

> Thanks for the lessons, and I apologize for being abrasive and ignorant.
>   Realizing it as a post-facto expansion, I still believe that PERL is
> an acronym, albeit an inappropriate or misplaced one.  I'm not sure that
> the use of PERL signals incompetence, though; rather, it might more
> identify an outsider (or newbie).  Nevertheless, I will never again use
> PERL.  (Maybe I should stick with my area of expertise, neuroscience,
> and wonder what makes me contentious.)
>

'PERL' is absolutely an acronym, no question.  That's why it's all caps.
The name of this language, however, is not an acronym.  That's our point.
Therefore, the name of this language is not spelled "PERL".

The idea that someone writing "PERL" is either an outsider or a newbie is
absolutely correct - this is why the original point of this thread was
that one should not trust a company claiming to teach the language when
they make the very newbie mistake of calling the language "PERL".

This is also why most people in this newsgroup try to tell newbies not to
call it PERL.  Referring to the language as "PERL", as you pointed out,
indicates a newbie.  People posting answers and replies in this newsgroup
are, at the most basic, trying to educate people so that they are no
longer 'newbies'.

Paul Lalli


------------------------------

Date: Wed, 14 Apr 2004 16:20:30 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Where To Go For Classroom Training in CGI?
Message-Id: <Kf-dndKScf6dAODdRVn-gg@adelphia.com>

JC wrote:

> I'm not sure that the use of PERL signals incompetence, though

You're right - that was a bad choice of terms on my part.

> ; rather, it might more identify an outsider (or newbie).

Consider what you're saying here in the context of the original question
about finding training. Would you consider someone who's a newbie, an
outsider to the community who hasn't read the FAQ, to be a well qualified
Perl trainer? I wouldn't.

> Maybe I should stick with my area of expertise, neuroscience,
> and wonder what makes me contentious.

Relax, this isn't brain surgery. ;-)

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org


------------------------------

Date: 14 Apr 2004 13:25:09 -0700
From: botfood@yahoo.com (dan baker)
Subject: Re: Where To Go For Classroom Training in CGI?
Message-Id: <13685ef8.0404141225.1d13f2f@posting.google.com>

Glenn Catlin <gcatlin@ix.netcom.com> wrote in message news:<MPG.1ae34ebc9f3cabb49896e8@news.east.earthlink.net>...
> I work in Philadelphia.  At the job, we have no one on staff with skill 
> in Common Gateway Interface (CGI) and want to send a couple of people 
> for classroom training for it.  I found a handful of local classroom 
> training centers that offer PERL classes, but none seem to fully cover 
> CGI.  If we can't find local training, we may need to fly our folks out 
> of town for training.  Can anyone recommend a good training center in 
> the U.S. for this?
> -----------------------------

unfortunately, I have yet to hear of any decently broad training
programs that cover perl AND typical uses for CGI. perl itself is so
broad, with so many available modules and uses it would be a long
series of classes. If you want to narrow it to CGI, you can get a long
way by working through the O'Reilly "Learning Perl on win32 Systems",
and then follow with some of the cgi cookbook tutorials.

Alternatively, if you have a specific project in mind, hire a lead
programmer on a contract basis, and throw in a little extra time for
explaining things along the way so your people can maintain it.

d


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 6402
***************************************


home help back first fref pref prev next nref lref last post