[10643] in Perl-Users-Digest
Perl-Users Digest, Issue: 4235 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 16 21:07:25 1998
Date: Mon, 16 Nov 98 18:01:33 -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 Mon, 16 Nov 1998 Volume: 8 Number: 4235
Today's topics:
Re: Program mysteriously crashes waiting for file <rootbeer@teleport.com>
Re: Q:Net::NNTP, How to use? - Thanks! <markem@flash.net>
Re: regexp query: s//g not global <rootbeer@teleport.com>
Search engine for files .. <darrensw@eswap.co.uk>
Re: Search engine for files .. (Martien Verbruggen)
Re: Search engine for files .. (brian d foy)
simple math problem nguyen.van@imvi.bls.com
Re: simple math problem (Martien Verbruggen)
Re: sybperl error trapping mpeppler@mbay.net
test for.t failure due to bad rounding everybodydies@my-dejanews.com
Re: The GET, POST and ? request method <garethr@cre.canon.co.uk>
Wanted: Development Partner <trri744@ibm.net>
Re: web-based e-mail client - desperately looking for <rootbeer@teleport.com>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 17 Nov 1998 00:11:25 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Program mysteriously crashes waiting for file
Message-Id: <Pine.GSO.4.02A.9811161601250.27321-100000@user2.teleport.com>
On Sun, 15 Nov 1998 zephaar@my-dejanews.com wrote:
> I have a largish perl script that has been running in production for
> almost 9 months. The program basically waits for a file to arrive in
> a directory and having arrived ftps the file to another machine. I use
> a sleep loop of 30 seconds before waking up and doing:-
>
> for(;;) {
> if ( -e $Filename ) {
> &FTP_files_to_new_machine();
> }
> sleep(30);
> }
When you say that your program "waits for a file to arrive", how is the
file arriving? If it's coming in piece-by-piece, it may not be fully
"arrived" at the time that you do the -e test, and you may be working with
only some of the data.
> The program seems to run for "lomg time" around 3 to 6 weeks before
> mysterioulsy crashing when no files are incoming; presumably while in
> the sleep loop.
No need to presume. Find out! :-)
> I cant seem to get any information on what the error is.
Perl will always say something (if it can); maybe you are throwing away
the error output from your program? If Perl can't say anything, that
usually means there will be a core dump. Set things up with your system so
that the error output goes to a file and so that a core can be generated,
and you'll have the best chance of having a successful autopsy. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 16 Nov 1998 19:17:44 -0600
From: "Mark Manning/Muniz Eng." <markem@flash.net>
Subject: Re: Q:Net::NNTP, How to use? - Thanks!
Message-Id: <3650CEB8.ABD@flash.net>
I just wanted to say thanks to Sam and Paul who both have helped me with
this. With the short routine Sam both posted and e-mailed me I've got a
better grasp on what exactly I need to do. :-)
Thanks guys! I think I've got it now. But if there are any more
problems I'll be sure to post again. Hashes are a bit strange to me
since I don't use them very often. I'm more of an standard array
person. But I could get used to using them. :-)
Later - and thanks again! :-)
------------------------------
Date: Tue, 17 Nov 1998 01:56:57 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: regexp query: s//g not global
Message-Id: <Pine.GSO.4.02A.9811161744100.27321-100000@user2.teleport.com>
On Mon, 16 Nov 1998, Rob Hardy wrote:
> my $b = '(?=^|\s+|$)';
>
> # (this'll probably wrap when posted)
> $test =~
> s/$b(['"]?)(?![^AEIOUaeiou]+['"]?$b)([a-zA-Z][a-zA-Z']*"?)$b/$1.&x($2)/ge;
Maybe we could re-write that to be a touch clearer.
s{
$b # stuff from $b
(['"]?) # either quote mark (in memory 1)
(?! # what's next can't be:
[^AEIOUaeiou]+ # one or more characters other than vowels
['"]? # an optional quote mark of either kind
$b # and that stuff from $b again
)
( # match and remember (in memory 2)
[a-zA-Z] # any of these letters
[a-zA-Z']* # zero or more of these
"? # an optional double-quote
)
$b # and that stuff from $b again
}{
$1 . &x($2)
}gex;
Ahhhhh, now I see what it does. (And I see that it may not be what you
intended. Perhaps you wanted to use \1 in two places? And is $b saying
what you intended it to say?)
> It seems that only the first occurence in the string is being matched.
Maybe that's happening. Have you checked your data, to see whether that's
the case? Since you didn't include the data, I can't say. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 16 Nov 1998 16:55:12 -0800
From: "Darren Sweeney" <darrensw@eswap.co.uk>
Subject: Search engine for files ..
Message-Id: <72qhr2$anq@dfw-ixnews10.ix.netcom.com>
Hi
Does anyone know of a Perl script which will search files on my domain for
content, as opposed to HTML pages?
Thanks
Darren
------------------------------
Date: Tue, 17 Nov 1998 01:30:34 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Search engine for files ..
Message-Id: <_k442.107$Qs1.180@nsw.nnrp.telstra.net>
In article <72qhr2$anq@dfw-ixnews10.ix.netcom.com>,
"Darren Sweeney" <darrensw@eswap.co.uk> writes:
> Hi
>
> Does anyone know of a Perl script which will search files on my domain for
> content, as opposed to HTML pages?
I am afraid you will have to be more clear than that. What is 'my
domain'? What do you mean by 'for content, as opposed to HTML pages'?
Besides that, if you want to find software, you should probably use
the web for that. If you want to write a search thingy, go ahead, try
some things. When you have problems, show us, and we'll try to help.
But please, be clear about what you want.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Make it idiot proof and someone will
Commercial Dynamics Pty. Ltd. | make a better idiot.
NSW, Australia |
------------------------------
Date: Mon, 16 Nov 1998 20:41:15 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Search engine for files ..
Message-Id: <comdog-ya02408000R1611982041150001@news.panix.com>
In article <72qhr2$anq@dfw-ixnews10.ix.netcom.com>, "Darren Sweeney" <darrensw@eswap.co.uk> posted:
> Does anyone know of a Perl script which will search files on my domain for
> content, as opposed to HTML pages?
meaning that HTML pages and content are exclusive? ;)
what sorts of content are you searching (images, txt, ...)?
why does it have to be a Perl script?
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Tue, 17 Nov 1998 01:07:18 GMT
From: nguyen.van@imvi.bls.com
Subject: simple math problem
Message-Id: <72qi87$hdm$1@nnrp1.dejanews.com>
Hi guy,
I have the following file:
____________________________________________________________________AOL_3.0
3437 AOL_4.0 5242 MSIE_4.01 44024 MSIE_3.02 15220 MSIE_3.03 147 AOL_3.0
3437 AOL_4.0 5242 MSIE_2.0 818 MSIE_3.0 5065 MSIE_2.1 277 MSIE_4.0 6397
MSIE_3.01 6637 Netscape_1.1 2 Netscape_2.0 27684 Netscape_1.2 1
Netscape_3.0 4774 Netscape_4.0 51015 Netscape_0.9 11 AOL_3.0 3437 AOL_4.0
5242 MSIE_3.01 6637 MSIE_3.02 15220 MSIE_4.01 44024 MSIE_3.03 147
Netscape_2.10 2 Netscape_2.01 234 Netscape_1.12 2 Netscape_2.02 758
Netscape_3.01 5764 Netscape_3.02 210 Netscape_1.22 367 Netscape_4.01 1900
Netscape_3.03 532 Netscape_4.02 1487 Netscape_3.04 1585 Netscape_4.03
3932 Netscape_4.04 20054 Netscape_4.05 12303 Netscape_4.06 651
_____________________________________________________________________
I want to add up all numbers on the on the second column but could get what
I want. I mean that it didn't add up for me. 2 columns are separated by a tab.
Follwing is my code:
______________________________________________________________________
$ALL_OUT_ORG = new IO::File "< all_out.org";
while (<$ALL_OUT_ORG>)
{
chomp;
@sub_split = split ( /\t/, $_ );
@num_call = $sub_split[1];
$sub_total = 0;
for $x ( @num_call )
{
$sub_total += $x;
print STDOUT "$x\n";
print STDOUT "the subtotal : $sub_total\n";
}
}
$ALL_OUT_ORG->close;
________________________________________________________________________
following is my undesired output:
________________________________________________________________________
3437
the subtotal : 3437
3437
the subtotal : 3437
3437
the subtotal : 3437
5242
the subtotal : 5242
5242
the subtotal : 5242
5242
the subtotal : 5242
818
the subtotal : 818
818
the subtotal : 818
277
the subtotal : 277
277
the subtotal : 277
5065
the subtotal : 5065
5065
the subtotal : 5065
6637
the subtotal : 6637
6637
the subtotal : 6637
15220
the subtotal : 15220
15220
the subtotal : 15220
147
the subtotal : 147
147
the subtotal : 147
6397
the subtotal : 6397
6397
the subtotal : 6397
44024
the subtotal : 44024
44024
the subtotal : 44024
11
the subtotal : 11
2
the subtotal : 2
2
the subtotal : 2
1
the subtotal : 1
367
the subtotal : 367
27684
the subtotal : 27684
234
the subtotal : 234
758
the subtotal : 758
2
the subtotal : 2
4774
the subtotal : 4774
5764
the subtotal : 5764
210
the subtotal : 210
532
the subtotal : 532
1585
the subtotal : 1585
51015
the subtotal : 51015
1900
the subtotal : 1900
1487
the subtotal : 1487
3932
the subtotal : 3932
20054
the subtotal : 20054
12303
the subtotal : 12303
6519
the subtotal : 651
_____________________________________________________________________
please take a look at it to see what wrong or give me a better advise.Thanks
Van
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 17 Nov 1998 01:37:35 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: simple math problem
Message-Id: <zr442.109$Qs1.180@nsw.nnrp.telstra.net>
Please read the following information on how to choose a good subject
line: http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
In article <72qi87$hdm$1@nnrp1.dejanews.com>,
nguyen.van@imvi.bls.com writes:
> Hi guy,
who's guy?
> I have the following file:
This file has many more than two columns, and not every second column
is a number. If you post this stuff, make sure that you post
correctly. Also: you don't have to post everything, just a little
piece will do.
[snip]
> $ALL_OUT_ORG = new IO::File "< all_out.org";
You should check to see if this worked.
# perldoc IO::File
simpler may be:
open(ALL_OUT_ORG, "all_out_org") ||
die "Couldn't open all_out_org for read: $!";
> while (<$ALL_OUT_ORG>)
> {
> chomp;
> @sub_split = split ( /\t/, $_ );
> @num_call = $sub_split[1];
> $sub_total = 0;
You set $sub_total to 0 for every line. Is that what you want?
> for $x ( @num_call )
> {
> $sub_total += $x;
> print STDOUT "$x\n";
> print STDOUT "the subtotal : $sub_total\n";
> }
> }
You're not using strict, and probably not running with -w:
#!/usr/local/bin/perl5.00502 -w
my $total = 0;
while(<DATA>)
{
my ($browser, $num) = split;
$total += $num;
print "Subtotal: $total\n";
}
print "Total: $total\n";
__DATA__
CRAP_1.02 12
CRAP_2.02 13
CRAP_3.04a 14
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Little girls, like butterflies, need no
Commercial Dynamics Pty. Ltd. | excuse - Lazarus Long
NSW, Australia |
------------------------------
Date: Tue, 17 Nov 1998 00:49:17 GMT
From: mpeppler@mbay.net
To: curt_sauer@my-dejanews.com
Subject: Re: sybperl error trapping
Message-Id: <72qh6d$gjk$1@nnrp1.dejanews.com>
In article <70iqfd$8n4$1@nnrp1.dejanews.com>,
curt_sauer@my-dejanews.com wrote:
> I am trying to determine when I loose my connection to the database using
> eval so that I can attempt to reconnect. I have been unsuccesful so far
> because although eval traps the error my entrire process disapears right
> after. Has this happened to anyone else or am I doing something very stupid?
> Any help will be greatly appreciated.
Sorry I missed this earlier...
Could you tell me which of the APIs you are using?
Also - have you installed an error or message handler (via dbmsghandle()
or ct_callback()?)
Which version of sybperl are you using?
Thanks,
Michael
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Mon, 16 Nov 1998 22:50:20 GMT
From: everybodydies@my-dejanews.com
Subject: test for.t failure due to bad rounding
Message-Id: <72qa7d$aig$1@nnrp1.dejanews.com>
i'm trying to build perl5.005_02 on a sparc box running solaris 2.5.1, and
i'm seeing a really odd failure. it seems that ordinary integer values
(4 and 8 are big culprits) are being improperly rounded to floats (like
3.999999 and 7.999997). this is seen in the for.t test among others:
1..7
#1 :10: eq :10:
#1 :0 1 2 3 3.999999 5 6 7 7.999997 9 10: eq :0 1 2 3 4 5 6 7 8 9 10:
not ok 1
ok 2
not ok 3
ok 3.999999
ok 5
ok 6
ok 7
i've tried building with compiler optimizations on and off, i've tried
building with egcs-1.1, gcc-2.8.1, gcc-2.7.2.3, and i get the same thing
every time. now, i can't imagine that i'm the first person to come across
this, seeing as sparcs running solaris are incredibly popular machines. so,
what's the story? what do i have to do to fix this? is there some secret
patch from sun for the os that i need (i have the "recommended" patches as of
9/22/1998 installed), or perhaps some special configuration option that i
haven't set?
any help would be appreciated. thanks.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 17 Nov 1998 00:10:00 GMT
From: Gareth Rees <garethr@cre.canon.co.uk>
Subject: Re: The GET, POST and ? request method
Message-Id: <si4srzuqlj.fsf@cre.canon.co.uk>
Rafely@xxiname.com wrote:
> I was going through Matt Wright's form script and I notice that he
> checks if the request method is GET or POST. If it's neither, then the
> script will print an error message. But I don't understand how it can
> be neither? Are there any other request methods?
There certainly are! If you take a look at RFC 2068, which defines HTTP
version 1.1, you'll discover these request methods:
OPTIONS A client uses this method to inquire as to the options
available for the requested URL (for example, which
languages is the document available in? or which image
formats is the picture available in?). The server
responds with a Vary: header.
HEAD The client sending this method just wants the HTTP
header, not the body of the URL; typically they're
interested in verifying the existence of the document,
or in checking the "Last-modified" header to determine
if their cache is out of date.
PUT Typically used for file upload to the server.
DELETE Used to delete information on the server.
TRACE Requests diagnostic information about the chain of
proxies between the client and the server.
You can get RFC 2068 from ftp://src.doc.ic.ac.uk/rfc/rfc2068.txt or
other RFC repositories.
> I never check the request method in my scripts, is this bad??
You needn't worry about the methods above, but there are differences
between GET and POST:
GET methods encode parameters in the query part of the URL
POST methods encode parameters in the request body
Assuming you're using CGI.pm or CGI-modules, the above is taken care of,
but you might want to think about these difference:
(9.1.1) A GET method is supposed to be "safe": it shouldn't
delete or change anything on the server. A POST method is "unsafe":
it is expected to delete or change something on the server.
(9.3, 9.5) In general, a URI retrieved by a GET method may be cached,
and a URI retrieved by a POST method may not be cached.
Taken together, these explain why when you reload a page that was the
result of a POST, a browser asks you whether you want to resend the form
data, while it does not if the same page had been a result of a GET.
> And must GET and POST always be in upper case??
Yep. From section 5.1.1 of RFC 2068:
The Method token indicates the method to be performed on the resource
identified by the Request-URI. The method is case-sensitive.
--
Gareth Rees
------------------------------
Date: Tue, 17 Nov 1998 01:03:16 +0100
From: "trri744@ibm.net" <trri744@ibm.net>
Subject: Wanted: Development Partner
Message-Id: <3650BD44.B06B8733@ibm.net>
Wanted: Development Partner Perl -> Java/SQL/CORBA.
We are offering an unique business opportunity to jump into a joint
venture online since 1996. Accidentially we lost the developer of
100+ well documented Perl5 scripts. The app is integral part of a
pioneering business model with other apps in the area of community
building.
We expect an expert who is able to migrate the existing app from
Perl5 to Java/SQL/CORBA, and to develop it further according market
requirements. The developer shall be able to spend at least 20
hours/week. The compensation will be based on the margin the joint
venture generates. Note, we are not looking for a temporary
freelancer. Instead we want a trustfull and long-term partnership.
Please send the resume, also add some argumentation why you/your
company could be the valuable development partner.
Thanks,
trri744@ ibm.net
------------------------------
Date: Tue, 17 Nov 1998 01:02:21 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: web-based e-mail client - desperately looking for
Message-Id: <Pine.GSO.4.02A.9811161702000.27321-100000@user2.teleport.com>
On Sun, 15 Nov 1998, JTJ wrote:
> I'm looking for an easy to install web-based e-mail client.
Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.
http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 12 Jul 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 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 4235
**************************************