[8041] in Perl-Users-Digest
Perl-Users Digest, Issue: 1666 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jan 18 15:06:43 1998
Date: Sun, 18 Jan 98 12:00:29 -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, 18 Jan 1998 Volume: 8 Number: 1666
Today's topics:
Re: Apache and PerlIS: How to get together? <thiele@berlin.snafu.de>
Basic Date Functions for Win32 Perl? <whitehouse@wharton.upenn.edu>
can anybody help me please? <jahnel@xarch.tu-graz.ac.at>
Re: can anybody help me please? <ajohnson@gpu.srv.ualberta.ca>
Re: Changing Case (Gabor)
Re: Changing Case (Tad McClellan)
Re: Changing Case (Clay Irving)
Re: Changing Case (brian d foy)
Re: Enumeration under perl (Kevin Reid)
exit from a 'loaded' package in mod_perl <avivc@amdocs.com>
Extract login & password from FTPs icekewl@mailcity.com
Help with MakeMaker, DBI, DBD::DB2, DBD::ODBC <eatonn@email.msn.com>
Re: Help! Perl.lib corrupt/invalid when compiling embed (Gurusamy Sarathy)
Re: How to search for duplicate elements <beans@bedford.net>
How to sorting lists alphabetically? <michael.georgiadis@btinternet.com>
I am still a virgin <katigaebler@hotmail.com>
Re: I am still a virgin <sfarrell+usenet@farrell.org>
Re: I need some help pleeze (Clay Irving)
Re: I want to create as many thread as socket connectio <tschur@tsa.de>
Re: Looking for better Text::GenderFromName nospam@domain.com
Re: Looking for better Text::GenderFromName (Clay Irving)
Newbie question <eyalb@bvr.co.il>
no output (Gustav Kristoffer Ek)
Re: novice question: ranking array elements <joseph@5sigma.com>
Re: Perl on NT server 4.0 <thiele@berlin.snafu.de>
Problems using Client-Server IPC <tschur@tsa.de>
Re: Puzzling behavior of c.l.p.* readers <a@b.c.d>
Re: Q: Regional Sort by ZIP code? (Clay Irving)
Re: What is wrong with this script? (Jonathan Stowe)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 18 Jan 1998 14:38:23 +0100
From: Heiko Thiele <thiele@berlin.snafu.de>
Subject: Re: Apache and PerlIS: How to get together?
Message-Id: <34C205CF.CB5ACEF0@berlin.snafu.de>
Hi Manri,
Manri Offermann wrote:
[...]
>make sure you have the following lines in access.conf:
>
> <Directory /document_root_path/cgi-bin>
> AllowOverride None
> Options None
> </Directory>
>
I set "Options +ExecCGI", and it worked anyway :-)
> #!c:/path/to/perl.exe
> #
Yes, OK. Thanks so far.
The remaining question is: How to use *ISAPI* with Apache and Perl on
NT? Might be faster than CGI ...
CU
Heiko
--
Heiko Thiele
mailto:h.thiele@sdc.de
phone:[+49] [177] 631 22 66
------------------------------
Date: Sun, 18 Jan 1998 14:09:48 -0500
From: Kendall Whitehouse <whitehouse@wharton.upenn.edu>
Subject: Basic Date Functions for Win32 Perl?
Message-Id: <34C2537C.31A68E8C@wharton.upenn.edu>
I have an application that uses the Win32 implementation of Perl, and I
need to do some basic date manipulations. For example, I need to
convert a local time string into GM time and I need to be able to
calculate the correct day, date, and time N hours from now.
I started doing this on my own, but quickly realized I was sinking into
a pit of quicksand -- You have to keep track of when the hour "rolls
over" after 23:59, calculate the next day and date, worry about whether
the date rolls over after day 30, or 31, or 28, or 29 depending on both
the month and the year. What a nightmare!
I looked at the Date::Minip module which appears to do everything I need
(and much more), but I'm beginning to get the sinking feeling that this
doesn't easily transport to the Win32 environment.
Does anyone know of any date functions that already exist that I can
plug into any Perl implementation to give me the capabilities I need?
Thanks for your help.
:Kendall
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Kendall Whitehouse
Associate Director, Wharton Computing and Information Technology
The Wharton School of the University of Pennsylvania
(215) 898-2742
whitehouse@wharton.upenn.edu
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
------------------------------
Date: Sun, 18 Jan 1998 15:49:47 +0100
From: Jahnel Klaus <jahnel@xarch.tu-graz.ac.at>
Subject: can anybody help me please?
Message-Id: <34C2168B.9AE840BA@xarch.tu-graz.ac.at>
i ve a file with datas:
232 klaus 2305
258 klaus 2215
596 klaus 2305
108 klaus 1725
698 klaus 0000
487 klaus 0855
I want to read the data in (one line is a data set)
and then put it out again but sortedon the 3rd entry
like this:
698 klaus 0000
487 klaus 0855
596 klaus 1205
108 klaus 1725
232 klaus 2305
258 klaus 2305
How can i perform this (but please no linls to perlfaq i have read it no
luck)
klaus
------------------------------
Date: Sun, 18 Jan 1998 13:10:53 -0600
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: can anybody help me please?
Message-Id: <34C253BD.3076A81F@gpu.srv.ualberta.ca>
Jahnel Klaus wrote:
>
> i ve a file with datas:
> 232 klaus 2305
> 258 klaus 2215
> 596 klaus 2305
> 108 klaus 1725
> 698 klaus 0000
> 487 klaus 0855
>
> I want to read the data in (one line is a data set)
> and then put it out again but sortedon the 3rd entry
> like this:
> 698 klaus 0000
> 487 klaus 0855
> 596 klaus 1205
> 108 klaus 1725
> 232 klaus 2305
> 258 klaus 2305
>
> How can i perform this (but please no linls to perlfaq i have read it no
> luck)
well, perlfaq4 gives an example of such, under the question "How do
I sort an array by (anything)?" ... and also suggests:
See http://www.perl.com/CPAN/doc/FMTEYEWTK/sort.html for more about
this approach.
here is an example of the same geared to your data:
#!/usr/bin/perl -w
print map {$_->[0]}
sort {$a->[3] <=> $b->[3]}
map {[$_,split]} <DATA>;
__DATA__
232 klaus 2305
258 klaus 2215
596 klaus 2305
108 klaus 1725
698 klaus 0000
487 klaus 0855
hope it helps
regards
andrew
------------------------------
Date: 18 Jan 1998 15:20:38 GMT
From: gabor@vinyl.quickweb.com (Gabor)
Subject: Re: Changing Case
Message-Id: <slrn6c46uf.dkh.gabor@vinyl.quickweb.com>
In comp.lang.perl.misc, Brad Grove <brad.grove@b131.aone.net.au> wrote :
# Hi
#
# I have only just recently started writing in Perl and am still finding my
# way. How can I change a string to Upper and Lower Case. It is easy to change
# to either lower case or upper case but how can I change a string so that the
# first letter of every word is upper case and the rest is in lower case.
#
# Thanks in advance
s/\b([a-z])/\u$1/g;
gabor.
--
3 syncs represent the trinity - init, the child and the eternal
zombie process.
-- Jordan K. Hubbard
------------------------------
Date: Sun, 18 Jan 1998 09:23:11 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Changing Case
Message-Id: <vo6t96.rvd.ln@localhost>
Brad Grove (brad.grove@b131.aone.net.au) wrote:
: I have only just recently started writing in Perl and am still finding my
: way.
The first place to look in finding your way is the documentation
that came with your perl distribution...
(I found it by searching for 'capitalize' in all the '=head2' lines
in the Perl FAQ sections)
: How can I change a string to Upper and Lower Case. It is easy to change
: to either lower case or upper case but how can I change a string so that the
: first letter of every word is upper case and the rest is in lower case.
Your's is a Frequently Asked Question.
from the Perl FAQ, part 4:
"How do I capitalize all the words on one line?"
There's code there too.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 18 Jan 1998 11:52:12 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: Changing Case
Message-Id: <69tbvs$1fc@panix.com>
In <69sjj0$m5v$1@news.mel.aone.net.au> "Brad Grove" <brad.grove@b131.aone.net.au> writes:
>I have only just recently started writing in Perl and am still finding my
>way.
You should find your way to the documentation that came with your Perl
distribution (which is also available online at http://language.perl.com).
>How can I change a string to Upper and Lower Case. It is easy to change
>to either lower case or upper case but how can I change a string so that the
>first letter of every word is upper case and the rest is in lower case.
Perhaps you need to look at the FAQ:
How do I capitalize all the words on one line?
http://www.perl.com/CPAN/doc/manual/html/pod/perlfaq4/How_do_I_capitalize_al_the_word.html
To make the first letter of each word upper case: $line =~ s/\b(\w)/\U$1/g;
To make the whole line upper case: $line = uc;
To force each word to be lower case, with the first letter upper case:
$line =~ s/(\w+)/\u\L$1/g;
--
Clay Irving <clay@panix.com> I think, therefore I am. I think?
http://www.panix.com/~clay/
------------------------------
Date: Sun, 18 Jan 1998 13:57:00 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Changing Case
Message-Id: <comdog-1801981357000001@news.panix.com>
Keywords: just another new york perl hacker
In article <slrn6c46uf.dkh.gabor@vinyl.quickweb.com>, gabor@vinyl.quickweb.com (Gabor) posted:
> In comp.lang.perl.misc, Brad Grove <brad.grove@b131.aone.net.au> wrote :
> # I have only just recently started writing in Perl and am still finding my
> # way. How can I change a string to Upper and Lower Case. It is easy to change
> # to either lower case or upper case but how can I change a string so that the
> # first letter of every word is upper case and the rest is in lower case.
> s/\b([a-z])/\u$1/g;
even though that is the what the FAQ would have one think, it
isn't a very good solution. witness:
#!/usr/bin/perl
$string = "this doesn't work";
$string =~ s/\b([a-z])/\u$1/g;
print "$string\n";
__END__
This Doesn'T Work
an alternate solution that takes care of that is
$string =~ s/ (
(?:^['"]?\w) #at the beginning of the line
| # or
(?:\s['"]?\w) #preceded by whitespace
)
/\U$1/xg;
you could also expand the character class to include embedded non-
alphanumerics such as the apostrophe and the hyphen (although it
gets tricky for single quoted text.) the above would need to be fixed
up to deal with the ``foo'' type quoting, but the concept is the same.
--
brian d foy <http://computerdog.com>
------------------------------
Date: Sun, 18 Jan 1998 11:28:45 -0500
From: kpreid@ibm.net (Kevin Reid)
Subject: Re: Enumeration under perl
Message-Id: <1d31t5q.1vzzd4512o7ps0N@slip166-72-108-141.ny.us.ibm.net>
Abigail <abigail@fnx.com> wrote:
> Randal Schwartz (merlyn@stonehenge.com) wrote on 1601 September 1993 in
> <URL: news:8cra66k169.fsf@gadget.cscaper.com>:
> ++ >>>>> "Ralph" == Ralph J Smith <rjsmith@ilnds.com> writes:
> ++
> ++ Ralph> Does Perl have a way to do enumeration.
> ++
> ++ Ralph> enum{RED,WHITE,BLUE,GREEN};
> ++
> ++ {
> ++ my $i = 0;
> ++ use constant
> ++ RED => $i++,
> ++ WHITE => $i++,
> ++ BLUE => $i++,
> ++ GREEN => $i++,
> ++ ;
> ++ }
>
> But that doesn't work!
Whether or not it works, it fills up your namespace. How about this:
#!perl -w
package Enum;
use strict;
use Carp;
sub new {
my ($class, @names) = @_;
my $self = {value => 1, names => [@names]};
bless $self, $class;
}
sub TIESCALAR {new @_}
sub AUTOLOAD {
no strict 'vars';
my $self = shift;
$AUTOLOAD =~ s/(\w+::)+//; # strip package name
map {$_ eq $AUTOLOAD} $self->{names}
or croak "Invalid value \"$AUTOLOAD\""; # legal value?
$self->{value} = $AUTOLOAD;
}
sub FETCH {$_[0]->{value}}
sub val {$_[0]->{value}}
sub STORE {
no strict 'vars';
$AUTOLOAD = $_[1]; $_[0]->AUTOLOAD}
package main;
my $e;
$e = Enum->new(qw(red green blue yellow purple black white));
$e->red;
print $e->val;
$e = tie my $v, 'Enum', qw(red green blue yellow purple black white);
$v = "blue";
print $v;
$e->purple; # do it the other way too
print $e->val;
__END__
--
Kevin Reid. | Macintosh.
"I'm me." | Think different.
------------------------------
Date: Sun, 18 Jan 1998 10:11:44 -0600
From: Aviv Cohen <avivc@amdocs.com>
Subject: exit from a 'loaded' package in mod_perl
Message-Id: <885139420.1562509326@dejanews.com>
While running under Apache/mod_perl, if I exit from a package that was
loaded on the server startup, the client will not know about it and my
browser will give the response 'document contains no data'. How do I go
around it? If I exit from a script/package that was loaded 'on the fly'
the problem will not occur.
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Sun, 18 Jan 1998 12:21:27 -0600
From: icekewl@mailcity.com
To: ice9kewl@yahoo.com
Subject: Extract login & password from FTPs
Message-Id: <885146788.1830682629@dejanews.com>
Hi all,
I wrote a little program using LWP to extract FTPs
but I can't figure out how to extract login & password
if I found FTP address like ftp://login:password@cybersearch.com.
Any help/suggestion would be mostly appreciated.
-ICE
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Sun, 18 Jan 1998 13:43:19 -0600
From: "Nathan Eaton" <eatonn@email.msn.com>
Subject: Help with MakeMaker, DBI, DBD::DB2, DBD::ODBC
Message-Id: <eOEJUlEJ9GA.214@upnetnews03>
I'm lookin for help with several problems.
Backgound information:
* I have been using Perl 4 for years and just switched to Perl 5
* I have build 315 of the Intel binaries and source from ActiveState; it
works find (including running several complex Perl 4 scripts)
* I have Visual C++ 2.0, which appears to be useless since build 315 was
compiled with Visual C++ 4.0
* I don't have a copy of gcc or gcc++, though I have access to it
Problems:
* Before I can install DBI and DBD::*, I need to install MakeMaker; when I
try to install it, I get the following message:
Checking if your kit is complete...
Looks good
Error: Unable to locate installed Perl libraries or Perl source code.
It is recommended that you install perl in a standard location before
building extensions. Some precompiled versions of perl do not contain
these header files, so you cannot build extensions. In such a case,
please build and install your perl from a fresh perl distribution. It
usually solves this kind of problem.
(You get this message, because MakeMaker could not find "\CORE\perl.h")
* Even after I can get MakeMaker to install itself, I am concerned about
how, without VC++ 4.0, I will be able to compile code
for the DBD::* components.
* It looks like DBD::DB2 supports DB2/2; is anyone working on a port for
Universal Database Server (UDB) or UDB Extended
Enterprise Edition (UDB EEE)? I understand that there is a current
direction of moving towards ODBC for all Perl database
access, but UDB EEE is my primary target, and we would rather have direct
database access when running this stuff across
a 20-30 node SP2 than to rely on ODBC.
* Does anyone have copies of precompiled Intel Win32 binaries for DBD::ODBC
or DBD::DB2
Thanks for any and all assistance,
Nathan Eaton
------------------------------
Date: 18 Jan 1998 18:02:27 GMT
From: gsar@engin.umich.edu (Gurusamy Sarathy)
Subject: Re: Help! Perl.lib corrupt/invalid when compiling embeded perl under VC++ 5.0
Message-Id: <69tg3j$p19@srvr1.engin.umich.edu>
[ mailed and posted ]
In article <34B625CD.9AC6F4E6@csi.com>, Piers <pxharding@csi.com> wrote:
>
>I am trying to compile a simple ( pod example ) embeded perl program
>with V C++ 5.0, and the Binary distribution of Perl ( for NT ) 5.004_2.
>I get the following error message at linking time:
>
>C:\perl\bin\Perl.dll : fatal error LNK1136: invalid or corrupt file
>Or
>C:\perl\bin\Perl.lib : fatal error LNK1136: invalid or corrupt file
It is critical that you respond correctly when the installation
process asks whether you have a C compiler installed. The
perl.lib file is different for the two compilers. The README
should probably shout out this fact louder than it does, sorry
about that.
In your case it would seem you either said you don't have a C
compiler or that you have the Borland compiler. Reinstall, and
this time say 'no' to the Borland C question, and 'yes' to the
Visual C question.
- Sarathy.
gsar@umich.edu
------------------------------
Date: 18 Jan 98 15:56:32 GMT
From: "Tom H" <beans@bedford.net>
Subject: Re: How to search for duplicate elements
Message-Id: <01bd1da2$12d50620$289163ce@beans.bedford.net>
This must be a popular homework assignment for Per 101 classes, it seems to
show up every couple of weeks.
J1T1W1 <j1t1w1@aol.com> wrote in article
<19980118014100.UAA25860@ladder01.news.aol.com>...
> All,
> is there a trivial script to search for duplicate elements in an array
and
> print their totals. If so can someone provide me with an answer. Thanks
in
> advance.
>
> R/ J1T1W1
>
------------------------------
Date: Sun, 18 Jan 1998 15:51:14 -0800
From: "Michael Georgiadis" <michael.georgiadis@btinternet.com>
Subject: How to sorting lists alphabetically?
Message-Id: <69t8ls$229$1@uranium.btinternet.com>
i have a file with entries (1 per line) in the following form:
company name,description,tel,fax,email
company name,description,tel,fax,email
company name,description,tel,fax,email
company name,description,tel,fax,email
and so on...
the name of the company in the first line may be Zephyr and the second may
be Acme. i want to be able to write some code which will read in one line at
a time and then sort the list alphabetically and output to <STDOUT>
also, is it possible to write some code to search for a particular word
within the list?
any comments/suggestions are greatly appreciated
cheers
--
=============================================
Michael Georgiadis
24b High Street
Putney
London SW15 1SL
email: michael.georgiadis@btinternet.com ;
progressive.systems@btinternet.com (web-site related emails)
web site: www.progressive.co.za
------------------------------
Date: Sun, 18 Jan 1998 17:00:08 +0100
From: Kati <katigaebler@hotmail.com>
Subject: I am still a virgin
Message-Id: <34C22707.304E3D13@hotmail.com>
Hello,
Could someone help me get started.
I made a simple test and placed
it in my cgi bin:
#!/usr/bin/perl
print "Content-Type: text/html\n\n";
print "This is my first test\n";
exit;
Naturally - this should return the
words "This is my first Test".
I do the chmod a+x test.pl, then
type test.pl and the shell returns
correctly "This is my first test".
But when I access the same file
via Netscape browser, the phrase
is not printed, the above file
is shown in full as ASCII characters.
How can I could make this work,
please kindly help me out.
Kati
------------------------------
Date: Sun, 18 Jan 1998 17:00:17 GMT
From: stephen farrell <sfarrell+usenet@farrell.org>
Subject: Re: I am still a virgin
Message-Id: <87d8hpogym.fsf@phaedrus.uchicago.edu>
Kati <katigaebler@hotmail.com> writes:
> Hello,
>
> Could someone help me get started.
>
> I made a simple test and placed
> it in my cgi bin:
>
> #!/usr/bin/perl
>
> print "Content-Type: text/html\n\n";
> print "This is my first test\n";
>
> exit;
>
> Naturally - this should return the
> words "This is my first Test".
>
> I do the chmod a+x test.pl, then
> type test.pl and the shell returns
> correctly "This is my first test".
>
> But when I access the same file
> via Netscape browser, the phrase
> is not printed, the above file
> is shown in full as ASCII characters.
>
> How can I could make this work,
> please kindly help me out.
Often this is a webserver configuration issue--the webserver does not
know that a .pl files should be executed and instead just prints it
out. Bring it up with your sysadmin, or any documentation you might
have on how your webserver is configured. Also, try changing to a
.cgi extension, which is often configured to do what you want.
--sf
------------------------------
Date: 18 Jan 1998 11:38:13 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: I need some help pleeze
Message-Id: <69tb5l$ke@panix.com>
In <34C15176.2983@datasync.com> Jay Hodges <jhodges@datasync.com> writes:
>I have written a survey results tabulation script and am having a
>strange problem. The problem code is listed below:
> if ($sex == "M") {$sex_a++;}
> elsif ($sex == "F") {$sex_b++;}
>These lines look harmless but in fact when executed the "M" counter gets
>incremented every time executed (regardless of the value of the $sex
>variable) and the 'elsif' part doesnt get evaluated. Furthermore, if I
>comment out the 'if' line and change the 'elsif' to an 'if' THAT line
>now gets evaulated as TRUE (no matter what is in the $sex variable). I
>am not new to programming and have written in several languages. I have
>just began to write in PERL and this problem is stumping me. Am I as
>stupid as I feel? Someone help please!
You'll probably feel more stupidity when you realize you should have used:
if ($sex eq "M") {$sex_a++;}
elsif ($sex eq "F") {$sex_b++;}
You're right, though -- "M" will be evaluated as true.
--
Clay Irving <clay@panix.com> I think, therefore I am. I think?
http://www.panix.com/~clay/
------------------------------
Date: Sun, 18 Jan 1998 17:36:54 +0100
From: Mario Tschursch <tschur@tsa.de>
Subject: Re: I want to create as many thread as socket connection to read/write data (Win NT)
Message-Id: <34C22FA5.E05339BE@tsa.de>
The're serveral examples, first try the
perlipc - manpage
and second (a running implementation)
SPONG.1.1 (download from http://strobe.weeg.uiowa.edu/~edhill/public/spong/)
see the spong-server.pl
--
+----------------------------------------------------------------+
| Mario Tschursch (tschur@tsa.de) \\ MUD: Bert@FinalFrontier |
| Teleport Sachsen-Anhalt GmbH \\ WWW: http://ff.mud.de/ |
| Steinfeldstr. 3 / Barleben 39179 \\ TELNET: ff.mud.de 7600 |
| Tel. 039203-82030 Fax. 039203-82031 \\EMAIL: mud@ff.mud.de |
+----------------------------------------------------------------+
------------------------------
Date: Sun, 18 Jan 1998 15:45:13 GMT
From: nospam@domain.com
Subject: Re: Looking for better Text::GenderFromName
Message-Id: <dspw.94$Mf2.1493555@news2.voicenet.com>
Clay Irving (clay@panix.com) wrote:
: Text::GenderFromName returns undefined for Mark, Bob, Bill, Ralph, etc.
: Has anyone built better regexps to catch more male names?
I'm a newbie here, so please forgive me for speaking up...
Isn't it basically futile to use regexes here? This module
can't possibly guarantee any accuracy, just a reasonable guess,
based on names it already knows about. This sounds like a lookup table.
Why not just use an exhaustive list of names? The number of
all names everywhere is finite.
I once had a friend from China whose name was Chi.
Quick: Boy or girl?
I mean, couldn't you also write a module which applied a regex
to the text name of a city and attempted to report on its climate?
Sure, you could -- but why bother?
Please forgive the sarcasm. Is this module just for fun,
or is there really some utility to it, that's not so obvious?
--
##--------------------------------
## John Nolan
## jpn acm org
##--------------------------------
------------------------------
Date: 18 Jan 1998 11:41:46 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: Looking for better Text::GenderFromName
Message-Id: <69tbca$ok@panix.com>
In <34C1519B.C006ECD2@DollarDirectory.Com> INFORMATION <adinfo@DollarDirectory.Com> writes:
>The following awk script is very good. Perhaps it can help.
># by Scott Pakin 8/91 in CLM 12/91
Heh. Jon's Text::GenderFromName module is based on that awk script. Jon added
a few more rules to the awk script, though. I was wondering if in the last six
years anyone developed any more rules...
--
Clay Irving <clay@panix.com> I think, therefore I am. I think?
http://www.panix.com/~clay/
------------------------------
Date: Sun, 18 Jan 1998 21:16:15 +0200
From: Eyal <eyalb@bvr.co.il>
Subject: Newbie question
Message-Id: <34C254FF.41C6@bvr.co.il>
Hi,
I have some pure virtual functions in my C++ header file.
i want to use perl to find their name.
e.g if have this:
virtual void coordButtonClicked(Widget, XtPointer, XtPointer) = 0;
I want as an output :
void coordButtonClicked
Thanks.
--
\\\|///
\\ ~ ~ //
( @ @ )
================oOOo=(_)=oOOo================
Eyal Bar Ilan BVR Technologies
eyalb@bvr.co.il
=========================Oooo================
oooO ( )
( ) ) /
\ ( (_/
\_)
------------------------------
Date: Sun, 18 Jan 1998 20:06:17 +0100
From: stoffer@netcetera.dk (Gustav Kristoffer Ek)
Subject: no output
Message-Id: <stoffer-1801982006180001@loke.netcetera.dk>
In a cgi-scipt I need to run other programs, but if I use something like:
system ("$program");
I got unwanted output and it isn't posible to use:
system ("$program", ">/dev/null");
but this works, just fine:
open HANDLE, "$program|");
while (<HANDLE>) {
# do nothing...
}
close HANDLE;
but it dosn't look nice...
any better sugestions?
- gustav
---------------------------------------------------------------------
Gustav Kristoffer Ek - Netcetera - Finsensvej 80 - 2000 Frederiksberg
tlf 38 88 32 22 / 20 40 00 05 / 38 88 20 38 ext 341 - Fax 38 88 30 38
Webdesign, Webhotel, Mailhotel, UUCP og mere http://www.netcetera.dk/
------------------------------
Date: Sun, 18 Jan 1998 11:33:49 -0700
From: "Joseph N. Hall" <joseph@5sigma.com>
Subject: Re: novice question: ranking array elements
Message-Id: <34C24AC9.C9A36622@5sigma.com>
Oh, it does work better on numbers with <=> instead of cmp.
Doh!
-joseph
Joseph N. Hall wrote:
>
> Funny you should ask this. You can find it on p.247 of my book,
> or, dispensing with the explanation:
>
> @rank[sort {$x[$a] cmp $x[$b]} 0..$#x] = 0..$#x
------------------------------
Date: Sun, 18 Jan 1998 16:55:02 +0100
From: Heiko Thiele <thiele@berlin.snafu.de>
Subject: Re: Perl on NT server 4.0
Message-Id: <34C225D6.63311CE2@berlin.snafu.de>
Hi Tom,
tom_endyke@hmco.com wrote:
>
> Well, I have Perl5 up and running on my NT Server 4.0 w/service pack3. My
> problem is that although the following simple script (hello.pl)works fine:
>
> print "hello, World!\n";
>
> the next simple script (prog1_1.pl) does not:
>
> $inputline = <STDN>;
^^^^^^
You probably intended to write <STDIN> instead! That's it!
> print ( $inputline );
>
> I've played around with this quite a bit and still can't get it to go.
> Do I need a specific header line for NT server? I've associated the *.pl
> files with Perl and type them directly into the command prompt.
When you are testing Perl scripts, type "perl -w foo.pl". This will
generate some warnings. Another good idea is to include the line "use
strict;" at the beginning of your scripts. This will complain about
non-declared variables and much more.
--
Heiko Thiele
Application Developer - Berlin, Germany
mailto:h.thiele@sdc.de
phone:[+49] [177] 631 22 66
------------------------------
Date: Sun, 18 Jan 1998 17:38:08 +0100
From: Mario Tschursch <tschur@tsa.de>
Subject: Problems using Client-Server IPC
Message-Id: <34C22FF0.C7DAF0B2@tsa.de>
This is a multi-part message in MIME format.
--------------42BAB71368B77F4039D6DEBE
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
--------------42BAB71368B77F4039D6DEBE
Content-Type: message/rfc822
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-ID: <34BC6AC3.D6FF3E93@tsa.de>
Date: Wed, 14 Jan 1998 08:35:31 +0100
From: Mario Tschursch <tschur@tsa.de>
Organization: Teleport Sachsen-Anhalr
X-Mailer: Mozilla 4.03 [en] (X11; I; Linux 2.0.31 i586)
MIME-Version: 1.0
Newsgroups: comp.lang.perl
Subject: Problems using Client-Server IPC
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: zeus.tsa.de
Path: news.regiocom.net!zeus.tsa.de
Hi Folks.
I'm using SPONG (http://strobe.weeg.uiowa.edu/~edhill/public/spong/) a
(great!!) BB-Clone written in Perl
w/ some modifications and wondered about some errors while listning on
a bound socket.
Sometimes i get a "Network is unreachable"-Error when i do an
accept(CLIENT,SERVER)-call. Whats wrong with this ?
Source-Code:
---- SNIPP ----
# Set up the socket to listen to
my $proto = getprotobyname( 'tcp' );
my $p = pack( "l", 1 );
socket( SERVER, PF_INET, SOCK_STREAM, $proto ) || die "socket:
$!";
setsockopt( SERVER, SOL_SOCKET, SO_REUSEADDR, $p ) || die
"setsockopt: $!";
#setsockopt( SERVER, SOL_SOCKET, SO_DEBUG,1 ) || die
"setsockopt: $!";
bind( SERVER, sockaddr_in( $SPONGPORT, INADDR_ANY ) ) || die "bind: $!";
listen( SERVER, SOMAXCONN ) || die "listen:
$!";
....
sub wait_for_connection
{
my($ret) = 0;
&debug("Waiting for connection...");
while(!($ret = accept(CLIENT,SERVER)))
{
&debug("Error listning for new connections ! ($!) ".
"Try again...in 2 secs",1);
sleep 2;
}
return $ret;
}
...
---- SNAPP ----
---
+----------------------------------------------------------------+
| Mario Tschursch (tschur@tsa.de) \\ MUD: Bert@FinalFrontier |
| Teleport Sachsen-Anhalt GmbH \\ WWW: http://ff.mud.de/ |
| Steinfeldstr. 3 / Barleben 39179 \\ TELNET: ff.mud.de 7600 |
| Tel. 039203-82030 Fax. 039203-82031 \\EMAIL: mud@ff.mud.de |
+----------------------------------------------------------------+
--------------42BAB71368B77F4039D6DEBE--
------------------------------
Date: 18 Jan 1998 14:38:06 -0500
From: Myles Barrett Williams <a@b.c.d>
Subject: Re: Puzzling behavior of c.l.p.* readers
Message-Id: <lcg1mlpo81.fsf@duncan.cs.utk.edu>
erik@earthlink.net (Erik Y. Adams) writes:
> >* People who automatically think that something besides their code is
> >broken: "Subject: CGI.pm broken????!?!?"
>
> This problem is not at all unique to c.l.p.* groups. It happens all the
> time in many groups; it's just more common in programming groups. Lately
I'd even say that learning not to blame the compiler is one of the
first rites of passage for new programmers. Why does it seem
especially common for Perl? Maybe because Perl encourages laziness ;)
Myles Williams
------------------------------
Date: 18 Jan 1998 11:31:11 -0500
From: clay@panix.com (Clay Irving)
Subject: Re: Q: Regional Sort by ZIP code?
Message-Id: <69taof$4t@panix.com>
In <69odkr$n4r1@sunshine.atl.com> Fred Giorgi <fgiorg@atl.com> writes:
>I need to sort database records by region (group of states) or state. But
>the only guarenteed field I can use is ZIP code. Does anyone have a table
>that can be used to cross refrence zip to state? Are the first few digits
>a state code possibly? A perl module would be nice if one already exists.
This <almost> works -- I think there is an overlap in Puerto Rico. The first
three numbers of the zip code indentify the state.
state state_name from_zip to_zip
PR Puerto Rico 006 009
VA Virginia 220 246
MA Massachusetts 010 027
RI Rhode Island 028 029
NH New Hampshire 030 038
ME Maine 039 049
VT Vermont 050 059
CT Connecticut 060 069
AL Alabama 350 369
AK Alaska 995 999
AZ Arizona 850 865
AR Arkansas 716 729
CA California 900 966
CO Colorado 800 816
DE Delaware 197 199
DC District of Columbia 200 205
FL Florida 320 347
GA Georgia 300 319
HI Hawaii 967 968
ID Idaho 832 838
IL Illinois 600 629
IN Indiana 460 479
IA Iowa 500 528
KS Kansas 660 679
KY Kentucky 400 427
LA Louisiana 700 714
MD Maryland 206 219
MI Michigan 480 499
MN Minnesota 550 567
MS Mississippi 386 397
MO Missouri 630 658
MT Montana 590 599
NJ New Jersey 070 089
NV Nevada 889 898
NE Nebraska 680 693
NM New Mexico 870 884
NY New York 090 149
NC North Carolina 270 289
ND North Dakota 580 588
OH Ohio 430 458
OK Oklahoma 730 749
OR Oregon 970 979
PA Pennsylvania 150 196
SC South Carolina 290 299
SD South Dakota 570 577
TN Tennessee 370 385
TX Texas 750 799
UT Utah 840 847
WA Washington 980 994
WV West Virginia 247 268
WI Wisconsin 530 549
WY Wyoming 820 831
VI Virgin Islands 008 008
GU Guam 965 969
--
Clay Irving <clay@panix.com> I think, therefore I am. I think?
http://www.panix.com/~clay/
------------------------------
Date: 18 Jan 1998 19:40:18 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: What is wrong with this script?
Message-Id: <69tlr2$6h1$1@uranium.btinternet.com>
In article <34BF84DE.6A56C771@att.net.hk>, warchie@att.net.hk says...
>
>Can someone tell me what is wrong with this script? Or is there anyway
>where I can use perl.exe to go througth the coding line by line to see
>where the coding has gone wrong. PLEASE HELP!!!
>
<Code example cut>
Firstly I would recommend getting and using the CGI.pm module to do your
URL parsing. Then we would know that this part is working (;-}). Next yo
can use perl -d <scriptname> to debug your program. You should look at the
perldebug dicumentation for this.
Have fun
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.
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 1666
**************************************