[12384] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5984 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jun 14 08:07:29 1999

Date: Mon, 14 Jun 99 05:00:20 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 14 Jun 1999     Volume: 8 Number: 5984

Today's topics:
    Re: Afraid to ask about Y2K! (Kvan)
    Re: ANN: Awesome tool for Perl programmers (Marc Haber)
    Re: ANSWER: Re: uninitialized value? what am i doing wr <admin@asarian-host.org>
    Re: File upload/download Web app. <paul.bunkham@synetica.com>
    Re: Fix this uglyness (Michel Dalle)
        How to write search engine like Yahoo?? <ywkwong9@netvigator.com>
    Re: macperl - directory names with embedded spaces (Bart Lateur)
    Re: MIcrosofts Attack on Perl (Kvan)
        msql interface dansjohnson@geocities.com
    Re: need a server that supports perl(cgi) <paul.bunkham@synetica.com>
        overwrite "print" ? <info@java.seite.net>
    Re: Perl cgi with Foxpro database or Access database <eyounes@aol.com>
        PERL for Win32 vs Active Perl <hamptonk@bible.org>
        Sort log (Twarren10)
    Re: Sort log <gellyfish@gellyfish.com>
    Re: strange problem for multithread programming... <sugalskd@netserve.ous.edu>
        URGENT: Netscape crashes if more input to Perl script <bhaverajesh@hotmail.com>
    Re: URGENT: Netscape crashes if more input to Perl scri <gellyfish@gellyfish.com>
    Re: URGENT: Netscape crashes if more input to Perl scri (Sam Holden)
        Verify User Input <ianmorty@nortelnetworks.com>
    Re: Verifying date data <sb@sdm.de>
        Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)

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

Date: Mon, 14 Jun 1999 10:40:18 GMT
From: kvan@dis.dk (Kvan)
Subject: Re: Afraid to ask about Y2K!
Message-Id: <3764da63.329881544@news.newsguy.com>

On Sat, 12 Jun 1999 04:58:01 GMT, finsol@ts.co.nz wrote:

>Why don't the Perl faction act more responsibly and offer suggestions as
>to how Y2K audits are best done on Perl applications, the types of
>problems found, the types of environments more likely to exhibit
>problems, the percentage of problems found to lines of code checked, how
>many problems were found through application testing as opposed to code
>checking?, how many problems were found in supposedly remediated code?,
>how were these problems found? etc. etc.

Because, as relevant as this is to the (small?) subset of programmers
concerned with fixing Y2K problems, most of it is not relevant to
Perl. It's not (usually) a question of denial, but a question of
off-topicness: The Perl side of things, localtime(), has been
discussed to death--and so a reference to the FAQs included in the
software (and which should ALWAYS be the first line of questioning
pursued when faced with a Perl query) is not only sufficient, but the
best possible advice. The rest of the discussion is better off in a
forum dedicated to Y2K.

As far as deja.com, even if a given person has no experience with the
site, a quick perusal of the URL _included in the referral_ will
suffice for them to acquaint themselves with the place--and be better
off knowing about one of the most valuable resources on the net.

Kvan, still wondering how anybody can be upset at being pointed to a
valuable reference.

-------Casper Kvan Clausen------ | 'A *person* is smart. People are
---------<kvan@dis.dk>---------- |  dumb, panicky, dangerous animals
                                 |  and you know it.'
                                 |        - "K" in Men in Black.


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

Date: Mon, 14 Jun 1999 09:05:53 GMT
From: Marc.Haber-usenet@gmx.de (Marc Haber)
Subject: Re: ANN: Awesome tool for Perl programmers
Message-Id: <7k2glh$550$3@news.rz.uni-karlsruhe.de>

notepower@my-deja.com wrote:
>The fact is the program is not SPECIFICALLY designed for Perl;

Well, in that case, you are _absolutely_ off-topic in a perl
newsgroup.

Go away.

Greetings
Marc

-- 
-------------------------------------- !! No courtesy copies, please !! -----
Marc Haber          |   " Questions are the         | Mailadresse im Header
Karlsruhe, Germany  |     Beginning of Wisdom "     | Fon: *49 721 966 32 15
Nordisch by Nature  | Lt. Worf, TNG "Rightful Heir" | Fax: *49 721 966 31 29


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

Date: Mon, 14 Jun 1999 12:58:26 +0200
From: Mark <admin@asarian-host.org>
Subject: Re: ANSWER: Re: uninitialized value? what am i doing wrong?
Message-Id: <199906141058.EAA19143@asarian-host.org>

Lee <rlb@intrinsix.ca> wrote in message news:B3863B9A966885527@0.0.0.0...

> In article <7jqeo8$7kj$1@zonnetje.NL.net>,
> "Bastiaan S van den Berg" <office@asc.nl> wrote:
>
> >>$car = 0;
> >>print "Car exists!\n" if ($car);
> >>$car2 = "";
> >>print "The other car exists!\n" if ($car2);
> >>$car3 = "0";
> >>print "The third car exists!\n" if ($car3);
> >
> >>Hmmm, that didn't print anything. Guess you're wrong. Thrice.
> >
> >well , i can't help it if it works for me , and not for you ..
> >
> >btw. i use :
> >print "this works" if defined $working;
> >not:
> >print "this doesn't" if ($itdoesnt)
>
> Silly boy!
>
> She was responding to the suggestion that if(defined $var) could be
> replaced by if($var), so changing them back is hardly a counter-example.
>
> Lee


Well, although I never said it was a complete replacement, you are right in
pointing it out; but I still prefer testing if($var) over defined($var). If you
set $var to "", then marking it defined feels counter-intuitive to me. In most
languages that I know, setting a string to "" means that testing for its
"existence" (its value, actually,) yields a false, not a true. I am very well
aware that undef($var) does something entirely different than $var = "", yet
producing a false on an empty string just feels right to me: although it is
technically still defined, it has an empty value--which is what you want to test
for in most cases, anyway. Even with numbers. I can say: "I have no money in the
bank," meaning 0, as is absent. Or I could say: if defined($money), and get a
true returned, meaning: "You have defined money in the bank, of amount zero."
That just sounds a bit too artificial to me. :) In such cases I prefer
if($money) returning false, as to indicate that the money is gone.

It is not always about right versus wrong.

- Mark

        System Administrator Asarian-host.org





--
For more information about this posting service, contact:
help@asarian-host.org -- for all info about our server.
If you want an anonymous account, visit our sign-up page:

http://asarian-host.org/emailform.html


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

Date: Mon, 14 Jun 1999 10:45:59 +0100
From: Paul Bunkham <paul.bunkham@synetica.com>
Subject: Re: File upload/download Web app.
Message-Id: <3764CF57.466A2A09@synetica.com>

David Cassell wrote:
> 
> 
> Many of us do try to be helpful when the thousands of off-topic posts
> per day come rushing in like a tsunami of cluelessness.  Not all of
> us succeed.  :-)  And some of us were once helpful responders, who
> [through years of seeing the same irrelevant posts appear so frequently
> that some might suspect an autobot was generating them under a slew
> of fake email addresses] over time have become bitter recluses who
> now shout at the neighbor kids to get off their lawns.  :-)
> 

Point taken, I realise that over time these kinds of posts would get
more than a little annoying.  Along with THESE kinds of posts I suppose,
so I'll make this one as short as possible.

> 
> Well, it does say c.l.p.misc in the name, but there is a charter.
> Since people are unable to read or learn anymore, someone does need
> to: (1) explain that this is Usenet and not a chat room; (2) Usenet
> does have its own rules that others are expected to follow; and
> (3) c.l.p.misc has its own rules which are printed up regularly in
> the mini-FAQ and posters should be cooperative if they want
> cooperation.
> 

I do understand that Usenet has rules and people should follow them, but
now that the Internet is more widespread than academia, there are
hundreds of people out there that need help, but probably haven't been
using the Internet long enough (or in the traditional fashion) to know
all about the finer points of Usenet.  I think I had better go and do
some more reading, before I make some sort of similar Internet faux
pas.  Perhaps MS should dedicate some time to making their paper clip
teach you netiquette.

> Are you volunteering?  :-)  You can get in line before me and
> Tom Phoenix as some of The Official Helpful People.
> 

Now I'm reading this group, I'll help if I can, time permitting, but I
think the point is that you need more than a few hardcore people being
the helpful ones, or these people should at least get a decent holiday
every so often :)

> 
> Given the amount of blargh here lately, your post doesn't strike
> me as that irrelevant.  Off the original topic, yes.
>

I agree, and so I had better stop posting about it, if nothing else but
to stop you from having extra work to do responding.
 
> BTW, is this stuff on the floor what you were trying to get off
> your chest?  If so, I suggest you see a good internist.  It looks
> pretty bad.  [Sorry, I couldn't resist such an easy straight line.]
> 

No need to apologise it's good to see that a perl programmer can make
jokes that don't involve regular expressions.

Paul.

-- 
*****************************************
Paul Bunkham
Developer
Synetica Knowledge Technologies
*****************************************


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

Date: Mon, 14 Jun 1999 09:12:12 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: Fix this uglyness
Message-Id: <7k2h1p$nmc$1@news.mch.sbs.de>

In article <slrn7m8gc5.vno.alanp@osiris.unixpower.org>, alanp@unixpower.org (Alan) wrote:
>I haven't the time to do it myself, so could someone please fix the systeming
>I used when I got tired:
[snip]
>I just need a good way of doing that.

Have you tried
        system("make time");
instead of
        system("post message in the hope somebody will do it for you");
?
As you see, it's much shorter :-)

Michel.


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

Date: Mon, 14 Jun 1999 19:28:02 +0800
From: wilson <ywkwong9@netvigator.com>
Subject: How to write search engine like Yahoo??
Message-Id: <3764E742.1BD7E379@netvigator.com>


--------------32D2D5E83911A55CD11778DA
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit


Hi,  I want to write a chinese search engine likeyahoo.
Is Perl as a first choice? Has any web site to teach people how to
write a search engine? Thank you for helping.

--------------32D2D5E83911A55CD11778DA
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
&nbsp;
<br><font size=+1>Hi,&nbsp; I want to write a chinese search engine likeyahoo.</font>
<br><font size=+1>Is Perl as a first choice? Has any web site to teach
people how to</font>
<br><font size=+1>write a search engine? Thank you for helping.</font></html>

--------------32D2D5E83911A55CD11778DA--



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

Date: Mon, 14 Jun 1999 11:52:47 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: macperl - directory names with embedded spaces
Message-Id: <3764dde9.4635779@news.skynet.be>

Chris Nandor wrote:

>I thought nulls in filenames were illegal.  Do you have any
>docs on this?
>
># Super blimey. Again,
># sysopen() MAY help (haven't tested).
>
>No, it doesn't.  sysopen(FOO, "bar\0baz", O_RDWR|O_CREAT, 0666) creates a
>file called "bar".

It may well be impossible to CREATE files with embedded null bytes in
them, on the Mac. That doesn't mean they can't exist. In particular, DOS
floppies in a Mac with the PC-Exchange extension installed, occasionally
happen to have them.

I currently fail to recreate it. However, if you ever try to drop a file
directly from a PC diskette onto a droplet and the file fails to open,
then this is probably the cause.

This droplet may show the full filename (or disk/folder name) in hex:

	$\ = "\n"; $, = ' ';
	while(@ARGV){
		$_ = shift;
		print; 		# file name
		print map { sprintf '%02X', $_ } unpack('C*',$_);
	}

Then again, when the problem occurs, maybe this doesn't show the
complete filename. When I originally found this out, I had selected the
floppy, copied the name, saved it in a new file in BBEdit, and looked at
it with a hex file viewer. The null bytes were clearly there.

I've had crashes on a Mac every time when trying to open a file on a
PC-diskette, that came direclty from a Win95 PC, with NO NAME ASSIGNED
to the floppy. In that case, Win95 gives it a name based upon some
stupid variation of the first file encountered. I strongly suspect that
this disk name is the cause of the crashes, as they don't occur if you
manually give a name to a new floppy.

	Bart.


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

Date: Mon, 14 Jun 1999 10:51:32 GMT
From: kvan@dis.dk (Kvan)
Subject: Re: MIcrosofts Attack on Perl
Message-Id: <3764ddd9.330767508@news.newsguy.com>

On 11 Jun 1999 09:27:24 -0400, Jonathan Feinberg <jdf@pobox.com>
wrote:

>How, then, do you explain Sun's recent litigation v. Microsoft
>concerning this very issue in the domain of Java VMs?

Simple: Java was kidnapped as a baby, whereas Perl is grown up. Just
as MS can't hijack C++ by now, Perl is beyond any attempts at control
they might try to apply. They can merely facilitate its use on MS
systems, which could help halt migration from NT to UNIXen (which, I
predict, will pick up significantly next year).

Kvan, not worrying... yet, anyway.

-------Casper Kvan Clausen------ | 'A *person* is smart. People are
---------<kvan@dis.dk>---------- |  dumb, panicky, dangerous animals
                                 |  and you know it.'
                                 |        - "K" in Men in Black.


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

Date: Mon, 14 Jun 1999 11:06:35 GMT
From: dansjohnson@geocities.com
Subject: msql interface
Message-Id: <3764E7D8.A80C46C2@geocities.com>

I am an ok perl programmer that learns best by example. I need some
source code showing some of the basic uses of the msql interface from
perl. Need specifically select and update statements. I have some
software due in 3 days that it would greatly help if I could get just a
quik example from someone experieced in it.
Thanks alot to anyone who responds with help.
Dan Johnson
dansjohnson@geocities.com
---------++++++-----------




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

Date: Mon, 14 Jun 1999 10:56:54 +0100
From: Paul Bunkham <paul.bunkham@synetica.com>
Subject: Re: need a server that supports perl(cgi)
Message-Id: <3764D1E6.ADCA1243@synetica.com>

Leonid Goltser wrote:
> 
> Can anybody suggest a server, where I can upload my perl(cgi) scripts?

If you are lookinf for something free, then try,
http://free.prohosting.com/ They give away free web space, and a free
cgi-bin, at the price of you advertising their sevices.

Just a thought,

Paul.

-- 
*****************************************
Paul Bunkham
Developer
Synetica Knowledge Technologies
*****************************************


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

Date: Mon, 14 Jun 1999 13:34:57 +0200
From: Christoph Bergmann <info@java.seite.net>
Subject: overwrite "print" ?
Message-Id: <3764E8E1.3183@java.seite.net>

i want to overwrite the internal "print" command. something like:


use subs qw(print);

print "blabla";

sub print { CORE::print "The output is: ", (join $, , @_); }


should work - but it doesnt!

it works fine with functions like "chdir" or "open" - is "print"
something special and if so is there another way to overwrite it?

best regards,

christoph bergmann



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

Date: Mon, 14 Jun 1999 11:08:18 +0200
From: "Ysteric's" <eyounes@aol.com>
Subject: Re: Perl cgi with Foxpro database or Access database
Message-Id: <7k2grf$7qc@news.vtcom.fr>

For a foxpro database, you can use the DBD::XBase, it works.

I did it.

Eric

superken a icrit dans le message <7k1ve5$h3b$1@news.ctimail.com>...
>I am looking for a way to access a Foxpro database or Access database using
>Perl script that runs on Unix server. Can anyone give me some idea on this?
>Do I need ODBC?
>
>Pls help.
>
>




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

Date: Mon, 14 Jun 1999 11:59:55 GMT
From: Hampton Keathley <hamptonk@bible.org>
Subject: PERL for Win32 vs Active Perl
Message-Id: <3764EE6C.C350778A@bible.org>

Greetings,

I have used PERL for Win32 for a long time and recently downloaded
Active Perl.

I often write scripts to clean up or convert massive numbers of files in
a directory.
All my scripts that process several files at once don't work under
active perl.
First question is why?
Most important question: what do I do to the following script to fix it?

I typically use the following:

foreach $file (@ARGV){
	($fn,$ext) = split(/\./ ,$file);
die ("Cannot open input file $fn.$ext\n") unless (open (INFILE,
"$fn.$ext"));
die ("cannot open output file $fn.sgm\n") unless (open (OUTFILE,
">$fn.sgm")) ;

while  (<INFILE>){
	$line = $_;
	$line =~ s/SEARCH/REPLACE STUFF/;
	and other stuff here
	print OUTFILE $line;
	}

close (OUTFILE);
close (INFILE);
}


Thanks,

hampton


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

Date: 14 Jun 1999 10:13:06 GMT
From: twarren10@aol.com (Twarren10)
Subject: Sort log
Message-Id: <19990614061306.22857.00001489@ng-fu1.aol.com>

Ok, I have this sort working, except that it only sorts the first two fields.
The date field remains the same for every line printed out. Here's the code.
while (<FILE1> ) {
chomp;
($searchword, $score, $tdate) = split(/\|/);
$scores{$searchword} = $score;

}
close FILE1;

foreach $word (sort { $scores{$b} <=> $scores{$a} } keys %scores) {

print etc...

}

The result is that it sorts the searchwords and score (number of times
searched), but leaves the date the same for every entry. What is wrong with
this? Thanks for your help.



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

Date: 14 Jun 1999 11:39:06 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Sort log
Message-Id: <3764dbca@newsread3.dircon.co.uk>

Twarren10 <twarren10@aol.com> wrote:
> Ok, I have this sort working, except that it only sorts the first two fields.
> The date field remains the same for every line printed out. Here's the code.
> while (<FILE1> ) {
> chomp;
> ($searchword, $score, $tdate) = split(/\|/);
> $scores{$searchword} = $score;
> 
> }
> close FILE1;
> 
> foreach $word (sort { $scores{$b} <=> $scores{$a} } keys %scores) {
> 
> print etc...
> 
> }
> 
> The result is that it sorts the searchwords and score (number of times
> searched), but leaves the date the same for every entry. What is wrong with
> this? Thanks for your help.
> 

As you have omitted to show us the bit of your code where you print out
the date I will have to guess ...

I figure the date you are seeing is the date of the last entry in your
file right ?  Which stands to reason as you are not doing anything
with it.  You might want to store the date in your hash along with the score
in an array :


while (<FILE1> ) 
  {
    chomp;
    my ($searchword, $score, $tdate) = split(/\|/);
    $scores{$searchword} = [$score,$tdate];
  }

close FILE1;

foreach $word (sort { $scores{$b}->[0] <=> $scores{$a}->[0] } keys %scores) 
   {

    print $_,"\t",$scores{$_}->[1],"\n"; # searchword, date;

   }

But I still dont think that is what you want to do - If you want to have
a seperate set of searchwords for each date then you will need to use
a Hash of Hashes :


while (<FILE1> ) 
  {
    chomp;
    my ($searchword, $score, $tdate) = split(/\|/);
    $scores{$tdate}->{$searchword} = $score;
  }

Check out perldata,perldsc,perllol manpages for more on this stuff

/J\
-- 
"It's times like this I wish I had a penis" - Duckman


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

Date: 14 Jun 1999 11:53:40 GMT
From: Dan Sugalski <sugalskd@netserve.ous.edu>
Subject: Re: strange problem for multithread programming...
Message-Id: <7k2qg4$gj4$1@news.NERO.NET>

GEMINI <dennis@info4.csie.nctu.edu.tw> wrote:
: I am writing a multithread perl program using Thread module.
: However, I often encounter a strange error:

: Not a GLOB reference at /usr/local/lib/perl5/5.00502/SelectSaver.pm line 43.

: However, I didn't use the SelectSaver module,
: and maybe it is invoked by the modules I use:
: use Thread;
: use Thread::Semaphore;
: use IO::Socket;

Hmmm. Those shouldn't use SelectSaver, AFAIK.

: Another error is "Attempt to free unreferenced scalar....." for the
: code:

: $nth=new Thread(.....
: $nth->detach;

: These errornous don't happen for every execution,
: but happen so often. So do I have to trace the module to 
: find out the reason?

What's likely happening is you've got unsynchronized access to one or more
shared variables, and are managing to corrupt them somehow. If that
happens, perl's pretty much guaranteed to fall down sooner or later.

Double-check your code to make sure you're lock()in things appropriately.

It's also possible you're tripping across a perl bug. There were some
threading fixes pit in for the _03 release. You might want to try
upgrading, too.

					Dan


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

Date: Mon, 14 Jun 1999 09:13:11 GMT
From: Rajesh Bhave <bhaverajesh@hotmail.com>
Subject: URGENT: Netscape crashes if more input to Perl script
Message-Id: <7k2h34$kjf$1@nnrp1.deja.com>

Hello

I have a very URGENT problem to solve. If input to my CGI script (in
Perl) is huge, the HTML generated by script is displayed; but, when the
particular session is closed, Netscape error occurs and Netscape
crashes. I get following Netscape fatal error :

   An application error has occurred
and an application error log is generated.

          netscape.exe
Exception: access violation (0xc0000005),Address: 0x77e85962

I am on Netscape 4.5 on NT
==============================================================
Anyone interested to help, following I call the script:
http://nt45209/scripts/searchoutput.pl/searchoutput.html?
&Ldef+proj+Arvind=ghjgjghjghjghjg&Lfol+proj+Arvind=pavan&Edef+proj+Arvin
d=www.hotmail.com&Efol+proj+Arvind=gdgd&Rdef+proj+Arvind=fsfsfsdgdfg&Rfo
l+proj+Arvind=gdfggd&DefMdef+proj+Arvind=sdfsdfsdfsdf&DefMfol+proj+Arvin
d=dgdg&SCMdef+proj+Arvind=dfsdfsdf&SCMfol+proj+Arvind=gdfg&DepMdef+proj+
Arvind=dfsdf&DepMfol+proj+Arvind=fgdfgd&Tdef+proj+Arvind=dfsdfs&Tfol+pro
j+Arvind=gdfgd&RMdef+proj+Arvind=sdfsdfs&RMfol+proj+Arvind=dgfdfsgdfsdfg
&CMdef+proj+Arvind=sdfsdf&CMfol+proj+Arvind=fgdf&SMdef+proj+Arvind=dfsdf
sdfsf&SMfol+proj+Arvind=fgdfgdfgd&Post+proj+Arvind=dgdfdfgdfgddfhlkgdgdf
g&ActPo+proj+Arvind=dgdfgdfgdfgfffdf&Ldef+proj+kiran=hfgh&Edef+proj+kira
n=hfghfg&Rdef+proj+kiran=fghfghf&DefMdef+proj+kiran=fghfghfg&SCMdef+proj
+kiran=fghfghfghf&DepMdef+proj+kiran=hfghfhfgh&Tdef+proj+kiran=sdfsdfsdf
sdf&RMdef+proj+kiran=fsdfsdfsdfsd&CMdef+proj+kiran=sdfsdfs&SMdef+proj+ki
ran=sdfsdfsdf&Post+proj+kiran=dgdg&ActPo+proj+kiran=hfghfgh&Ldef+proj+ki
shor=dfgd&Lfol+proj+kishor=dfgdg&Edef+proj+kishor=dgd&Efol+proj+kishor=f
gdfg&Rdef+proj+kishor=dfgdg&Rfol+proj+kishor=dfgdg&DefMdef+proj+kishor=d
gdg&DefMfol+proj+kishor=fgdfg&SCMdef+proj+kishor=fgdfg&DepMdef+proj+kish
or=gddfgdf&Tdef+proj+kishor=fgdgdg&RMdef+proj+kishor=gdfgd&CMdef+proj+ki
shor=gdgdfg&SMdef+proj+kishor=gdfgdf&Post+proj+kishor=rajeshg&ActPo+proj
+kishor=dfgdfg&Ldef+proj+mayank=ghfghfghfhfghf&Lfol+proj+mayank=jghj&Ede
f+proj+mayank=fghfh&Efol+proj+mayank=null&Rdef+proj+mayank=hfghfhffhfjg&
Rfol+proj+mayank=jghjghjghjg&DefMdef+proj+mayank=ghjghj&DefMfol+proj+may
ank=null&SCMdef+proj+mayank=jghj&SCMfol+proj+mayank=ghjghjg&DepMdef+proj
+mayank=hjghjghjghjg&DepMfol+proj+mayank=null&Tdef+proj+mayank=ghg&Tfol+
proj+mayank=gjghjghj&RMdef+proj+mayank=jghjgj&RMfol+proj+mayank=null&CMd
ef+proj+mayank=ghjghjgh&CMfol+proj+mayank=hjghjgjghgggjgjgg&SMdef+proj+m
ayank=ghjghjghj&SMfol+proj+mayank=null&Post+proj+mayank=ghjghjgh&ActPo+p
roj+mayank=ghjghjghjghj&Ldef+proj+ramesh=dfgdfgd&Edef+proj+ramesh=gdfgdf
gdhfg&Rdef+proj+ramesh=fghf&DefMdef+proj+ramesh=hfghfgh&SCMdef+proj+rame
sh=hjghjg&DepMdef+proj+ramesh=jghjghj&Tdef+proj+ramesh=jghjg&RMdef+proj+
ramesh=ghjghjghj&RMfol+proj+ramesh=sddfsdfsdf&CMdef+proj+ramesh=jghjgh&C
Mfol+proj+ramesh=dfgdfdfgdfg&SMdef+proj+ramesh=ghjghjghjgjgjgjgjgjgj&Pos
t+proj+ramesh=jghjghjghj&ActPo+proj+ramesh=hjghjghjgj&Ldef+proj+ronak=df
gdf&Lfol+proj+ronak=jghjghg&Edef+proj+ronak=fgd&Efol+proj+ronak=ghjghj&R
def+proj+ronak=dfgdfg&Rfol+proj+ronak=hjghjghkhjkhjkhj&DefMdef+proj+rona
k=fgd&DefMfol+proj+ronak=jkljkljkl&SCMdef+proj+ronak=dhfgh&SCMfol+proj+r
onak=kl%3bkl%3b&DepMdef+proj+ronak=fghfghfg&DepMfol+proj+ronak=l%3bkl%
3b&Tdef+proj+ronak=fghghj&Tfol+proj+ronak=kl%
3bkl&RMdef+proj+ronak=hjgh&RMfol+proj+ronak=kl%
3bkl&CMdef+proj+ronak=ghjghjgh&CMfol+proj+ronak=kl%3bkl%
3bk&SMdef+proj+ronak=ghjghjg&SMfol+proj+ronak=kl%3bkl%
3bk&Post+proj+ronak=ljkljkljklj&ActPo+proj+ronak=kljkl

Following is the script file:
============================
use CGI qw(:standard);
$ENV{PATH_INFO} == searchoutput.html
print header,start_html;
$current = "temp2";
$old = "temp1";
print "<h1>","Experience Database Search Engine","</h1>";
#print "<applet codebase=..\ code=SearchEngine.class archive=PDB.jar
width=950 height=350

#name=SearchEngine>","</applet>";
foreach (param())
{
  if (index($_,"Experience Database") != -1) {
    print "<h2>",$_,"<BR>",param($_),"</h2>","<PRE>";
  }

  $foundnotfound = "notfound";

  if ((index($_,"fol") == -1) && (index($_,"ActPo") == -1) && (index
($_,"Post") == -1)) {

print "</PRE>";}
  if ((index($_,"fol") != -1) || (index($_,"def") != -1) || (index
($_,"Post")  != -1) ||

(index($_,"ActPo")  != -1)){
    $foundnotfound = "found";
    $com = index($_,"proj") + 5;
    $sub = length($_)-$com;
    $current = substr($_,$com,$sub);

    if ($current cmp $old) {
      print "<PRE>","<h3>","<b>","<u>","Following is process related
information for project

",$current,"</b>","</u>","</h3>","</PRE>";
      $old = $current;
      $postmortemfirst = "yes";
    }
    if ((index($_,"Post") != -1) || (index($_,"ActPo") != -1) && not
($postmortemfirst cmp

"yes")) {
      print "<P>","<PRE>","<h3>","<b>","<u>","Following is postmortem
related information

for project ",$current,"</b>","</u>","</h3>","</PRE>";
      $postmortemfirst = "no";
    }

#    print "<PRE>",$_;

    if (index($_,"Ldef") != -1) {
      $descvar = length("Lifecycle processes defined for project ") +
length($current);
      print "<PRE>","Lifecycle processes defined for project ",$current;
    }
    elsif (index($_,"Lfol") != -1) {
      $descvar = length("Lifecycle processes followed in project ") +
length($current);
      print "<PRE>","Lifecycle processes followed in project ",
$current;
    }
    elsif (index($_,"Edef") != -1) {
      $descvar = length("Estimation processes defined for project ") +
length($current);
      print "<PRE>","Estimation processes defined for project ",
$current;
    }
    elsif (index($_,"Efol") != -1) {
      $descvar = length("Estimation processes followed in project ") +
length($current);
      print "<PRE>","Estimation processes followed in project ",
$current;
    }
    elsif (index($_,"Rdef") != -1) {
      $descvar = length("Review processes defined for project ") +
length($current);
      print "<PRE>","Review processes defined for project ",$current;
    }
    elsif (index($_,"Rfol") != -1) {
      $descvar = length("Review processes followed in project ") +
length($current);
      print "<PRE>","Review processes followed in project ",$current;
    }
    elsif (index($_,"DefMdef") != -1) {
      $descvar = length("Defect Management processes defined for
project ") +

length($current);
      print "<PRE>","Defect Management processes defined for project ",
$current;
    }
    elsif (index($_,"DefMfol") != -1) {
      $descvar = length("Defect Management processes followed in
project ") +

length($current);
      print "<PRE>","Defect Management processes followed in project ",
$current;
    }
    elsif (index($_,"SCMdef") != -1) {
      $descvar = length("Software Coniguration Management processes
defined for project ") +

length($current);
      print "<PRE>","Software Coniguration Management processes defined
for project

",$current;
    }
    elsif (index($_,"SCMfol") != -1) {
      $descvar = length("Software Coniguration Management processes
followed in project ") +

length($current);
      print "<PRE>","Software Coniguration Management processes
followed in project

",$current;
    }
    elsif (index($_,"DepMdef") != -1) {
      $descvar = length("Dependency Management processes defined for
project ") +

length($current);
      print "<PRE>","Dependency Management processes defined for
project ",$current;
    }
    elsif (index($_,"DepMfol") != -1) {
      $descvar = length("Dependency Management processes followed in
project ") +

length($current);
      print "<PRE>","Dependency Management processes followed in
project ",$current;
    }
    elsif (index($_,"Tdef") != -1) {
      $descvar = length("Tracking/Replanning processes defined for
project ") +

length($current);
      print "<PRE>","Tracking/Replanning processes defined for project
",$current;
    }
    elsif (index($_,"Tfol") != -1) {
      $descvar = length("Tracking/Replanning processes followed in
project ") +

length($current);
      print "<PRE>","Tracking/Replanning processes followed in project
",$current;
    }
    elsif (index($_,"RMdef") != -1) {
      $descvar = length("Risk Management processes defined for project
") +

length($current);
      print "<PRE>","Risk Management processes defined for project ",
$current;
    }
    elsif (index($_,"RMfol") != -1) {
      $descvar = length("Risk Management processes followed in project
") +

length($current);
      print "<PRE>","Risk Management processes followed in project ",
$current;
    }
    elsif (index($_,"CMdef") != -1) {
      $descvar = length("Change Management processes defined for
project ") +

length($current);
      print "<PRE>","Change Management processes defined for project ",
$current;
    }
    elsif (index($_,"CMfol") != -1) {
      $descvar = length("Change Management processes followed in
project ") +

length($current);
      print "<PRE>","Change Management processes followed in project ",
$current;
    }
    elsif (index($_,"SMdef") != -1) {
      $descvar = length("Subcontract Management processes defined for
project ") +

length($current);
      print "<PRE>","Subcontract Management processes defined for
project ",$current;
    }
    elsif (index($_,"SMfol") != -1) {
      $descvar = length("Subcontract Management processes followed in
project ") +

length($current);
      print "<PRE>","Subcontract Management processes followed in
project ",$current;
    }
    elsif (index($_,"Post") != -1) {
      $descvar = length("URL containing postmortem reports of project
") + length($current);
      print "<PRE>","URL containing postmortem reports of project ",
$current;
    }
    elsif (index($_,"ActPo") != -1) {
      $descvar = length("URL containing actions performed on the
postmortem reports of

project ") + length($current);
      print "<PRE>","URL containing actions performed on the postmortem
reports of project

",$current;
    }

    for ($i = 0; $i < 80 - $descvar; $i++) {
      print "&nbsp";
    }
#    print "<A HREF=",param($_),">",param($_),"</A>";
    print "<A HREF=","http://",param($_),">","http://",param($_),"</A>";
  }
}
print "</PRE>";
  if (not($foundnotfound cmp "notfound")) {
    print "<PRE>","<h3>","<b>","<u>","No records found matching search
criteria

","</b>","</u>","</h3>";
  }
  else {
    print "<BR>","<BR>","<PRE>","<b>","Link to Metrics Tool

--","<I>","CHANAKYA","</I>","</b>";

    for ($i = 0; $i < 65 - length("Link to Metrics Tool -- Customer
Feedback Tracker ");

$i++) {
      print "&nbsp";
    }

    print "<A

HREF=","http://chanakya.india.hp.com/Metrics/chanakya.htm",">","http://c
hanakya.india.hp.com

/Metrics/chanakya.htm","</A>","</PRE>";
  }

print end_html;


Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.


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

Date: 14 Jun 1999 11:22:45 +0100
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: URGENT: Netscape crashes if more input to Perl script
Message-Id: <3764d7f5@newsread3.dircon.co.uk>

Rajesh Bhave <bhaverajesh@hotmail.com> wrote:
> Hello
> 
> I have a very URGENT problem to solve. If input to my CGI script (in
> Perl) is huge, the HTML generated by script is displayed; but, when the
> particular session is closed, Netscape error occurs and Netscape
> crashes. I get following Netscape fatal error :
> 
>    An application error has occurred
> and an application error log is generated.
> 
>           netscape.exe
> Exception: access violation (0xc0000005),Address: 0x77e85962
> 

This is almost certainly a bug in Netscape and has nothing whatsoever
to do with Perl - I would venture that this would happen if you typed in a
huge query string of any sort whatever language was being used.

I would report it to Netscape or perhaps ask on one of
the netscape.public.* newsgroups to see if anyone else has experienced it.

/J\


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

Date: 14 Jun 1999 10:56:47 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: URGENT: Netscape crashes if more input to Perl script
Message-Id: <slrn7m9nvf.jui.sholden@pgrad.cs.usyd.edu.au>

On Mon, 14 Jun 1999 09:13:11 GMT, Rajesh Bhave <bhaverajesh@hotmail.com> wrote:
>Hello

Bye.

Don't post the same thing in two different groups.

-- 
Sam

If your language is flexible and forgiving enough, you can prototype
your belief system without too many core dumps.
	--Larry Wall


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

Date: Mon, 14 Jun 1999 07:41:00 +0100
From: Ian Mortimer <ianmorty@nortelnetworks.com>
Subject: Verify User Input
Message-Id: <3764A3FC.D9EF0C6C@nortelnetworks.com>

Hi all,

I am writing a script that will take requests for software patches and
keep a log of these requests.

The input form has several fields (names,dates,titles etc) and I am
wondering if there are any other ways of verifying these inputs are
correct e.g. the date is correct etc.

At the moment I am using some simple 'if' statements (see below).
These
'if' statements could get a bit long and I was just wondering if there
is
a better way of doing this ???

(The main one I am after is a check for dates e.g. number of days are
correct for the month etc)

Ian.

PS: I have also heard that you can get JavaScript to run when the user
leaves a particular field in a form.  Could this be used to call a
validation routine ?


sub validate_fields
{
# validate all fields and prompt user to re-enter field if incorrect
# only simple checks at the moment

if (($FORM{prostar} eq "") || (length $FORM{prostar} lt 8))
 {
 validation_error("Prostar");
 }
elsif (($FORM{'requestor'} eq "") || ($FORM{'requestor'} !~ /[a-zA-Z]/))

 {
 validation_error("requestor");
 }
elsif (($FORM{request_date} eq "") || ($FORM{request_date} !~ /-/) ||
($FORM{request_date} =~ /[a-zA-Z]/))
 {
 validation_error("Request Date");
 }
$validated = "yes"; # validation is OK
}

sub validation_error
{
print "<html>\n";
print "<body bgcolor=white>\n";
print "<center>\n";
print "<h1>Form Error</h1>\n";
print "The $_[0] field was not entered correctly<br>\n";
print "<br>Please go back and ammend this field\n";
print "</center>\n";
print "</body>\n";
print "</html>\n";
exit;
#end sub validation_error
}







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

Date: 14 Jun 1999 10:01:10 GMT
From: Steffen Beyer <sb@sdm.de>
Subject: Re: Verifying date data
Message-Id: <7k2jt6$7tq$1@solti3.sdm.de>

In article <7k1ic0$bca$1@nnrp1.deja.com>, gsherman2773@my-deja.com wrote:

> > Then you must be blind (from the Date::Calc man page):
> >
> Yes.  And lazy.  Thank you for making me aware of the check_date
> function in that module.

> Incidentally, as an ActivePerl user on the Win32 platform, and on a
> machine that does not have any installed C/C++ compiler, installing the
> Date::Calc module would require quite a bit of an effort.

You are wrong again.

This module has been precompiled by ActiveState and the binary can be
installed using the PPM (ActiveState's "Perl Package Manager") already
installed on your system. No need for a C compiler.

Just start the ppm in your MSDOS box and say "install Date::Calc" or so
(read the docs).

Yours,
-- 
    Steffen Beyer <sb@engelschall.com>
    http://www.engelschall.com/u/sb/whoami/
    http://www.engelschall.com/u/sb/download/
    http://www.perl.com/CPAN/authors/id/STBEY/
    http://www.oreilly.de/catalog/perlmodger/bnp/


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

Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>


Administrivia:

Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing. 

]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body.  Majordomo will then send you instructions on how to confirm your
]subscription.  This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.

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.  

To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.

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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 5984
**************************************

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