[11533] in Perl-Users-Digest
Perl-Users Digest, Issue: 5133 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Mar 14 17:07:25 1999
Date: Sun, 14 Mar 99 14:00:19 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sun, 14 Mar 1999 Volume: 8 Number: 5133
Today's topics:
Re: 1000 thread limit? <sugalskd@netserve.ous.edu>
???? Re: Active perl (ICG)
Re: [Q] Popping an array element <pmoore@interaccess.com>
^^Search Script Help andrew_linmax@my-dejanews.com
Re: Cleaning up memory (Ronald J Kimball)
Re: deleting an array of words from a string (Ronald J Kimball)
Here 's a good one !!! <Travis@wildboysnet.com>
Re: IDE for Perl <JimOrona@ElegantSolutionsInc.com>
Re: Identifier on Perl (Ronald J Kimball)
Re: Mail on WinNT - with no mail programm <JimOrona@ElegantSolutionsInc.com>
Re: Multiple Users Corrupting File (ICG)
Re: Problems with files that a script creates, new Perl (Ronald J Kimball)
Re: searching a flat file database <JimOrona@ElegantSolutionsInc.com>
Re: use diagnostics problem? (Ronald J Kimball)
Re: use diagnostics problem? (Matthew Bafford)
Re: use diagnostics problem? <horizon@internetexpress.com.au>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 14 Mar 1999 21:54:24 GMT
From: Dan Sugalski <sugalskd@netserve.ous.edu>
Subject: Re: 1000 thread limit?
Message-Id: <7chb6g$60e$1@news.NERO.NET>
archon16@my-dejanews.com wrote:
: In article <7c9qju$l3c$1@news.NERO.NET>,
: Dan Sugalski <sugalskd@netserve.ous.edu> wrote:
:> archon16@my-dejanews.com wrote:
:> : I'm playing with the Thread module... and I was dismayed to discover a
:> : limit of about 1000 threads allowed at a time (on my machine, at least.)
:> : After hitting this limit, the program simply dumps core. Does anyone know
:> : of a way to get around this limitation? (Without recompiling the Linux
:> : kernel, that is.) I really, really need to have about 30,000 simultaneous
:> : threads. (Don't ask. I just do. ;-)
:>
:> IIRC, Linux creates a new process (more or less) for each thread, so you
:> need to up the total # of processes allowed on the system. (I think
:> there's a text file someplace you can twiddle with to do this)
: That is good advice ... however, I don't own the machine I'm using. :-( My
: home machine's net connection doesn't have the necessary bandwidth for 30,000
: simultaneous connections (see below).
What're the hardware specs for the machine you're going to be running on?
30k threads are going to eat up a fair amount of system resources, and
Linux isn't all that great when it comes to thread handling. (I'd
recommend switching to either VMS, Solaris, or OS/2, but that'd be a
futile recommendation as it sounds like you've got a fixed hardware
platform)
:> However.... Are you really sure you want to do this? You may find that
:> Linux gets a bit cranky with that many threads. (Heck, it wouldn't
:> surprise me if most OSes got cranky with a single process that had 30k+
:> threads in it) It might be better to consider using a thread pool or
:> something like that.
: Well, then I'm stumped. I don't see how using a thread pool would help ... I
: mean, the pool itself would still be constrained by the same 1000 thread
: limit, right? Well, maybe you can think of a better way to do what I'm
: doing.
Yep.
: Basically, I'm trying to connect to several million machines and perform a
: complex dialogue with each machine. Naturally, this means I need to open as
: many simultaneous connections as possible, and it's critical that none of
: them block. This may sound daunting, but it actually only takes a couple
: hours in my current implementation. I'm currently doing this using a state
: machine approach: each connection has a state, and each time through my
: program's outer loop I update the state of each connection. However, I keep
: having to add more states as I develop the program, and the transition rules
: from one state to the next are growing heinously complex as I refine my
: understanding of the dialogue carried out over these connections. The
: frustrating thing is that I can see how very simple the program would be to
: write if I were only worrying about one connection -- no states or transition
: tables, no non-blocking sockets (which never seem to work right on some
: platforms), just one simple, small routine with a couple nested if's! That's
: when it suddenly occured to me that, if I were to use threads, then I could
: just write that one simple small routine and hand it off to multiple threads!
: Much easier code to maintain.
Ah, I see. Clever. Writing a web crawler? :)
Using a thread pool would make scaling easier in some ways--set up a queue
that holds the connection info (pouring more into it if need be) and then
create a boatload of threads that each snag a record out of the queue and
Do The Right Thing with it. (Which may well be the approach you're
considering)
: But then I ran into the 1000 thread limit (which is much reduced from my
: current capability of about 30,000 simultaneous connections), and now you
: tell me that even if I could increase the thread limit, it still might thrash
: Linux... Well, then, I'm all out of ideas. I guess I'll just have to stay
: with the increasingly heinous state-machine implementation, unless anyone can
: think of another way to do it. Hey, if you do, let me know!
Well, more than 1000 simultaneous outbound connections is likely to put
some strain on things, though it sounds like you're currently managing
with 30K. (Yow!) Just out of curiosity, how much longer does it take with
1000 threads vs your current 30K version? (It's always possible that it
just doesn't matter, since you're bottlenecking other places)
Unfortunately what you're running into is a Linux limitation, rather than
a perl one, so there's not much that perl can do to make things better.
The machine you're running on is limited to ~1000 processes/threads, so to
get more threads you'll need to up that limit if you can.
Dan
------------------------------
Date: Sun, 14 Mar 99 20:03:54 GMT
From: postmaster@uu.net (ICG)
Subject: ???? Re: Active perl
Message-Id: <7ch8fr$r7q@world6.bellatlantic.net>
In article <slrn7ekoo0.r9.clay@panix.com>, clay@panix.com (Clay Irving) wrote:
>On Fri, 12 Mar 1999 20:55:58 -0800, Bill Garrett <bgarrett@hamilton.net> wrote:
>
>>Finally, I have got a new computer with win 98 instead of win 3.x
>>So, if I download active perl is that all I need to start writing,
>>editing, and debugging perl scripts. or do I still need some kind of
>>shell access?
>
>You have everything you need to get started.
>
Active Perl? Does this mean that BG is gonna rip-off another
architecture/language? Seems logical, he stole just about everything else.
------------------------------
Date: Sun, 14 Mar 1999 14:50:19 -0600
From: "Peter Moore" <pmoore@interaccess.com>
Subject: Re: [Q] Popping an array element
Message-Id: <7ch80v$ovt$1@remarQ.com>
Chi-Feng Wu wrote in message <7cgqph$2rq$1@news.ee.nthu.edu.tw>...
> The Book tell us that
> $tmp = pop ARRAY
> has the same effect as
> $tmp = $ARRAY[$#ARRAY--];
>
> But why I just get an undefined $tmp while I use the second
> method? Well, like this:
>
> @bugs = qw/Flik Atta Hopper/;
> print @bugs, $/;
> $bugger = $bugs[$#bugs--];
> print $bugger, $/;
>
> then $bugger gets undef.
>
Well the 1st thing is that an array starts a [0] and goes to [2] here and
your asking for $#bugs which is $bugs[3] and then a post decriment which
wont become 2 until after the expression is evaluated. i suppose you would
need pre decriment $bugger = $bugs[--$#bugs];
However, looking at this closer i see someting else which makes me think
that perl uses double linked lists to track its arrays and you are messing
with the link header it seems by doing this "$#bugs--" altering it (which
might be your intention).
ie $bugs[3] and $bugs[-4] are the same reference to the same memory
localtion.
@bugs = (qw/Flik Atta Hopper/);
print "@bugs\n" ;
#print @bugs, $/;
$bugger = $bugs[$#bugs];
print "$bugger \n";
print "------------------------\n";
foreach $v (-4,-3,-2,-1,0,1,2,3){
$bugger = $bugs[$v];
print "\$bugs\[$v\] = $bugger\n";
}
print "-------------------------\n";
$v = --$#bugs; # now we have excluded a link.
print "this is predec bugs $v\n";
print "------------------------\n";
foreach $v (-4,-3,-2,-1,0,1,2,3){
$bugger = $bugs[$v];
print "\$bugs\[$v\] = $bugger\n";
}
print "-------------------------\n";
print $bugger, $/;
So to conclude you first wanted the last element of @bugs but got nothing
because your post decriment took out the link that referenced it to Hopper
and you got an undefined value for
$bugs[3].
interesting
Pete
------------------------------
Date: Sun, 14 Mar 1999 20:12:09 GMT
From: andrew_linmax@my-dejanews.com
Subject: ^^Search Script Help
Message-Id: <7ch56i$65g$1@nnrp1.dejanews.com>
Hi,
I have a script... and i want to make it search or multiple search strings in
multiple fields, but display each search string reults after each other eg
Code #1: 1234
Code #2: 5678
Code #3: 9101
<submit>
then display like this:
1234 , desc , price
5678 , desc , price
etc
here is the search gathering part:
______________________________________________________________________
#!/perl/bin/perl
$fields = 3;
$results = 10;
&parse_form;
$o1 = $FORM{'oc_1'};
$o2 = $FORM{'oc_2'};
$o3 = $FORM{'oc_3'};
$o4 = $FORM{'oc_4'};
$o5 = $FORM{'oc_5'};
$o6 = $FORM{'oc_6'};
$o7 = $FORM{'oc_7'};
$o8 = $FORM{'oc_8'};
$o9 = $FORM{'oc_9'};
$o10 = $FORM{'oc_10'};
$add = $FORM{'add'};
$filename = "ordersdata.txt";
$tempfile = "orders.tmp";
if ($searchstring == "") { $searchstring = "$o1 || $o2 || $o3 || $o4 || $o5 ||
$o6 || $o7 || $o8 || $o9 || $o10"};
>>>> The || (or) command does not help :o(
if ($searchstring == "") { &no };
&open_file("FILE1","",$filename);
while (($line = &read_file("FILE1")) && ($counter < $results)) {
# split the fields at the character
@tabledata = split(/\s*\|\s*/,$line ,$fields);
&check_record;
if ($found == 1) {
$counter++;
&print_record;
}
}
close(FILE1);
print ("</UL>\n");
sub check_record {
$codeno = $tabledata[0];
$product = $tabledata[1];
$price = $tabledata[2];
$searchline = $codeno;
$sfound = 0;
$found = 0;
$notfound = 1;
$stlen = length($searchstring);
if ($stlen > 1) {
@words = split(/ +/,$searchstring);
foreach $aword (@words) {
if ($searchline =~ /\b$aword/i) {
$sfound = 1;
}
else {
$notfound = 0;
}
}
}
if ($sfound == 1 && $notfound == 1) {
$found = 1;
}
# if search string is too small .. set found to 1
if ($stlen <= 1) {
$found = 1;
}
# if page doesn't have a title then return not found
$tlen = length($codeno);
if ($tlen < 1) {
$found = 0;
}
}
sub parse_form {
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
if (length($buffer) < 5) {
$buffer = $ENV{QUERY_STRING};
}
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}
}
sub open_file {
local ($filevar, $filemode, $filename) = @_;
open ($filevar,$filemode . $filename) ||
die ("Can't open $filename");
}
sub read_file {
local ($filevar) = @_;
<$filevar>;
}
sub write_file {
local ($filevar, $line) = @_;
print $filevar ($line);
}
______________________________________________________________________
I can supply the script of needed....
Thanksya
Andrew
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Sun, 14 Mar 1999 15:29:42 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Cleaning up memory
Message-Id: <1donvyn.18fyji51snsciaN@bay1-410.quincy.ziplink.net>
Pete Cion <pcion@cybersource.com> wrote:
> I have run into a situation where I am using rather large variables and
> arrays, and want to clean them out of memory. Unfortunately, neither
> using "undef" nor waiting for them to go out of scope does not work -
> the underlying memory is still tied up.
perlfaq3:
How can I free an array or hash so my program shrinks?
You can't. Memory the system allocates to a program will never
be returned to the system. That's why long-running programs
sometimes re-exec themselves.
However, judicious use of my() on your variables will help make
sure that they go out of scope so that Perl can free up their
storage for use in other parts of your program. (NB: my()
variables also execute about 10% faster than globals.) A global
variable, of course, never goes out of scope, so you can't get
its space automatically reclaimed, although undef()ing and/or
delete()ing it will achieve the same effect. In general, memory
allocation and de-allocation isn't something you can or should
be worrying about much in Perl, but even this capability
(preallocation of data types) is in the works.
--
_ / ' _ / - aka - rjk@linguist.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Sun, 14 Mar 1999 15:29:44 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: deleting an array of words from a string
Message-Id: <1donw4o.9f18vhxl964gN@bay1-410.quincy.ziplink.net>
Jason Q. <pigs_can_fly@mindless.com> wrote:
> foreach (@ignore)
> {
> $string =~ s/^$_ //g;
> $string =~ s/ $_ //g;
> $string =~ s/ $_$//g;
> }
> -----------------------------------------
>
> which will fail if the words to be ignored happen to be next to each
> other because after stripping away " am " (note the spaces), "i" will
> not be recognised because the " " (space) before "i" is already
> stripped away.
Don't remove the spaces before *and* after the word...
$string =~ s/\b$_\b ?//g;
The word boundaries make sure it's a whole word.
The optional space will match if it can, but if not, the word will still
be matched before puncuation or at the end of the string.
And only one space is removed per word, so the spacing stays correct
after the substitution.
HTH!
--
#!/usr/bin/sh -- chipmunk (aka Ronald J Kimball)
perl -s -e'print sort grep { /\s/ } keys %main::
' -- -is -' Just' -' another ' -'Perl ' -'hacker
' http://www.ziplink.net/~rjk/ [rjk@linguist.dartmouth.edu]
------------------------------
Date: Sun, 14 Mar 1999 15:39:06 -0600
From: "Travis" <Travis@wildboysnet.com>
Subject: Here 's a good one !!!
Message-Id: <7chaap$7da$1@ionews.ionet.net>
when using the -w on code I often get a screen full of errors due to the
fact that I forgot an
quotation mark somewhere ( on a print statement ) . Anyone know how the
errors can be saved to a file so
you can read the first offending error ?
Question two
Maybe more difficult
This little known technique lets you transform you perl program as it is
being interpretted.
For instance
you can use it this to encrypt your code and have Perl decrypt it on the fly
Bonus question was in Perl Journal winter 98 They failed to mention the
solution
anyone have it? (I have a nosy sys administrator )
------------------------------
Date: Sun, 14 Mar 1999 15:29:21 -0500
From: "Jim Orona III" <JimOrona@ElegantSolutionsInc.com>
Subject: Re: IDE for Perl
Message-Id: <36ec1b74$0$26211@mojo.crosslink.net>
There are a few IDEs for Perl development, but they run on MS Windows
platforms. They are:
- PerlBuilder from Solution Soft (http://www.solutionsoft.com)
- Perl Debugger from ActiveState (http://www.activestate.com)
- ScriptBuilder from NetObjetcs (http://www.netobjects.com)
I've used PerlBuilder to develop web CGI stuff. It's a decent environment
but it still has some flaws. I've recently been using NetObjects
ScriptBuilder since the scripts I'm developing run in a web context so the
browser is my primary view of the output. And since I'm doing JavaScript as
well, ScriptBuilder is the editor of choice.
I just downloaded the Perl Debugger trial from ActiveState, so I'll give
that a test run.
If you're looking for a full development & test environment, go with either
PerlBuilder or Perl Debugger. I think PerlBuilder has some nice features
for CGI development but works great for all around perl development. The
Perl Debugger looks like it has a feature set equivalent to Perl Builder so
I'm sure you can't go wrong with either one.
If you're looking for a Unix-based environment, you probably will need to
keep looking.... although if you aren't doing platform-specific things in
Perl, I can't see why the scripts wouldn't function in either environment.
I am doing Win32 specific things (like ODBC and Process control) but that's
just because the web server I'm developing for is running on WinNT.
Good luck.
Jim Orona
<swamichandra@my-dejanews.com> wrote in message
news:7cbdda$ggs$1@nnrp1.dejanews.com...
>Is there any IDE (preferably graphical other than X-Emacs) for Perl
>programming.
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Sun, 14 Mar 1999 15:29:45 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Identifier on Perl
Message-Id: <1donwh3.cvru7l1ov7a2yN@bay1-410.quincy.ziplink.net>
Cyril Sarrauste de Menthihre <cyril@ubik.crbm.cnrs-mop.fr> wrote:
> But it's always the same error message :
> Can't find string terminator "STOP" anywhere before EOF at line
> "$JSCRIPT=<<STOP;"
Make sure that the string terminator is alone on the line - no
whitespace before or after - and that the line ends with a newline
character.
--
_ / ' _ / - aka - rjk@linguist.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
perl -e'print<<STOP' -e'Just another Perl hacker' -e'STOP'
------------------------------
Date: Sun, 14 Mar 1999 15:50:22 -0500
From: "Jim Orona III" <JimOrona@ElegantSolutionsInc.com>
Subject: Re: Mail on WinNT - with no mail programm
Message-Id: <36ec2060$0$26211@mojo.crosslink.net>
If you have an SMTP host to do final delivery for you, you can use the
Net::SMTP module. Or you can parse the "To" address, grab the hostname and
open a connection to the host and still do it all with the Net::SMTP module.
I'm pretty sure there's a Net::DNS module too to help you with the name
resolution part, since you want to check for an MX record (or several MX
records) before attempting to deliver directly to the A record of the host.
Especially these days where most high-volume mail services will load-balance
with multiple MX servers to handle incoming SMTP mail.
Anyway, that should get you started. Or you can get an SMTP service that
runs on NT from www.bhs.com or maybe even look at www.winfiles.com for the
same thing. But you will still need Net::SMTP to get your message to your
own SMTP service.
Jim Orona
Juergen <jm@ptn.co.za> wrote in message news:36EA9B4D.40F8DF62@ptn.co.za...
>Hi!
>
>I have a problem! The name of the perl program is ActivePerl. I have
>installed many modules for Mail and so on, but I look for a method, that
>can send emails on WinNT with no sendmail or an other mail program.
>
>Can I do this ?
>
>bye juergen
>
------------------------------
Date: Sun, 14 Mar 99 19:25:31 GMT
From: postmaster@uu.net (ICG)
Subject: Re: Multiple Users Corrupting File
Message-Id: <7ch67s$r7q@world6.bellatlantic.net>
In article <36E9BD14.515946AF@his.com>, Steve Palincsar <palincss@his.com> wrote:
>Eric Patterson wrote:
>>
>> I've run into a problem that I can't figure out. I hope someone here
>> has an answer. I'm running a Perl bulletin board script that is accessible
>> from the internet. Anytime two internet users execute the script within
>> a small period of time files get corrupted. Specifically a file
>> is opened and written too by the first user. The same file is opened
>> by the second user before the first has finshed writing to the file. This
>> is causing loss of data.
>>
>> Is there a way to combat this problem? Is there some way of restricting
>> access to file that is currently open? Or perhaps another way alltogether.
>>
>
>flock
Definately. flock. If you can't flock due to your environment, you may have
to flock yourself. (build your own). When the fill you are trying to protect
gets opened, build another small file. Before the routine accesses the main
file, test for the presence of the small file (the lock file), if it exists,
wait untill it goes away. After the main file access is over, kill the small
file, that clears the lock. Unix does something similar (but better, since
it's already there and Perl makes use of it) that uses the PID of the routine.
Have fun flocking around....
------------------------------
Date: Sun, 14 Mar 1999 15:29:46 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: Problems with files that a script creates, new Perl user
Message-Id: <1donwl0.v7nbjqmwcgs9N@bay1-410.quincy.ziplink.net>
David Bowles <davbow@earthlink.net> wrote:
> I recently changed servers and have run into a file permissions problem.
> Now, when files are created by the Perl script, (the files are user files in
> flat database format), the owner and group of the file defaults to "www" and
> "www" respectively. The permissions are also not set correctly. In this case
> it causes a problem because passwords are contained in the files and they are
> visible by the URL of the file. I can not set permissions or manually
> modify the files. I tried to use chmod within my script but it did not seem
> to have any effect on the files. The server is running Red Hat L. and Apache
> 1.3.
`chown` and `chgrp` the Perl script to the desired owner and group, and
then make it a setuid script with `chmod`. Then the script should be
run as the appropriate owner and group, and any files created will
belong to that owner and group.
Whn you use chmod() in the script, make sure that your mode is an octal
number, and that you account for the effects of umask().
--
_ / ' _ / - aka - rjk@linguist.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Sun, 14 Mar 1999 16:19:37 -0500
From: "Jim Orona III" <JimOrona@ElegantSolutionsInc.com>
Subject: Re: searching a flat file database
Message-Id: <36ec273d$0$26209@mojo.crosslink.net>
Well, if faced with a flat-file situation, I would look at making a
comma-separated values (CSV) file out of it somehow and use DBI / DBD::CSV
modules to access the data.
DBI is described here:
http://www.arcana.co.uk/technologia/perl/DBI/doc/faq.html
I could not possibly cover it any better than the FAQ!!
But using DBI and the CSV driver (see
http://www.arcana.co.uk/cgi/dbi/moduledump?module=DBD::CSV for all the
details) will allow you to use SQL queries to search your data. But even
better than that, if you ever move from flat files to any other database
engine, you won't need to rewrite all your queries! Just change the DBD
module to one of the supported modules (listed here:
http://www.arcana.co.uk/technologia/perl/DBI/) and you're in business.
Well, that is, assuming you use a database that has a DBD module for it!
Good luck.
Jim Orona
P.S. You will need a few additional modules other than the DBI ./ DBD
modules so look closely at the DBD::CSV docs.
Winfield Henry <winfieldh@mindspring.com> wrote in message
news:7ch1n6$b0c$1@camel15.mindspring.com...
>Hello all,
>
>Its been a while since I've done any programming (15years), but a buddy of
>mine has convinced to learn Perl and do some side work for him. I'll have
to
>say Perl is really a neat language and I am enjoying learning it.
>
>I have made a great perl/cgi script to search and ascii txt file '|'
>delimited. Works great using a single word/phrase search key. What I need
to
>be able to do is break up the search key and search for the words
>individually. Heres an example using cars. the database would look like
>
>year|make|model|color
>
>The input search string would be
>
>'1990 ford explorer'
>
>I need to break up the search string into '1990' 'ford' 'explorer' and (I
>think) loop through each record however many times there are items in the
>search string to match them all/partial. Its the breaking up of the search
>string that I'm having difficulties with. Here is the beginning part of the
>code so that you can see how things are coming from the html form.
>
>use CGI qw /:standard :html3/;
> $query = new CGI;
> $datafile = "inns2.txt";
> $search = $query->param('search');
> if($search eq ""){$search = ".";}
> &Do_Search;
> $count=@matches;
> &No_Matches if($count == 0);
> &Print_Results;
> exit;
>sub Do_Search{
> open(DATAFILE,"$datafile");
> while(<DATAFILE>){
> if(/$search/i){
> push @matches, $_;
> } # End of if.
> } # End of while.
> close(DATAFILE);
> return;
>} # End of Do_Search subroutine.
>
>I hope I've not made this incomprehensible. Go easy on me, I'm still
>learning....Thanks for any help. Winfield
>
>
------------------------------
Date: Sun, 14 Mar 1999 15:29:47 -0500
From: rjk@linguist.dartmouth.edu (Ronald J Kimball)
Subject: Re: use diagnostics problem?
Message-Id: <1donwvr.1xhrx121bxppvuN@bay1-410.quincy.ziplink.net>
Mick <horizon@internetexpress.com.au> wrote:
> > What output do you get when you run your script from the command line?
> >
>
> Script works fine from DOS prompt with use diagnostics line commented out, but
> -Output is...(with use diagnostics line), from DOS prompt...C:\Program
> Files\Apache Group\Apache\cgi-bin>perl account.plcouldn't find diagnostic data
> in C:\Perl\5.00502\lib/pod/perldiag.pod C:\PERL\5.
> 00502\lib/MSWin32-x86-object C:\PERL\5.00502\lib
> C:\PERL\site\5.00502\lib/MSWin3
> 2-x86-object C:\PERL\site\5.00502\lib C:\PERL\site\lib . account.pl at
> C:\PERL\5
> .00502\lib/diagnostics.pm line 229, <POD_DIAG> chunk 533.
> BEGIN failed--compilation aborted at account.pl line 5, <POD_DIAG> chunk 533.
>
> Am I missing perldiag.pod?
Yes. Sadly, Activestate chose to convert the POD documentation to HTML,
and then include only the HTML files, but not the original POD
documentation, in their Perl distribution. It is broken in that regard.
Although you still shouldn't be using diagnostics in your CGI script,
you can easily download an original distribution of the Perl source, and
copy the POD documentation over to your current Perl installation.
--
_ / ' _ / - aka - rjk@linguist.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Sun, 14 Mar 1999 21:04:54 GMT
From: dragons@scescape.net (Matthew Bafford)
Subject: Re: use diagnostics problem?
Message-Id: <slrn7eo8dp.d3e.dragons@localhost.localdomain>
Sun, 14 Mar 1999 15:29:47 -0500 -- Ronald J Kimball <rjk@linguist.dartmouth.edu>:
-> Mick <horizon@internetexpress.com.au> wrote:
-> > Am I missing perldiag.pod?
->
-> Yes. Sadly, Activestate chose to convert the POD documentation to HTML,
-> and then include only the HTML files, but not the original POD
-> documentation, in their Perl distribution. It is broken in that regard.
->
-> Although you still shouldn't be using diagnostics in your CGI script,
-> you can easily download an original distribution of the Perl source, and
-> copy the POD documentation over to your current Perl installation.
Or download a newer release from ActiveState, that bug has been fixed for
a few months now.
--Matthew
------------------------------
Date: Mon, 15 Mar 1999 07:44:34 +1100
From: Mick <horizon@internetexpress.com.au>
To: Ronald J Kimball <rjk@linguist.dartmouth.edu>
Subject: Re: use diagnostics problem?
Message-Id: <36EC1FB2.21EFD793@internetexpress.com.au>
Thanks very much for your help!
Works fine now!
Mick
Ronald J Kimball wrote:
> Mick <horizon@internetexpress.com.au> wrote:
>
> > > What output do you get when you run your script from the command line?
> > >
> >
> > Script works fine from DOS prompt with use diagnostics line commented out, but
> > -Output is...(with use diagnostics line), from DOS prompt...C:\Program
> > Files\Apache Group\Apache\cgi-bin>perl account.plcouldn't find diagnostic data
> > in C:\Perl\5.00502\lib/pod/perldiag.pod C:\PERL\5.
> > 00502\lib/MSWin32-x86-object C:\PERL\5.00502\lib
> > C:\PERL\site\5.00502\lib/MSWin3
> > 2-x86-object C:\PERL\site\5.00502\lib C:\PERL\site\lib . account.pl at
> > C:\PERL\5
> > .00502\lib/diagnostics.pm line 229, <POD_DIAG> chunk 533.
> > BEGIN failed--compilation aborted at account.pl line 5, <POD_DIAG> chunk 533.
> >
> > Am I missing perldiag.pod?
>
> Yes. Sadly, Activestate chose to convert the POD documentation to HTML,
> and then include only the HTML files, but not the original POD
> documentation, in their Perl distribution. It is broken in that regard.
>
> Although you still shouldn't be using diagnostics in your CGI script,
> you can easily download an original distribution of the Perl source, and
> copy the POD documentation over to your current Perl installation.
>
> --
> _ / ' _ / - aka - rjk@linguist.dartmouth.edu
> ( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
> / http://www.ziplink.net/~rjk/
> "It's funny 'cause it's true ... and vice versa."
--
----------------------------------------------------------------
HORIZON Software Solutions
Visit Site - http:www.deakin.edu.au/~bellears/horizon/index.html
e-mail - mailto:horizon@internetexpress.com.au
----------------------------------------------------------------
------------------------------
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 5133
**************************************