[15920] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3333 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jun 12 18:10:58 2000

Date: Mon, 12 Jun 2000 15:10:27 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <960847827-v9-i3333@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 12 Jun 2000     Volume: 9 Number: 3333

Today's topics:
    Re: Larry Rosler interview on perl.com! <htp@mac.com>
    Re: Larry Rosler interview on perl.com! <care227@attglobal.net>
    Re: Larry Rosler interview on perl.com! <dan@tuatha.sidhe.org>
    Re: Larry Rosler interview on perl.com! <dan@tuatha.sidhe.org>
    Re: Larry Rosler interview on perl.com! (Bart Lateur)
    Re: module for MsAccess database? <gellyfish@gellyfish.com>
    Re: Mystery Regex [long] <mc@backwoods.org>
    Re: Mystery Regex [long] <uri@sysarch.com>
    Re: Mystery Regex <godzilla@stomp.stomp.tokyo>
    Re: Mystery Regex <tina@streetmail.com>
    Re: Mystery Regex <aqumsieh@hyperchip.com>
    Re: Mystery Regex <mc@backwoods.org>
    Re: Mystery Regex <godzilla@stomp.stomp.tokyo>
    Re: Mystery Regex <mc@backwoods.org>
    Re: Mystery Regex <godzilla@stomp.stomp.tokyo>
        Need to reload program after a sleep period <jbishop@fore.com>
    Re: Need to reload program after a sleep period <sariq@texas.net>
    Re: Need to reload program after a sleep period (Clinton A. Pierce)
    Re: New Window <gellyfish@gellyfish.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Tue, 13 Jun 2000 03:54:34 +0930
From: Henry <htp@mac.com>
Subject: Re: Larry Rosler interview on perl.com!
Message-Id: <htp-047766.03543413062000@news.metropolis.net.au>

In article <3944abe3.1173582@news.skynet.be>, bart.lateur@skynet.be 
(Bart Lateur) wrote:

>> That said, it would be a great idea to have URLs like the one above 
>> featured on a website somewhere, along with some sort of complexity 
>> rating so the visiting newbie can jump into the pool at the _shallow_ 
>> end rather than accidentally plunging into the deep end.
>> 
>> ...but preferably hosted on a dedicated Perl site, without all the
>> ads, and with more room for descriptors.
>> 
>> "The one and only URL a Perl newbie would ever need."
>> 
>> Or does such a beast already exist?
> 
> <www.perl.com> is going in that direction. It has a few pointers to
> tutorials, but this particular site isn't listed (yet).
> 
> I'm not sure about the entry level of the pointers. All sites listed
> have been screened, though.

I was thinking something along the lines a feedback mechanism.  When you 
click on one of the links, a frameset is created which has a tiny (20px 
or so) frame at the top/bottom which has feedback options.

"Did you find this site () Easy, () Alright, or () Hard to understand?"

Something like that.  When you're done with the site, you fill in the 
feedback frame, click the sumbit button, and the data gets returned back 
to perl.com (or wherever).

Aggregate statistics are used to rank the sites according to "Ease of 
Comprehension" or some-such metric, instead of the current, alphabetic 
listing.

Maybe this is even a worthy use of frames!  ;^)

Henry.


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

Date: Mon, 12 Jun 2000 14:22:51 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: Larry Rosler interview on perl.com!
Message-Id: <39452A7B.4E21BE95@attglobal.net>

Henry wrote:
> 
> I see absolutely no reason why compiler extensions should be allowed at
> all.  If a company wants added functionality, they can simply put it in
> a module (Perl, C, precompiled, not, whatever).
> 
> Is this doable?

Nope.  I don't think so.  Its not doable now.  The source to perl 
is waiting out there for someone to add soemthing to it and call
it Pearl or pear or maybe just earl.  Maybe earl would catch on
and become very popular.  But this totally misses the point.  

Which is....  the _language_ needs to be standardized, not the 
interpreter.  Once the language is set in stone (or the base line 
for that language) then two things happen.  The first is that 
what is already in place is formalized.  The second  is that the 
language continues to grow on a new, sturdy foundation.  

It can't be a bad thing.  It can only be a good thing.  Standards
don't restrict growth.  The enforce a minimal set of functionality.
The difference there is vital to the discussion.


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

Date: Mon, 12 Jun 2000 18:56:44 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: Larry Rosler interview on perl.com!
Message-Id: <Mna15.212$Us2.395@news1.rdc1.ct.home.com>

Henry <htp@mac.com> wrote:
> In article <co715.111468$hT2.435404@news1.rdc1.ct.home.com>, Dan 
> Sugalski <dan@tuatha.sidhe.org> wrote:

>>>> language standardization merely specifies a reliable minimum language
>>>> subset which *must* be implemented and behave in particular ways.  
>>>> Each vendor may offer extensions, so long as they don't interfere
>>>> with the core subset.
>> 
>>> Let's take a few lessons from recent history, folks:
>>>
>>> Vendor specific extensions ALWAYS interfere with the core subset.
>>> HTML and JavaScript and Java (and ...) proved that.
>> 
>> Actually you can go further back than this. GCC's had its own set of
>> extensions to C that were far more significantly off-spec than anything 
>> M$ ever did to Java. It could handle the standard code of the day
>> (either K&R or ANSI, depending on when you look) but had a number
>> of language extensions that'll get you non-portable code if you
>> use 'em.

> Ok, so multiple precendents have been set.  Third-party compilers 
> clearly get abused.

> How can we make sure this never happens to Perl?

Well, you could declare as part of the standard that only Larry or his
designated sucessor can make fundamental language changes, but that
requires having a real standards body with teeth and trademark law and
such behind it.

I don't much see the point, though, honestly. So someone extends perl with
new keywords that aren't in the standard. Big deal. It's not like p5p
doesn't already do this with some (albeit slow and carefully considered)
regularity.

					Dan


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

Date: Mon, 12 Jun 2000 19:00:56 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: Larry Rosler interview on perl.com!
Message-Id: <Ira15.239$Us2.395@news1.rdc1.ct.home.com>

Henry <htp@mac.com> wrote:
> In article <3944F3AF.F1A2C6E0@attglobal.net>, Drew Simonis 
> <care227@attglobal.net> wrote:

>>> What perl implementations exist with differing behaviors?  I thought 
>>> that there was a single perl source tree which was then compiled on
>>> each platform.  If that is the case, then the base perl code is the
>>> 'standard'.  
>> 
>> Yes, there is one interpreter, which is wonderfull.

> Assuming the proponents of standardisation get their way, is there any 
> way we can 'rig it' to _prevent_ third parties from developing their own 
> compilers, which support their proprietary extensions, and plunging us 
> into a siuation akin to the web?

I think htis is a bad idea. I think Larry Wall would too, though whether
he thinks it's a worse idea than having a solid standards document is
another issue. (I doubt he'd have a problem with the document, though.
Official sanction of the document, yes. But the doc itself? Doubt it)

> Specifically, and bluntly, is there a way to stop MICROSOFT from humping 
> the camel?

Specifically targetting microsoft's silly. Besides, as far as perl is
concerned I expect a number of software vendors would be just as bad if
not worse.

> I see absolutely no reason why compiler extensions should be allowed at 
> all.  If a company wants added functionality, they can simply put it in 
> a module (Perl, C, precompiled, not, whatever).

There's a lot you can't do without messing with the lexer/parser or other
assorted under-the-hood bits. Building footer formats, for example, would
require this, as would some other things. True, a lot can be done with
modules, but you couldn't implement, say, "use Python" with them.

					Dan


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

Date: Mon, 12 Jun 2000 19:12:36 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Larry Rosler interview on perl.com!
Message-Id: <394735f9.3439293@news.skynet.be>

Henry wrote:

>> GCC's had its own set of
>> extensions to C that were far more significantly off-spec than anything 
>> M$ ever did to Java.
>
>Ok, so multiple precendents have been set.  Third-party compilers 
>clearly get abused.
>
>How can we make sure this never happens to Perl?

By not making it an ANSI language. There: full circle.

-- 
	Bart.


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

Date: 12 Jun 2000 21:33:21 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: module for MsAccess database?
Message-Id: <8i3heh$i6t$1@orpheus.gellyfish.com>

On Tue, 6 Jun 2000 11:45:46 -0400 Soetjianto wrote:
> Can we have the Access database on Linux and use DBD::ODBC? Is there an
> Access ODBC driver for Linux?
> 

No.  Ask in comp.databases.ms-access about it if you want a more 
convincing answer.

/J\
-- 
** This space reserved for venue sponsor for yapc::Europe **
              <http://www.yapc.org/Europe/> 


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

Date: Mon, 12 Jun 2000 14:50:41 -0400
From: MC <mc@backwoods.org>
Subject: Re: Mystery Regex [long]
Message-Id: <39453101.936E3985@backwoods.org>

Tad McClellan wrote:
>
> Looks like a bug to me.
> 
> Match fails with 5.6.
> 
> Match succeeds with 5.005_03.
>

Thanks, thats the first post that addresses the actual problem.

The structures in evidence in the original post, as well as the code, is
necessary to simulate the conditions in the real program and to show several
variations in testing.

Several asked about the @order{@order} = @order. This creates a hash %order with
keys from @orders and values from the same. This is there as a quick way to make
a hash from a single data set.

Upon further testing: (modifyied code below)

with version 5.005_02 all four tests match, as they should; however with version
5.06 only the test that does not test for the final field, and has the tested
fields filled, succeeds.

Would appreciate any ideas on this bug. And help on how to report this bug. I
think the code below is the minimum to properly demonstrate this bug.

MC

#-----[ Code Start ]-----#
#!/usr/bin/perl

print "Content-type: text/html\n\n";
print "<pre>\n";
print "Version: $]\n";

$x = ",";

%order = (
	"shipname" => "shipname",
	"shipaddr1" => "shipaddr1",
	"shipaddr2" => "shipaddr2"
);

$_ = "custnum,db,item,qty,cardtype,cardnum,shipname,shipaddr1,shipaddr2";

($test) = /^(?:[^$x]*$x){6,6}($order{shipname}$x$order{shipaddr1}$x)/;
print "Match Addr1:\n[$_]\n[$test]\n\n";

($test) =
/^(?:[^$x]*$x){6,6}($order{shipname}$x$order{shipaddr1}$x$order{shipaddr2})/;
print "Match Addr1 & 2:\n[$_]\n[$test]\n\n";

$order{shipname} = "";
$order{shipaddr1} = "";
$order{shipaddr2} = "";

$_ = "custnum,db,item,qty,cardtype,cardnum,,,";

($test) = /^(?:[^$x]*$x){6,6}($order{shipname}$x$order{shipaddr1}$x)/;
print "Match Blank Addr1:\n[$_]\n[$test]\n\n";

($test) =
/^(?:[^$x]*$x){6,6}($order{shipname}$x$order{shipaddr1}$x$order{shipaddr2})/;
print "Match Blank Addr1 & 2:\n[$_]\n[$test]\n\n";

print "</pre>\n";
#-----[  Code End  ]-----#

#-----[ Results Version 5.005_02 ]-----#
Version: 5.00502
Match Addr1:
[custnum,db,item,qty,cardtype,cardnum,shipname,shipaddr1,shipaddr2]
[shipname,shipaddr1,]

Match Addr1 & 2:
[custnum,db,item,qty,cardtype,cardnum,shipname,shipaddr1,shipaddr2]
[shipname,shipaddr1,shipaddr2]

Match Blank Addr1:
[custnum,db,item,qty,cardtype,cardnum,,,]
[,,]

Match Blank Addr1 & 2:
[custnum,db,item,qty,cardtype,cardnum,,,]
[,,]
#-----[ End Results ]-----#

#-----[ Results Version 5.06 ]-----#
Version: 5.006
Match Addr1:
[custnum,db,item,qty,cardtype,cardnum,shipname,shipaddr1,shipaddr2]
[shipname,shipaddr1,]

Match Addr1 & 2:
[custnum,db,item,qty,cardtype,cardnum,shipname,shipaddr1,shipaddr2]
[]

Match Blank Addr1:
[custnum,db,item,qty,cardtype,cardnum,,,]
[]

Match Blank Addr1 & 2:
[custnum,db,item,qty,cardtype,cardnum,,,]
[]
#-----[ End Results ]-----#


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

Date: Mon, 12 Jun 2000 19:13:57 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Mystery Regex [long]
Message-Id: <x7zooq90gb.fsf@home.sysarch.com>

>>>>> "M" == MC  <mc@backwoods.org> writes:

  M> Several asked about the @order{@order} = @order. This creates a
  M> hash %order with keys from @orders and values from the same. This
  M> is there as a quick way to make a hash from a single data set.

	@is_an_order{ @order } = () ;

is simpler and much more readable. using the same name for the hash and
array is not a good idea. how you use that hash is important. the
above line is only meant to be used with exists. this can be used in any
boolean test:

	@is_an_order{ @order } = (1) x @order ;

assigning the values of @order is not smart since you could have a false
value and fail a boolean test (but not an exists test).

for much more see my hash slice tutorial at:

http://www.sysarch.com/perl/tutorials/hash_slices.txt

uri

-- 
Uri Guttman  ---------  uri@sysarch.com  ----------  http://www.sysarch.com
SYStems ARCHitecture, Software Engineering, Perl, Internet, UNIX Consulting
The Perl Books Page  -----------  http://www.sysarch.com/cgi-bin/perl_books
The Best Search Engine on the Net  ----------  http://www.northernlight.com


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

Date: Mon, 12 Jun 2000 11:12:41 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Mystery Regex
Message-Id: <39452819.262BDDD5@stomp.stomp.tokyo>

MC wrote:
 
> Ok im totally stumped. I have tried every debug trick
> I can think of and still cant tell why this regex aint
> matching right (or is it?).

> Please someone tell me why only the 2nd of these 
> four matches is matching....

(snipped a lot of regex stuff)

Mr. MC, if you don't mind some well intended advice,
a type of advice with hopes of offering an alternative
which you might find delightful, dump the regex method.

You will find some printed results and a very basic
simple test script in closing. This test script well
exemplifies another approach to this, a method which
is literally unlimited in configuration. What you 
can do with this method, as always, is only limited
by your imagination and willingness to roll up your
sleeves and go to work.

For myself personally, I would write my own read and
parse routine, then incorporate this error checking
right into my read and parse. This is significantly
more efficient, faster and easier to write than
using cgi.pm for read and parse. However, this is
a matter of personal choice.

Basic concept is to grab your input form action
variables, create an array, check each input
variable for 'content' of whatever, at least
content rather than blank. If one or more input
variable is empty, an error routine kicks in.

Some notes for you. This is a very simple version
of unlimited possibilities. With this, you can
stop all action with the first missing variable,
continue on and present an error message, with
your form action reprinted with all available
data pre-filled in via hidden fields. You could
redirect to an error page... lots of possibilities.
This script is not intended for copy and paste. It
is intended to show principles and methods.

Should you wish to get real fancy, you could include
some simple regex checking for basic format for
an address, for a state name, zip code.. ad nauseam.

I have exemplified a couple of possible custom features
by simulating a form action print and, a more subtle
less noticable feature, error checking of the error
checking sub-routine itself .. if (!(fubar)) ..etc.

Look this over. This is an alternative to regex methods
which might interest you, might not. If you go with
something like this, look into writing your own read and
parse, address security and dump cgi.pm for this more
easy to custom method. Again, personal choice there.


Godzilla!



PRINTED RESULTS
_______________


 Test One: 

Kiralynne D. Elitist 

2400 Snob Hill Drive 

Rivercity 

Californicated 



 Test Two:

Kiralynne D. Elitist 

[ Error: Address is missing ] 

Rivercity 

Californicated 

*** Form Action Is Printed Here *** 


 Test Three:

Kiralynne D. Elitist 

2400 Snob Hill Drive 

Rivercity 

[ Error: State is missing ] 

*** Form Action Is Printed Here *** 


END TEST 




TEST SCRIPT
___________


#!/usr/local/bin/perl

print "Content-Type: text/plain\n\n";


## TEST ONE

print " Test One: \n\n";

$in{Name} = "Kiralynne D. Elitist";
$in{Address} = "2400 Snob Hill Drive";
$in{City} = "Rivercity";
$in{State} = "Californicated";

&Test_It;


## TEST TWO

print "\n\n Test Two:\n\n";

$in{Name} = "Kiralynne D. Elitist";
$in{Address} = "";
$in{City} = "Rivercity";
$in{State} = "Californicated";

&Test_It;


## TEST THREE

print "\n\n Test Three:\n\n";

$in{Name} = "Kiralynne D. Elitist";
$in{Address} = "2400 Snob Hill Drive";
$in{City} = "Rivercity";
$in{State} = "";

&Test_It;

## END TESTING

print "\n\nEND TEST \n\n";


sub Test_It

 {
  local (@Array) = ($in{Name}, $in{Address}, $in{City}, $in{State});
  local ($uh_oh);

  foreach $element (@Array)
   {
    if ($element eq "")
     { &Error ($element); $uh_oh = "oops"; }
    else
     { print "$element \n\n"; }
   }
  if ($uh_oh)
   { &Print_Form_Action; }
 }


sub Error 

 { ##  Error

  local %ERROR;

  $ERROR{$in{Name}} = "Name is missing";

  $ERROR{$in{Address}} = "Address is missing";  

  $ERROR{$in{City}} = "City is missing";

  $ERROR{$in{State}} = "State is missing";

  local ($fubar) = $ERROR{$_[0]};

  if (!($fubar)) 
   {
    $fubar = "This Script Is FUBAR.";
   }

  print "[ Error: $fubar ] \n\n";


 } ##  Error


sub Print_Form_Action

 { print "*** Form Action Is Printed Here *** \n"; }


exit;


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

Date: 12 Jun 2000 18:57:21 GMT
From: Tina Mueller <tina@streetmail.com>
Subject: Re: Mystery Regex
Message-Id: <8i3bqh$3tmj6$3@fu-berlin.de>

hi,

Swee Heng <sweeheng@usa.net> wrote:

>> $_ = "custnum,db,item,qty,cardtype,cardnum,shipname,shipaddr1,shipaddr2";
>> @order = split($x,$_);
>> @order{@order} = @order;

> What is that last line doing? Creating a hash where the keys eq values? You
> probably meant:
>   $order{$_} = $_ for @order;

eh? why that? does that make any difference?
then we have a hash where the keys and values are
equal, too. and
@order{@order} = @order;
is probably quicker. (i'm not sure, have not 
benchmarked it...)

tina


-- 
http://www.tinita.de \  enter__| |__the___ _ _ ___
tina's moviedatabase  \     / _` / _ \/ _ \ '_(_-< of
search & add comments  \    \ _,_\ __/\ __/_| /__/ perception


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

Date: Mon, 12 Jun 2000 18:58:34 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: Mystery Regex
Message-Id: <7aitvebuay.fsf@merlin.hyperchip.com>


"Swee Heng" <sweeheng@usa.net> writes:

> > #----[ Code Start ]----
> >
> > $x = ",";
> 
> Why can't you just use , or \, in the code below?

Maybe the OP decides the value of $x on the fly.

> > $_ = "custnum,db,item,qty,cardtype,cardnum,shipname,shipaddr1,shipaddr2";
> > @order = split($x,$_);
> > @order{@order} = @order;
> 
> What is that last line doing? Creating a hash where the keys eq values? You
> probably meant:
>   $order{$_} = $_ for @order;

Which does the same as what the OP did, except it's much slower. Learn
about hash slices. They have been beaten to death on this ng in the past
couple of weeks.

But I agree that this hash is not particularly useful, except if the OP
wants to use exists() in some way.

--Ala


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

Date: Mon, 12 Jun 2000 14:58:57 -0400
From: MC <mc@backwoods.org>
Subject: Re: Mystery Regex
Message-Id: <394532F1.3B2B6D80@backwoods.org>

Thanks but your code doesnt even come close to the actual intent of the regex in
question. The sample code posted is only to show that certain conditions dont
match as they should. In the actual code, the regex is to grep records from a
flatfile based on the name/addr1/addr2 fields. In other words, something
specificly suited for grep.

MC

"Godzilla!" wrote:
> 
> MC wrote:
> 
> > Ok im totally stumped. I have tried every debug trick
> > I can think of and still cant tell why this regex aint
> > matching right (or is it?).
> 
> > Please someone tell me why only the 2nd of these
> > four matches is matching....
> 
> (snipped a lot of regex stuff)
> 
> Mr. MC, if you don't mind some well intended advice,
> a type of advice with hopes of offering an alternative
> which you might find delightful, dump the regex method.
> 
> You will find some printed results and a very basic
> simple test script in closing. This test script well
> exemplifies another approach to this, a method which
> is literally unlimited in configuration. What you
> can do with this method, as always, is only limited
> by your imagination and willingness to roll up your
> sleeves and go to work.
> 
> For myself personally, I would write my own read and
> parse routine, then incorporate this error checking
> right into my read and parse. This is significantly
> more efficient, faster and easier to write than
> using cgi.pm for read and parse. However, this is
> a matter of personal choice.
> 
> Basic concept is to grab your input form action
> variables, create an array, check each input
> variable for 'content' of whatever, at least
> content rather than blank. If one or more input
> variable is empty, an error routine kicks in.
> 
> Some notes for you. This is a very simple version
> of unlimited possibilities. With this, you can
> stop all action with the first missing variable,
> continue on and present an error message, with
> your form action reprinted with all available
> data pre-filled in via hidden fields. You could
> redirect to an error page... lots of possibilities.
> This script is not intended for copy and paste. It
> is intended to show principles and methods.
> 
> Should you wish to get real fancy, you could include
> some simple regex checking for basic format for
> an address, for a state name, zip code.. ad nauseam.
> 
> I have exemplified a couple of possible custom features
> by simulating a form action print and, a more subtle
> less noticable feature, error checking of the error
> checking sub-routine itself .. if (!(fubar)) ..etc.
> 
> Look this over. This is an alternative to regex methods
> which might interest you, might not. If you go with
> something like this, look into writing your own read and
> parse, address security and dump cgi.pm for this more
> easy to custom method. Again, personal choice there.
> 
> Godzilla!
> 
> PRINTED RESULTS
> _______________
> 
>  Test One:
> 
> Kiralynne D. Elitist
> 
> 2400 Snob Hill Drive
> 
> Rivercity
> 
> Californicated
> 
>  Test Two:
> 
> Kiralynne D. Elitist
> 
> [ Error: Address is missing ]
> 
> Rivercity
> 
> Californicated
> 
> *** Form Action Is Printed Here ***
> 
>  Test Three:
> 
> Kiralynne D. Elitist
> 
> 2400 Snob Hill Drive
> 
> Rivercity
> 
> [ Error: State is missing ]
> 
> *** Form Action Is Printed Here ***
> 
> END TEST
> 
> TEST SCRIPT
> ___________
> 
> #!/usr/local/bin/perl
> 
> print "Content-Type: text/plain\n\n";
> 
> ## TEST ONE
> 
> print " Test One: \n\n";
> 
> $in{Name} = "Kiralynne D. Elitist";
> $in{Address} = "2400 Snob Hill Drive";
> $in{City} = "Rivercity";
> $in{State} = "Californicated";
> 
> &Test_It;
> 
> ## TEST TWO
> 
> print "\n\n Test Two:\n\n";
> 
> $in{Name} = "Kiralynne D. Elitist";
> $in{Address} = "";
> $in{City} = "Rivercity";
> $in{State} = "Californicated";
> 
> &Test_It;
> 
> ## TEST THREE
> 
> print "\n\n Test Three:\n\n";
> 
> $in{Name} = "Kiralynne D. Elitist";
> $in{Address} = "2400 Snob Hill Drive";
> $in{City} = "Rivercity";
> $in{State} = "";
> 
> &Test_It;
> 
> ## END TESTING
> 
> print "\n\nEND TEST \n\n";
> 
> sub Test_It
> 
>  {
>   local (@Array) = ($in{Name}, $in{Address}, $in{City}, $in{State});
>   local ($uh_oh);
> 
>   foreach $element (@Array)
>    {
>     if ($element eq "")
>      { &Error ($element); $uh_oh = "oops"; }
>     else
>      { print "$element \n\n"; }
>    }
>   if ($uh_oh)
>    { &Print_Form_Action; }
>  }
> 
> sub Error
> 
>  { ##  Error
> 
>   local %ERROR;
> 
>   $ERROR{$in{Name}} = "Name is missing";
> 
>   $ERROR{$in{Address}} = "Address is missing";
> 
>   $ERROR{$in{City}} = "City is missing";
> 
>   $ERROR{$in{State}} = "State is missing";
> 
>   local ($fubar) = $ERROR{$_[0]};
> 
>   if (!($fubar))
>    {
>     $fubar = "This Script Is FUBAR.";
>    }
> 
>   print "[ Error: $fubar ] \n\n";
> 
>  } ##  Error
> 
> sub Print_Form_Action
> 
>  { print "*** Form Action Is Printed Here *** \n"; }
> 
> exit;

-- 
---------------------------------------------------------------------
My email address(s) are my private property.  They are NOT to be used
or recorded for ANY reason without my explicit permission.  Disregard
of this statement is in violation of federal privacy & copyright law.
---------------------------------------------------------------------
The new Decade/Century/Millennium doesnt start until the year 2001 !!
Lets make the year 2000, the last year of the Millennium, a good one!
--------------------------------------------+------------------------
                                            |
       <-- THIS SPACE FOR RENT -->          |    Question Reality
         advertise~backwoods.org            |
                                            |
     Time is nature's way of keeping        |  If at first you don't
     everything from happening at once      |  succeed...  REBOOT!
                                            |
--------------------------------------------+------------------------


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

Date: Mon, 12 Jun 2000 12:09:47 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Mystery Regex
Message-Id: <3945357B.F083C628@stomp.stomp.tokyo>

MC wrote:
 
> Thanks but your code doesnt even come close 
> to the actual intent of the regex in question.
> The sample code posted is only to show that 
> certain conditions dont match as they should. 
> In the actual code, the regex is to grep records
> from a flatfile based on the name/addr1/addr2 fields.
> In other words, something specificly suited for grep.

Yes, I read this now with subsequent articles
arriving affording a clearer explanation. You 
have a quite a challenge on your hands trying 
work around buggy Perl 5.

There is an old adage to which I subscribe,

KISS, Keep It Simple Silly.

Might be you will have to develop a more
simple method to keep Perl 5 from puking.

I do wish you luck on this and in maintaining
some portability for your script.


Godzilla!


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

Date: Mon, 12 Jun 2000 15:40:39 -0400
From: MC <mc@backwoods.org>
Subject: Re: Mystery Regex
Message-Id: <39453CB6.2AB75AA7@backwoods.org>

Would you belive that this regex IS simple compared to what I did have. You dont
wanna see my spaghetti code (referenced in other threads) from the original
program. If I knew what perl was on the end-users machine (program written for
someone else) I could adjust accordingly. What ive done so far is just drop the
final $x$order{shipaddr2} from the regex and it works fine. Just wont sort or
grep on the city/state/zip in the shipaddr2 field. This shouldnt be a problem
anyway.

oh well, this has to be ported to php and or rdbms soon anyway.

MC

"Godzilla!" wrote:
>
<snip> 
>
> Might be you will have to develop a more
> simple method to keep Perl 5 from puking.
> 
<snip>
>
> Godzilla!

-- 
---------------------------------------------------------------------
My email address(s) are my private property.  They are NOT to be used
or recorded for ANY reason without my explicit permission.  Disregard
of this statement is in violation of federal privacy & copyright law.
---------------------------------------------------------------------
The new Decade/Century/Millennium doesnt start until the year 2001 !!
Lets make the year 2000, the last year of the Millennium, a good one!
--------------------------------------------+------------------------
                                            |
       <-- THIS SPACE FOR RENT -->          |    Question Reality
         advertise~backwoods.org            |
                                            |
     Time is nature's way of keeping        |  If at first you don't
     everything from happening at once      |  succeed...  REBOOT!
                                            |
--------------------------------------------+------------------------


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

Date: Mon, 12 Jun 2000 20:09:46 GMT
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Mystery Regex
Message-Id: <394543A1.CD839886@stomp.stomp.tokyo>

MC wrote:
 
> Would you belive that this regex IS simple
> compared to what I did have. You dont wanna
> see my spaghetti code (referenced in other 
> threads) from the original program. If I knew
> what perl was on the end-users machine 
> (program written for someone else) I could
> adjust accordingly. What ive done so far is
> just drop the final $x$order{shipaddr2} from
> the regex and it works fine. Just wont sort or
> grep on the city/state/zip in the shipaddr2 field.
> This shouldnt be a problem anyway.

> oh well, this has to be ported to php and or 
> rdbms soon anyway.


You have indirectly raised some pertinent issues
to other threads; portability.

Fairly often I read problems like this with
one version of Perl 5 not being compatible
with another, usually a more recent version.

My work is developed under Perl 5.003 to
give me a better chance at portability.
An ideal situation for me and for this
issue of portability, would be to develop
all of my scripts under a Perl 4 system.
This eliminates almost all portability
issues, related to Perl 5 usage. This
is why I tend to stick with Perl 4 or
early versions of Perl 5; portability.

Another related issue is many here run
the latest and greatest (?) version of
Perl 5 and, afford advice based on code
constructed for use under the latest
version of Perl 5. I test this code on
my Perl 5.003 version. More often than
not, it crashes. In this sense, advice
coming out of this group, based on the
latest version of Perl 5, is bad advice.

My premise for this being bad advice
is very few servers run the latest
version of Perl 5. Many holler about
telling your server to upgrade. This
is such unrealistic advice, it is quite
stupefying. Servers aren't going to
upgrade, which involves expense, lot
of man-hours and some risks, they are
not going to upgrade unless there is
a significant profit motivation. This
is reality. Money talks. BS walks.
There is very little profit motivation
for servers to offer Perl/CGI. This
is evidenced by how hard it is to find
a server with these features.

All these more recent changes in Perl,
have reduced Perl's usability. Upgrading
Perl has clobbered it, from a realistic
point of view. It's a mess for sure.
Portability is quickly approaching zero,
unless you write in Perl 4, of course!

There is a bright note on this. A positive
final analysis is buggy Perl 5 is producing
better programmers. This is true for those,
like you, who have to figure out ways to
get around bugs with Perl 5; you are a
better more imaginative programmer.

However, Perl 4 produced the best of Perl
programmers. Perl 4 doesn't babysit and
will eat your lunch if you make a mistake
in logic or are lax on security.

So, maybe there is some hope for this
new generation of copy and paste babies.
Buggy Perl 5 might just force them to
learn some true programming rather than
developing excellent talents in copy
and paste technology.

Wishing you luck again and, spaghetti
code is best served with red wine along
with a side of garlic bread.

Godzilla!


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

Date: Mon, 12 Jun 2000 14:26:38 -0400
From: Jeff Bishop <jbishop@fore.com>
Subject: Need to reload program after a sleep period
Message-Id: <39452B5E.EBB68B54@fore.com>

I'm new to Perl, and I've been searching for this probably really easy
answer that I need....

I have put an "if" command into my script saying for the program to
sleep for 10 minutes if it is triggered to.  At the end of that ten
minutes, I need it to try running the script again from the start, and I
don't know which command to use.

Could someone tell me which code to use or point me in the right
direction (good links for beginner's questions?)

Thanks,

Jeff



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

Date: Mon, 12 Jun 2000 14:01:08 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: Need to reload program after a sleep period
Message-Id: <39453374.1B467C17@texas.net>

Jeff Bishop wrote:
> 
> I'm new to Perl, and I've been searching for this probably really easy
> answer that I need....
> 
> I have put an "if" command into my script saying for the program to
> sleep for 10 minutes if it is triggered to.  At the end of that ten
> minutes, I need it to try running the script again from the start, and I
> don't know which command to use.

Well, you could use 'goto', but it is *very* rarely the best way (I've
been using Perl frequently for ~6 years, and *never*, to my best
recollection,  have I used 'goto').

You probably want to use subroutines and/or loops.

perldoc perlsub
perldoc perlsyn
 
> Could someone tell me which code to use or point me in the right
> direction (good links for beginner's questions?)

perldoc perldoc
perldoc perl

- Tom


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

Date: Mon, 12 Jun 2000 19:38:55 GMT
From: clintp@geeksalad.org (Clinton A. Pierce)
Subject: Re: Need to reload program after a sleep period
Message-Id: <j%a15.1$xB1.253@news1.rdc1.mi.home.com>

[Posted and mailed]

In article <39452B5E.EBB68B54@fore.com>,
	Jeff Bishop <jbishop@fore.com> writes:
> I have put an "if" command into my script saying for the program to
> sleep for 10 minutes if it is triggered to.  At the end of that ten
> minutes, I need it to try running the script again from the start, and I
> don't know which command to use.

Sounds kind of silly, but if that's what you really want to do...

	exec("scriptname");
	die "Cannot re-exec scriptname: $!";

Would fit the bill.  Now this is a complete (and I mean COMPLETE) restart.
This is the Unix equivalent of a "do over".   In fact, try:

	exec($0);  # This might work too, and you don't have to 
		   # hardcode the scriptname...

Your script will be recompiled, all variables and structures will be 
cleared, etc... But this is what you asked for.

-- 
    Clinton A. Pierce              Teach Yourself Perl in 24 Hours! 
  clintp@geeksalad.org         for details see http://www.geeksalad.org
"If you rush a Miracle Man, 
	you get rotten Miracles." --Miracle Max, The Princess Bride


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

Date: 12 Jun 2000 21:06:32 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: New Window
Message-Id: <8i3fs8$a9k$1@orpheus.gellyfish.com>

On Thu, 08 Jun 2000 14:20:33 GMT SteveSingletary wrote:
> (Abigail Wrote :)
>>And stop posting in Jeopardy style. It makes lizards look smarter than you.
> ---   You're so funny - grow up and get a life!  A piss poor personality can
> make a lizard better than you!

Oh sure, look I've tried the lizards as programmers and frankly I'm not
impressed, OK its quite handy that they eat the flies and those boggly
eyes mean they can look at two screens at once, but they arent heavy enough
to press the keys on the keyboards we use and that green clashes with the
decor in the office.  Given the choice between Abigail and a bunch of
Lizards I'd take the Abigail. You'd only getting a look in if they sent
a bunch of Alligators by mistake - its a little tricky explaining to them
how to use the Luncheon Vouchers.

/J\
-- 
** This space reserved for venue sponsor for yapc::Europe **
              <http://www.yapc.org/Europe/> 


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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 V9 Issue 3333
**************************************


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