[16336] in Perl-Users-Digest
Perl-Users Digest, Issue: 3748 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 19 14:07:08 2000
Date: Wed, 19 Jul 2000 11:05:17 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <964029917-v9-i3748@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 19 Jul 2000 Volume: 9 Number: 3748
Today's topics:
Re: AND in regexp?? (Andrew J. Perrin)
Re: AND in regexp?? nobull@mail.com
Re: AND in regexp?? (Craig Berry)
Re: AND in regexp?? (Abigail)
Re: Attatchments from client (Mark W. Schumann)
Re: Attatchments from client cpoole@muskegon.k12.mi.us
Bad file descriptor from Mail::Mailer <otis@my-deja.com>
Re: bless loses inheritance? up2l8@my-deja.com
Re: calling Java methods / classes (Malcolm Dew-Jones)
Email pattern parsing kiran.dronamraju@xpedior.com
Re: Email pattern parsing (Neil Kandalgaonkar)
Re: Email pattern parsing nobull@mail.com
Forking children <heinig@cs.ucdavis.edu>
Re: How do you pass objects to a subroutine? (Keith Calvert Ivey)
How to avoid metacharacters in pattern matching ? stephane_cohen@my-deja.com
Re: How to avoid metacharacters in pattern matching ? <aqumsieh@hyperchip.com>
Re: How to avoid metacharacters in pattern matching ? nobull@mail.com
Re: How to limit the size of an input field (Abigail)
Installation problem with Perl 5.6 in Cygwin RichardWoodward@hotmail.com
LWP and OpenSSL partially works. <andres@iconos.com.ve>
lwp/post question <billw@dal.asp.ti.com>
Re: Matching a block of data (Tad McClellan)
Re: Need Help with array (should be easy!) (Leo Schalkwyk)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 19 Jul 2000 11:58:03 -0400
From: aperrin@socrates.berkeley.edu (Andrew J. Perrin)
Subject: Re: AND in regexp??
Message-Id: <uu2dm2juc.fsf@socrates.berkeley.edu>
Ala Qumsieh <aqumsieh@hyperchip.com> writes:
> The simplest solution would be to use two regexps:
Seconded; however, if for some reason you must do it in one regexp,
you can use lookaheads to solve the ordering problem. You can look
for a thread called something like 'regex puzzler' from January of
this year for more information.
--
--------------------------------------------------------------
Andrew J. Perrin, Ph.D. Candidate, Sociology, UC Berkeley
Consulting: Solaris-Linux-NT-Samba-Perl-MS Access-Postgres
aperrin@socs.berkeley.edu - http://demog.berkeley.edu/~aperrin
--------------------------------------------------------------
------------------------------
Date: 19 Jul 2000 17:43:58 +0100
From: nobull@mail.com
Subject: Re: AND in regexp??
Message-Id: <u9vgy2m5o1.fsf@wcl-l.bham.ac.uk>
Ala Qumsieh <aqumsieh@hyperchip.com> writes:
> VW Corrado <vwcorrado@my-deja.com> writes:
> > This will get the results ONLY if the record contains "vase" and then
> > "white". Almost there, but not quite.
>
> The simplest solution would be to use two regexps:
>
> if (/vase/ and /white/) {
> # do stuff
> }
That is the best solution, but if you _must_ do it with one regexp
/vase.*white|white.*vase/
This doesn't extend well to more than two strings so also consider:
/^(?=.*white)(?=.*vase)/
Why is this question not in the FAQ yet?
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Wed, 19 Jul 2000 17:42:44 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: AND in regexp??
Message-Id: <snbq4kic6tt31@corp.supernews.com>
VW Corrado (vwcorrado@my-deja.com) wrote:
: I am trying to match on multiple keywords and am having trouble with the
: regexp to do so. Let's say the user typed in "vase white", I want to
: retrieve all records that contain both vase & white in any order.
The easiest way is simply to use multiple regexes and logical operators,
like:
if (/vase/ && /white/) {
If you insist on a single regex, lookahead is one way:
if (/(?=.*vase)(?=.*white)/) {
--
| Craig Berry - http://www.cinenet.net/users/cberry/home.html
--*-- "Turning and turning in the widening gyre
| The falcon cannot hear the falconer." - Yeats, "The Second Coming"
------------------------------
Date: 19 Jul 2000 13:50:50 EDT
From: abigail@delanet.com (Abigail)
Subject: Re: AND in regexp??
Message-Id: <slrn8nbrl0.3do.abigail@alexandra.delanet.com>
nobull@mail.com (nobull@mail.com) wrote on MMDXIV September MCMXCIII in
<URL:news:u9vgy2m5o1.fsf@wcl-l.bham.ac.uk>:
"" Ala Qumsieh <aqumsieh@hyperchip.com> writes:
""
"" > VW Corrado <vwcorrado@my-deja.com> writes:
""
"" > > This will get the results ONLY if the record contains "vase" and then
"" > > "white". Almost there, but not quite.
"" >
"" > The simplest solution would be to use two regexps:
"" >
"" > if (/vase/ and /white/) {
"" > # do stuff
"" > }
""
"" That is the best solution, but if you _must_ do it with one regexp
""
"" /vase.*white|white.*vase/
But that's not always the same. Suppose you want to match for "yell"
and "lower", in the string "He is yellower than she is".
/yell/ and /lower/
will succeed, but
/yell.*lower|lower.*yell/
will fail.
Abigail
--
map{${+chr}=chr}map{$_=>$_^ord$"}$=+$]..3*$=/2;
print "$J$u$s$t $a$n$o$t$h$e$r $P$e$r$l $H$a$c$k$e$r\n";
------------------------------
Date: 19 Jul 2000 11:21:56 -0400
From: catfood@apk.net (Mark W. Schumann)
Subject: Re: Attatchments from client
Message-Id: <8l4h2k$7nl@junior.apk.net>
This is not a sendmail question.
In article <8F3E6FFBF0447311.424CCC3C981BDAC2.576CF6E39931FC7E@lp.airnews.net>,
Cameron Laird <claird@starbase.neosoft.com> wrote:
>In article <39735087.6482C059@muskegon.k12.mi.us>,
> <cpoole@muskegon.k12.mi.us> wrote:
> .
> .
> .
>>I have installed Mail::Sender by JENDA and it works well for
>>attatchments that reside on the server; however, what if I want to send
>>an attatchment from my client workstation? Does anyone know of the
>>command I would use to to send a attatchment from my client workstation
>>(i.e. like a MS word file from my PC) or is there another module out
>>there which would be better for me to use.
> .
> .
> .
>Perl modules happily do their work whether they're
>on a server or client. My guess is that you have a
>specific model of operation that I don't yet under-
>stand.
>
>Are you working with Web pages, and you want the
>ability to specify a way for the browser to generate
>an item of e-mail, accompanied by an attachment that
>the human client selects? Is that it? You're surely
>not committing the rather hostile act of attaching
>a file *you* choose from the server; that's generally
>regarded as some combination of privacy and security
>risk.
It sounds as though he's trying to let the human client pick a file
from the client-side filesystem and let the CGI process send that
file in email.
As you suggest, that's not necessarily a good idea, but if it is to
be done it will at least require some kind of transfer from the client
to the web server, which opens up a whole new can of worms.
>If the human client is making the selection, my incli-
>nation is to recommend that you do something that
>involves the desktop's own e-mail client. If there's
>a compelling reason that's not feasible, we can come
>up with a scheme to upload the attachment and mangle
>it on the server; that's what would be necessary.
Agreed.
------------------------------
Date: Wed, 19 Jul 2000 13:25:11 -0400
From: cpoole@muskegon.k12.mi.us
To: Cameron Laird <claird@starbase.neosoft.com>
Subject: Re: Attatchments from client
Message-Id: <3975E477.3EC5D2C2@muskegon.k12.mi.us>
I have a cgi form on our UNIX server I'm using to request particular
information. Along with this information the user who accesses this form
will be required to attatch a file from their PC, most likely a MS Word
document. The CGI form is on our UNIX server and the file that needs to be
attatched is on any users personal computer. The form will be access from
the users PC via Netscape Navigator.
My question is what code do I put in the PERL script, which resides on the
server, such that it will include a attatchment, where the file that needs
to be include resides on the users personal computer?
Thank you again for all you help.
Charles Poole
Internet System Manager
Muskegon Public Schools
Cameron Laird wrote:
> In article <39735087.6482C059@muskegon.k12.mi.us>,
> <cpoole@muskegon.k12.mi.us> wrote:
> .
> .
> .
> >I have installed Mail::Sender by JENDA and it works well for
> >attatchments that reside on the server; however, what if I want to send
> >an attatchment from my client workstation? Does anyone know of the
> >command I would use to to send a attatchment from my client workstation
> >(i.e. like a MS word file from my PC) or is there another module out
> >there which would be better for me to use.
> .
> .
> .
> Perl modules happily do their work whether they're
> on a server or client. My guess is that you have a
> specific model of operation that I don't yet under-
> stand.
>
> Are you working with Web pages, and you want the
> ability to specify a way for the browser to generate
> an item of e-mail, accompanied by an attachment that
> the human client selects? Is that it? You're surely
> not committing the rather hostile act of attaching
> a file *you* choose from the server; that's generally
> regarded as some combination of privacy and security
> risk.
>
> If the human client is making the selection, my incli-
> nation is to recommend that you do something that
> involves the desktop's own e-mail client. If there's
> a compelling reason that's not feasible, we can come
> up with a scheme to upload the attachment and mangle
> it on the server; that's what would be necessary.
> --
>
> Cameron Laird <claird@NeoSoft.com>
> Business: http://www.Phaseit.net
> Personal: http://starbase.neosoft.com/~claird/home.html
------------------------------
Date: Wed, 19 Jul 2000 15:26:35 GMT
From: Otis Gospodnetic <otis@my-deja.com>
Subject: Bad file descriptor from Mail::Mailer
Message-Id: <8l4haj$ps4$1@nnrp1.deja.com>
Hi,
I am using Graham Barr's Mail::Mailer module (part of MailTools) and
every once in a while the script that uses Mail::Send (which uses
Mail::Mailer underneath) dies with the following error:
Bad file descriptor at /usr/lib/perl5/site_perl/5.005/Mail/Mailer.pm
line 269.
Here is line 268:
268 # Fork and start a mailer
269 (defined($exe) && open($self,"|-"))
270 || $self->exec($exe, $args, \@to)
271 || die $!;
I am using Mail::Send to send mail via SMTP directly (not 'mail'
nor 'sendmail'), like so:
my $fh = $msg->open('smtp', Server => 'smtp.server.here');
There is no consistency: sometimes it works without any problems, and
sometimes it dies like this.
I am running this on Red Hat 6.2 with perl version 5.005_03.
Does anyone know what could be causing this?
Thank you,
Otis
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 19 Jul 2000 16:12:10 GMT
From: up2l8@my-deja.com
Subject: Re: bless loses inheritance?
Message-Id: <8l4k06$s99$1@nnrp1.deja.com>
In article <8l1ku0$hbd$1@lublin.zrz.tu-berlin.de>,
anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote:
> <up2l8@my-deja.com> wrote in comp.lang.perl.misc:
> >Hello,
> >
> >I am trying to reconsecrate an object into
> >a new class (I'm trying to make a copy constructor...)
> >but it seems that when I re-bless the object it loses
> >all of the inheritance information.
>
> An object doesn't have inheritance information, its class does. So
> re-blessing an object is *expected* to change inheritance, unless
> the old and new class inherit exactly the same.
Ok, then I mean that when I try to invoke a method that
requires a run up the inheritance tree on an object that
I just reblessed I get a "Can't find definition for METHOD"
(for whatever $o->METHOD I just called).
>
> > I found that when
> >I call a simple function like so:
> >
> >sub ima {
> > return(@ISA);
> >}
>
> The @ISA this sub refers to is determined at the time ima is compiled.
> Whichever package is default at the moment defines which @ISA will
> be returned at run time.
Sorry, I think this just confused the issue. The same
behavior can be exhibited with any subroutine. I modified
it to sub ima{}. What I found is that as long as some sub
defined in the explicit package that the object is an instance
of is called. In otherwords:
say that there is a $o such that ref($o) = "X";
and there exists an A::methoda
and there is also a B::methodb
and A isa B.
then
bless $o, "A"; #rebless "X" inst. to "A"
$o->methodb; #this fails in my code.
#BUT:
$o->methoda;
$o->methodb; #This will now work.
(package X in this case is irrelavent).
> >The inheritance info seems to be read correctly.
> >
> >ex.
> >
> > bless $o, $to_class;
> > print "PASS\n" if ($o->isa("Netlist::Element"));
> > print "IMA- ".join("\n\t", $o->ima)."\n";
> > print "PASS, but weird!\n" if ($o->isa("Netlist::Element"));
> >
> >Oddly enough this always prints the weird string, even though
> >I really didn't DO anything!
>
> Why is this weird? The if-condition is the same in the first and the
> last print(), so they either both print, or both don't.
>
> >Does anyone have any ideas on this???
>
> Not really, except I get the feeling you are expecting a behavior that
> isn't to be expected.
The behavior that I would expect is that both print statments
would execute (as you mentioned). But I guess I didn't make it
clear that ONLY the "wierd" message prints out.
What this tells me is that the @ISA needs to be refreshed or
something- somehow it was killed or mangled in the re-bless.
Unfortunately I can't seem to reproduce this error in
an simple example. The inheritance seems to work just
fine in an isolated test script, but in my full blown
class it doesn't. Instead of beating my head against this
(dare I say "bug"?- nah, more likely pilot error...) I
will just live with my workaround- calling a blank sub
that is defined in EVERY class... cheesy, but I'm desperate.
If anyone does know of a know limitation and accompanying
workaround, please let me know.
Thanks,
Eric
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 19 Jul 2000 09:32:19 -0800
From: yf110@victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: calling Java methods / classes
Message-Id: <3975d813@news.victoria.tc.ca>
S P Arif Sahari Wibowo (arifsaha@yahoo.com) wrote:
: Hi!
: Java.pm is nowhere in CPAN. Where is it? Did it work at all?
: Any suggestion?
>From Altavista search "Java.pm"
http://nomad.honk.org/~volksman/perl/ch19.htm
"I am currently still developing the package Java.pm. It's named Cocoa.pm
in development because it does not have the high caffeine content of a
full-featured, or even mildly useful, Java.pm package. Perhaps after
reading today's lesson you will be able to contribute to the Java.pm Perl
package; if so, send e-mail to khusain@ikra.com. "
------------------------------
Date: Wed, 19 Jul 2000 15:15:30 GMT
From: kiran.dronamraju@xpedior.com
Subject: Email pattern parsing
Message-Id: <8l4gm0$pbh$1@nnrp1.deja.com>
I am working on cleaning a file for valid email IDs.
The file is delimited by the pipe "|" character.
First column is an EmailID.
The following script is working for most cases with some exceptions
Please help with the pattern matching.
Thanks
Code:
($c1,$c2,$c3,$c4,$c5) = split(/\|/);
$c1 =~ s/\s+$//;
if ( ($c1 =~ /^(\S+)(\w+)@(\S+\w+).(\S+\w+)$/) { print;}
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 19 Jul 2000 15:44:28 GMT
From: neil@brevity.org (Neil Kandalgaonkar)
Subject: Re: Email pattern parsing
Message-Id: <8l4hvt$2pt$1@localhost.localdomain>
In article <8l4gm0$pbh$1@nnrp1.deja.com>,
<kiran.dronamraju@xpedior.com> wrote:
>I am working on cleaning a file for valid email IDs.
See perldoc perlfaq9 and numerous recent threads in comp.lang.perl.misc
for why you can't do this with a regex. You can get pretty close, and
there are non-regex based modules to do this as well.
>First column is an EmailID.
>The following script is working for most cases with some exceptions
Like...?
>Code:
>
>$c1 =~ s/\s+$//;
>if ( ($c1 =~ /^(\S+)(\w+)@(\S+\w+).(\S+\w+)$/) { print;}
You don't understand regexes yet. No need for those parens that I can see,
\S+\w+ is not what you want and is very inefficient; and '.' is a regex
metacharacter meaning 'any character'.
I suggest you check out the faq listed above, and also:
http://keck.ucsf.edu/~kvale/perlrequick.pod
http://keck.ucsf.edu/~kvale/perlretut.pod
A recommended book on re's is Mastering Regular Expressions, by J. Friedl,
O'Reilly & Associates.
--
Neil Kandalgaonkar <neil@brevity.org>
------------------------------
Date: 19 Jul 2000 17:39:52 +0100
From: nobull@mail.com
Subject: Re: Email pattern parsing
Message-Id: <u9zonem5uv.fsf@wcl-l.bham.ac.uk>
kiran.dronamraju@xpedior.com writes:
> The following script is working for most cases with some exceptions
This is not true. It won't even compile.
> Please help with the pattern matching.
See FAQ: "How do I check a valid mail address?"
It really is unspeakably lazy not to check the FAQ _before_ you post.
It is also particularly anti-social to post a frequently asked
question that always leads to long threads of dis-information. As
well as checking the FAQ you should use a Usenet seach engine to see
how your question has been answered in the past.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: 19 Jul 2000 17:49:31 GMT
From: Lael Matthew Heinig <heinig@cs.ucdavis.edu>
Subject: Forking children
Message-Id: <8l4pnb$228$1@mark.ucdavis.edu>
I'm trying to fork off about 100 children. About 50% of the time my
program does not finish. All my children turn into zombie processes. I'm
trying to trap the $SIG{CHLD} signal. It seems that when I do this, my
program will not finish. Is there something that I am missing? Any ideas?
Does it matter what my function (process_mail_big) does? My first version
of the finish function is the commented code. It didn't seem to work, so
I tried using the $wait variable.
Thanks,
Lael Heinig
<snip>
local $SIG{CHLD} = \&finish ;
$wait = 0 ;
for ( $i = 0 ; $i < $startingSmall ; $i++ )
{
sleep ( 0.2 ) ;
# Here we spawn all of our threads - where $i represents what thread
# we are working on
if ( $pid = fork )
{
# Parent
print "Parent $$ forked $pid <$i>\n" ;
$wait++ ;
push ( @pids, $pid ) ;
}
elsif ( defined ( $pid ) )
{
# Child
$gMail->process_mail_big ( $i, \@fields_desc ) ;
exit ;
}
else
{
print "Couldn't fork, $i\n" ;
}
}
}
sub finish
{
my $k ;
print "finish child\n" ;
$wait-- ;
# while ( ( $k = waitpid ( -1, &WNOHANG ) ) > 0 )
# {
# warn "K found: $k\n" ;
# }
$SIG{CHLD} = \&finish ;
print "done finish child\n" ;
}
------------------------------
Date: Wed, 19 Jul 2000 14:11:27 GMT
From: kcivey@cpcug.org (Keith Calvert Ivey)
Subject: Re: How do you pass objects to a subroutine?
Message-Id: <3976b3c7.42149663@news.newsguy.com>
Frederic <j_f9NOj_SPAM@yahoo.com.invalid> wrote:
>One more thing. How do I pass other parameters as well? I need
>to pass a few scalars to the subroutine along with the object,
>like this:
>
> process($obj, $var1, $var2);
If this is an object method, the usual way to write it would be
$obj->process($var1, $var2);
assuming the subroutine is in the class package. Regardless,
the way you get the arguments in the subroutine is the same.
>I've tried to set them up in various ways in the subroutine, but
>can't figure out the right way to do it:
>
>sub process {
> my(($obj = shift), $var1, $var2) = @_;
>or: my($obj, $var1, $var2) = shift;
>or: my ($obj, $var1, $var2) = @_;
> $obj = shift;
>
>None of these work correctly.
You need to read the documentation for shift(). You seem to be
confused about what it does. The first attempt above tries to
get four values out of @_, which should contain only three, but
it doesn't even do that because it doesn't compile (you can't
put an assignment inside a my() like that). The second only
gets one value out, so $var1 and $var2 are left undefined.
The third solution should work, although the second line is
silly and unnecessary:
my ($obj, $var1, $var2) = @_;
will work by itself. The next line ($obj = shift;) sets $obj
equal to $_[0] again, which is pointless since it already has
that value. You don't explain why you think it doesn't work
correctly ("doesn't work" is too vague a description to be
useful), so I can't help any further.
--
Keith C. Ivey <kcivey@cpcug.org>
Washington, DC
(Free at last from the forced spamsig of
Newsfeeds.com, cursed be their name)
------------------------------
Date: Wed, 19 Jul 2000 15:54:57 GMT
From: stephane_cohen@my-deja.com
Subject: How to avoid metacharacters in pattern matching ?
Message-Id: <8l4j06$ran$1@nnrp1.deja.com>
Dear all,
I have a simple problem that irritates me since a while.
I want to search for a string, that can contain metacharacters (such as
'(', '|' ); but I do not want those metacharacters to be interpreted.
I want them to match literally.
The difficulty is that the searched-string is a variable, setup earlier
in my code.
Example :
$search = foo();
if (/$search/) {
print "match \n";
}
Surely, I could backquote every potential metacharacter in $search, but
I wonder if a smarter solution exists.
Thanks for your help.
Stephane.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 19 Jul 2000 16:12:04 GMT
From: Ala Qumsieh <aqumsieh@hyperchip.com>
Subject: Re: How to avoid metacharacters in pattern matching ?
Message-Id: <7apuoahzft.fsf@merlin.hyperchip.com>
stephane_cohen@my-deja.com writes:
> I want to search for a string, that can contain metacharacters (such as
> '(', '|' ); but I do not want those metacharacters to be interpreted.
> I want them to match literally.
> The difficulty is that the searched-string is a variable, setup earlier
> in my code.
>
> Example :
> $search = foo();
> if (/$search/) {
> print "match \n";
> }
>
> Surely, I could backquote every potential metacharacter in $search, but
> I wonder if a smarter solution exists.
Of course, but did you try to search the docs and faqs for a solution?
Anyway, what you want is a good read of perlre. Then look at \Q and the
quotemeta() functions. Then you can understand why this works:
if (/\Q$search/) {
print "match\n";
}
--Ala
------------------------------
Date: 19 Jul 2000 17:38:58 +0100
From: nobull@mail.com
Subject: Re: How to avoid metacharacters in pattern matching ?
Message-Id: <u91z0qnkgt.fsf@wcl-l.bham.ac.uk>
stephane_cohen@my-deja.com writes:
> I want to search for a string, that can contain metacharacters (such as
> '(', '|' ); but I do not want those metacharacters to be interpreted.
> I want them to match literally.
> The difficulty is that the searched-string is a variable, setup earlier
> in my code.
> if (/$search/) {
if (/\Q$search/) {
> Surely, I could backquote every potential metacharacter in $search,
That's exactly what \Q (aka quotemeta()) does.
> I wonder if a smarter solution exists.
if ( index($_,$search) >= 0 ) {
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: 19 Jul 2000 13:32:15 EDT
From: abigail@delanet.com (Abigail)
Subject: Re: How to limit the size of an input field
Message-Id: <slrn8nbqi6.3do.abigail@alexandra.delanet.com>
Harry (harris@rock.upnaway.com) wrote on MMDXIV September MCMXCIII in
<URL:news:39759a74@usenet.per.paradox.net.au>:
-: in a post form is there a way to get a script to give an error msg if the
-: entry is to long
Yes.
perldoc -f print
Abigail
--
$_ = "\112\165\163\1648\141\156\157\164\150\145\1628\120\145"
. "\162\1548\110\141\143\153\145\162\0128\177" and &japh;
sub japh {print "@_" and return if pop; split /\d/ and &japh}
------------------------------
Date: Wed, 19 Jul 2000 17:18:24 GMT
From: RichardWoodward@hotmail.com
Subject: Installation problem with Perl 5.6 in Cygwin
Message-Id: <8l4ns9$vfn$1@nnrp1.deja.com>
This is a medium long post, but I didn't know what to snip without
risking loss of important information. I sent this originally
to perlbug@perl.com but haven't received any answers (two days).
I thought I'd try out compl.lang.perl.misc. Hope someone can help.
---------------------------------------------------------
Hi. I'm trying to "configure" and "make" Perl 5.6.0 which I downloaded
in source form from CPAN. The Cygwin system was just recently
installed and is also (I believe) the latest version.
I configured my Perl very conservatively, using recommended default
answers. The output file "myconfig" is shown below. When I ran
"make" I got messages about some "export definition" file problem
and some failure message about a reallocation problem. I have a
fairly short make log which I generated and have also shown below.
This is my first attempt at compiling Perl from source. Up until now
I have been using binaries from Activestate.com. But there have
been times when I want to build a Perl with the very latest and
greatest module WHATEVER.pm or OLDTHING.pm built in, so
I bit the bullet and got into another fine mess.
Hopefully, I have done something which has happened to others
before me and there is a simple "next step" for me to take.
The interesting messages appear to be in about the last dozen
lines of this message.
Please help if you can. I've been doing software since 1959 and
this is going to be one of those "sticking places" where I won't
go anywhere else until I can solve this one (I hope).
Files are below my signature.
Thanks in advance.
Richard Martin Woodward
RichardWoodward@hotmail.com
OK, Here is the the file "myconfig":
================myconfig starts here==============
#!/bin/sh
# This script is designed to provide a handy summary of the
# configuration information being used to build perl. This is
# especially useful if you are requesting help from
# comp.lang.perl.misc on usenet or via mail.
# Note that the text lines /^Summary of/ .. /^\s*$/ are copied into
# Config.pm.
cat <<'!NO!SUBS!'
Summary of my perl5 (revision 5.0 version 6 subversion 0) configuration:
Platform:
osname=cygwin, osvers=1.1.2(0.2132), archname=cygwin
uname='cygwin_98-4.10 mercy 1.1.2(0.2132) 2000-06-06 22:20 i586
unknown
'
config_args=''
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef
usemultiplicity=undef
useperlio=undef d_sfio=undef uselargefiles=define
use64bitint=undef use64bitall=undef uselongdouble=undef
usesocks=undef
Compiler:
cc='gcc', optimize='-O', gccversion=2.95.2 19991024 (release-2)
cppflags='-fno-strict-aliasing -I/usr/local/include'
ccflags ='-fno-strict-aliasing -I/usr/local/include'
stdchar='char', d_stdstdio=undef, usevfork=false
intsize=4, longsize=4, ptrsize=4, doublesize=8
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t',
lseeksize=4
alignbytes=8, usemymalloc=y, prototype=define
Linker and Libraries:
ld='ld2', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /usr/lib /lib
libs=-lm -lcrypt -lcygwin -lkernel32
libc=/usr/lib/libc.a, so=dll, useshrplib=true,
libperl=libperl5_6_0.a
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
cccdlflags=' ', lddlflags=' -L/usr/local/lib'
!NO!SUBS!
================myconfig ends here==============
And here is the file "make.log":
================make.log starts here==============
GNUmakefile:248: warning: overriding commands for target `perlmain.o'
GNUmakefile:190: warning: ignoring old commands for target `perlmain.o'
GNUmakefile:274: warning: overriding commands for target `opmini.o'
GNUmakefile:177: warning: ignoring old commands for target `opmini.o'
AutoSplitting perl library
PATH=/cygdrive/c/perl_source/perl-
5.6.0:.:/usr/bin:/usr/bin:/usr/local/bin:/
cygdrive/c/WINDOWS:/cygdrive/c/windows:/cygdrive/c/windows/COMMAND:/usr/
bin:
/cygdrive/c/PERL/BIN:/cygdrive/c/MY_BIN:.:/usr/bin:/usr/local:/etc:/usr/
lib:
/usr/lib:/usr/sbin:/usr/libexec ./miniperl -Ilib -e 'use AutoSplit; \
autosplit_lib_modules(@ARGV)' lib/*.pm lib/*/*.pm
PATH=/cygdrive/c/perl_source/perl-
5.6.0:.:/usr/bin:/usr/bin:/usr/local/bin:/
cygdrive/c/WINDOWS:/cygdrive/c/windows:/cygdrive/c/windows/COMMAND:/usr/
bin:
/cygdrive/c/PERL/BIN:/cygdrive/c/MY_BIN:.:/usr/bin:/usr/local:/etc:/usr/
lib:
/usr/lib:/usr/sbin:/usr/libexec ld2 -L/usr/local/lib -o
libperl5_6_0.dll \
perl.o malloc.o gv.o toke.o perly.o op.o regcomp.o dump.o util.o mg.o
hv.o
av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o doop.o doio.o
regexec.o utf8.o taint.o deb.o universal.o xsutils.o globals.o perlio.o
perlapi.o cygwin.o -lm -lcrypt -lcygwin -lkernel32
dllwrap --dllname libperl5_6_0.dll --driver-name gcc --dlltool
dlltool --export-all-symbols --as as --output-def
libperl5_6_0.def --output-lib libperl5_6_0.a \
-L/usr/local/lib perl.o malloc.o gv.o toke.o perly.o op.o regcomp.o
dump.o
util.o mg.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o
doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o xsutils.o
globals.o
perlio.o perlapi.o cygwin.o -lm -lcrypt -lcygwin -lkernel32
dllwrap: no export definition file provided
dllwrap: creating one, but that may not be what you want
Cannot reallocate 1652555776 bytes after allocating 68577308 bytes
perlld: *** system() failed to execute
dllwrap --dllname libperl5_6_0.dll --driver-name gcc --dlltool
dlltool --export-all-symbols --as as --output-def
libperl5_6_0.def --output-lib libperl5_6_0.a \
-L/usr/local/lib perl.o malloc.o gv.o toke.o perly.o op.o regcomp.o
dump.o
util.o mg.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o
doop.o doio.o regexec.o utf8.o taint.o deb.o universal.o xsutils.o
globals.o
perlio.o perlapi.o cygwin.o -lm -lcrypt -lcygwin -lkernel32
make: *** [libperl5_6_0.a] Error 1
================make.log ends here===============
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 19 Jul 2000 17:15:23 GMT
From: Andres Maduro <andres@iconos.com.ve>
Subject: LWP and OpenSSL partially works.
Message-Id: <8l4nmm$vdk$1@nnrp1.deja.com>
Hello,
I have configured openssl, NetSSLeay, LWP, etc, under RedHat 6.1 and
apparently it is working fine since webmin which uses SSL for the
webserver (OpenSSL, NetSSLeay)works fine.
I have been able to download successfully html pages via perl/https
script from various sites without problems. The problems comes when I
try to download a page from the site of my commerce provider
https://www.vencash.com/index.html. From IE and Netscape it works!!
Vencash.com is using according to Netcraft:
-----------------------------------------------------
IBM_HTTP_Server/1.3.6.1 Apache/1.3.7-dev (Win32)
Supported SSL ciphers:
Triple DES with MD5
-----------------------------------------------------
One strange thing is that when I installed the NetSSLeay perl module
all the tests where successfull except the www.cdw.org with this error:
----------------- NetSSLeay test error during install ---------------
ok 11 www.cdw.com (Microsoft-IIS/5.0)
SSL_write 26089: 1 - error:140790E5:SSL routines:SSL23_WRITE:ssl
handshake failure
------------------ End of message -----------------------------------
The following 2 perl scripts have been used for downloading successfully
html pages via https from various sites like www.helsinki.fi,
www.bacus.pt, etc. but not from https://www.vencash.com/index.html
When I connect to https://www.vencash.com/index.html this is what
happens:
--------- Error message when accessing securely www.vencash.com -----
Error with script 1:
Failed: 500 Bad arg length for Socket::unpack_sockaddr_in, length is 0,
should be 16
Error with script 2:
Result was `HTTP/1.0 900 NET OR SSL ERROR
SSL_connect 30270: 1 - error:1408F071:SSL routines:SSL3_GET_RECORD:bad
mac decode
------------------- Script 1 --------------------------------
#!/usr/bin/perl
use LWP::UserAgent;
my $ua = LWP::UserAgent->new;
#my $req = HTTP::Request->new(GET => 'https://www.helsinki.fi/'); my
$res = $ua->request($req);
my $req = HTTP::Request->new(GET
=> 'https://www.vencash.com/index.html'); my $res = $ua->request
($req);
if ($res->is_success) {
print $res->as_string;
} else {
print "Failed: ", $res->status_line, "\n"; }
------------------- End of Script 1 --------------------------------
------------------- Script 2 --------------------------------
#!/usr/bin/perl
use Net::SSLeay;
($site, $port, $path) = @ARGV;
die "Usage: ./get_page.pl www.cryptsoft.com 443 /\n" unless $path;
($page, $result, %headers) = &Net::SSLeay::get_https($site, $port,
$path);
print "Result was `$result'\n";
foreach $h (sort keys %headers) {
print "Header `$h'\tvalue `$headers{$h}'\n";
}
print "=================== Page follows =================\n";
print $page;
exit;
------------------- End of Script 2 --------------------------------
Any help is appreciated!!!
Thanks in advance,
Andres Maduro
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 19 Jul 2000 12:27:39 -0500
From: Bill Webster <billw@dal.asp.ti.com>
Subject: lwp/post question
Message-Id: <3975E50B.EA38374F@dal.asp.ti.com>
Hello,
I'm having trouble with a script a got from lwpcook to
send post requests and capture the answers. I know the
script works because I've used it on a simple post form
on the web, and it worked fine.
My problem is that I'm trying to use it on a more
complex form which uses the post method and I can't
get it to work. I know something must be wrong with
my name/value pairs.
I'm using redhat linux, and notice that when I type
in http://localhost on my browser, it says "congratulations
for having Apache installed in your Red Hat machine "
I guess that means that my machine can act just like
an apache server.
So my question is, can I download the website
to my computer - load it somehow into "http:/localhost"
fill out the form, then do a send - so I can somehow observe
how the request information creates its name/value pairs?
Is this something that is possible, and if so - can someone
give me a quick blurb on how to go about it?
Ultimately, if I can see how the name/value pairs are sent
to the cgi post program, then I can easily fix the program
I got from lwpcook by typing in the appropriate name/value
pairs...
Thanks, Bill (billw@dal.asp.ti.com)
.
------------------------------
Date: Wed, 19 Jul 2000 10:27:02 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Matching a block of data
Message-Id: <slrn8nbi66.ug.tadmc@maxim.metronet.com>
On Wed, 19 Jul 2000 10:02:13 -0400, Alex T. <samara_biz@hotmail.com> wrote:
>I need to match the following block of data (inside the delimiters).
>I need $1 to hold what's in name field, $2 - filename, and $3 - some
>data.
>
>-------------------------------------------------
>Content-Disposition: form-data; name="my_file";
>filename="C:\WINNT\Profiles\ecpjm\Desktop\delete_this.txt"
>Content-Type: text/plain
>
>Some data
>--------------------------------------------------
if ( /name="([^"]*)".*filename="([^"]*)".*?\n\n(.*)/s ) {
my($name, $filename, $data) = ($1, $2, $3);
print "name '$name'\nfname '$filename'\n'$data'\n------------\n";
}
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 19 Jul 2000 15:28:53 GMT
From: L.Schalkwyk@z138-234.iop.kcl.ac.uk (Leo Schalkwyk)
Subject: Re: Need Help with array (should be easy!)
Message-Id: <slrn8nbieb.3vua74r.L.Schalkwyk@leoschalkwyk.iop.kcl.ac.uk>
On 12 Jul 2000 19:20:24 EDT, Abigail <abigail@delanet.com> wrote:
>Still two processes too many.
>
> awk '!foo [$1] {foo [$1] = 1; count ++} END {print count}' *.log
>
still too much typing.
awk '!f[$1]++{c++}END{print c}' *.log
Leo
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 3748
**************************************