[15825] in Perl-Users-Digest
Perl-Users Digest, Issue: 3238 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 2 18:06:38 2000
Date: Fri, 2 Jun 2000 15:05:14 -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: <959983514-v9-i3238@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 2 Jun 2000 Volume: 9 Number: 3238
Today's topics:
Re: C to perl? (David H. Adler)
Re: C to perl? (Alan Barclay)
Re: C to perl? <tony_curtis32@yahoo.com>
Re: Case-Insensitive String Comparison (Tad McClellan)
Re: CGI.pm param function troubles <derek@ccil.org>
Re: CGI.pm param function troubles <care227@attglobal.net>
Re: Cookies stopped working w/Perl 5.6 <ewinslow@his.com>
Re: DBI.pm CGI.pm tutorial needed <makarand_kulkarni@My-Deja.com>
Re: Email this story to a friend - html to text rk27@my-deja.com
END{} alternative? <shah@typhoon.xnet.com>
Re: Get the time, plus one hour (was: code cleanup) (Bart Lateur)
Re: LWP POST and send cookies <dparrott@ford.com>
making the source unreadable <b.kappenburg@rcondw.rug.nl>
Re: making the source unreadable <lauren_smith13@hotmail.com>
Re: making the source unreadable (Jerome O'Neil)
Re: making the source unreadable <dwhaskin@earthlink.net>
MI in Perl (was Re: Perl vs Python for Numerical Analys (Abigail)
mod_perl mr_lowell@my-deja.com
Re: my Foo $self = shift; (Ala Qumsieh)
Re: my Foo $self = shift; (Damian Conway)
Re: Non-reuse of memory for lexically-scoped variables? (Ilya Zakharevich)
Re: NT & Sockets <tfm@sei.cmu.edu>
Re: NT & Sockets <red_orc@my-deja.com>
Re: NT & Sockets <lr@hpl.hp.com>
Re: oops Re: seeking method to encode email addresses i <nospam@devnull.com>
pattern matching??? <Kumanan@uni.de>
Re: pattern matching??? <lauren_smith13@hotmail.com>
Re: pattern matching??? <lr@hpl.hp.com>
Re: pattern matching??? <dwhaskin@earthlink.net>
Re: pattern matching??? <hmerrill@my-deja.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 2 Jun 2000 19:27:56 GMT
From: dha@panix.com (David H. Adler)
Subject: Re: C to perl?
Message-Id: <slrn8jg2ls.99s.dha@panix6.panix.com>
On 1 Jun 2000 22:03:35 GMT, Abigail <abigail@arena-i.com> wrote:
>On Thu, 01 Jun 2000 17:19:12 -0400, brian d foy
<brian@smithrenaud.com> wrote:
>++ In article <8h6gir$qhv$1@news.panix.com>, abigail@arena-i.com
posted:
>++ > On Thu, 01 Jun 2000 16:13:20 -0400, brian d foy
<brian@smithrenaud.com> wrote:
>++ > ++ In article <39369278$1@news.microsoft.com>, "Jürgen Exner"
<juex@deja.com> posted:
>++ > ++ > That is what you usually use as a metric to compare two programs: The same
>++ > ++ > input generates the same output.
>++ > ++
>++ > ++ what about programs that take no input and give no output? do you contend
>++ > ++ that they are all equivalent? that seems like a limited view of
>++ > ++ computing.
>++ >
>++ > Eh, yes, I certainly would say they are equivalent.
>++ >
>++ > If they were different, then how exactly would you notice the difference?
>++
>++ does that then mean that the only way anything is changed by output?
>
>How would you know something is changed if there's no output?
>
>++ what then qualifies as output?
>
>What qualifies as "changed"?
Are you guys trying to lay the groundwork for an RFC for
comp.lang.perl.epistemology here?
:-)
dha
--
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
Chipmunks are go! - Madness
------------------------------
Date: Fri, 02 Jun 2000 20:27:05 GMT
From: gorilla@elaine.furryape.com (Alan Barclay)
Subject: Re: C to perl?
Message-Id: <959978241.488051@elaine.drink.com>
In article <3936e097$1@news.microsoft.com>, Jürgen Exner <juex@deja.com> wrote:
>"brian d foy" <brian@smithrenaud.com> wrote in message
>news:brian-ya02408000R0106001719120001@news.panix.com...
>> does that then mean that the only way anything is changed by output?
>> what then qualifies as output?
>
>Pretty simple: Any action of the program, which is observable by a user is
>output(usually not including resource consumption unless you are talking
>about real-time programming).
>
>This might be some printout on the screen, changing the appearance of a
>button in a dialog (from raised to pressed), or just establishing a
>connection to some server on the other side of the planet.
Does sleep produce output?
If I'm running a shellscript, and watching it, I'd notice the difference
between
echo "here"
sleep 10
echo "there"
and the same program, but with sleep 100. On the other hand, if I ran
a the program from cron every night, I'd not notice any difference, as
the email'd results would look identical.
This seems to imply that sleep either produces output or not depending on
if anyone is watching it.
------------------------------
Date: 02 Jun 2000 15:51:49 -0500
From: Tony Curtis <tony_curtis32@yahoo.com>
Subject: Re: C to perl?
Message-Id: <87zop3u7q2.fsf@limey.hpcc.uh.edu>
>> On Fri, 02 Jun 2000 20:27:05 GMT,
>> gorilla@elaine.furryape.com (Alan Barclay) said:
> Does sleep produce output?
> If I'm running a shellscript, and watching it, I'd
> notice the difference between
> echo "here" sleep 10 echo "there"
> and the same program, but with sleep 100. On the other
> hand, if I ran a the program from cron every night, I'd
> not notice any difference, as the email'd results would
> look identical.
> This seems to imply that sleep either produces output or
> not depending on if anyone is watching it.
"Output" is probably best defined as as causing a
state-change. "sleep" doesn't. The resultant
state-change in the system from
echo a
sleep 10
echo b
and
echo a
echo b
is the same.
2 programs which start from the same initial state and
cause the same state-change in the underlying
state-machine (a computer being a finite state machine
(FSM)) can be considered functionally identical.
Of course, sometimes there are real-time considerations
where you'd have hard temporal constraints on top of "same
output" requirements, so sleep would then be significant
but only in the temporal logic.
Where semantics are concerned, a nice gentle introduction
(and favourite of mine) is:
L. Allison.
A Practical Introduction to Denotational Semantics.
Cambridge University Press
http://www.cup.org/
This seems to be drifting ever further away from perl
matters...
my $2p;
--
"Trying is the first step towards failure"
Homer Simpson
------------------------------
Date: Fri, 2 Jun 2000 11:02:40 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Case-Insensitive String Comparison
Message-Id: <slrn8jfml0.qb.tadmc@maxim.metronet.com>
On Fri, 2 Jun 2000 03:49:02 +0200, Herr Stumpfenstiel
<herr_stumpfenstiel@lycosmail.com> wrote:
>"Courtney Tompos" <cdt9@cornell.edu> schrieb im Newsbeitrag
>news:8h6ufm$o2p$1@news01.cit.cornell.edu...
>> Warning: Newbie =)
>>
>> That said, I want to compare two strings to check whether one ($var2) is a
>> substring of the other ($var1). Thus the first thing I did was $var1 =~
>> $var2. Now here's my question! How can I alter the code so that its not
>> case-sensitive?
>>
>> $var1 = "Thesaurus";
>> $var2 = "THE";
>>
>> The check should return true, given these variables.
>
>You *could* use (If there aren't any wildcards)
>$var1 =~ /$var2/i;
>to match case insensitive (see perlre)
You could use (even when there _are_ metacharacters):
$var1 =~ /\Q$var2/i; # or, $var2 = quotemeta($var2); before this stmt
>But you should use the index function (see perlfunc)
Good advice. Use the Right Tool For the Job.
>If you have modified $[, then you should use:
If you have modified $[, then fix your program so that
is does not do deprecated things.
:-)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 02 Jun 2000 18:39:34 GMT
From: Derek D'Angelo <derek@ccil.org>
Subject: Re: CGI.pm param function troubles
Message-Id: <8h8v13$2tv$1@nnrp1.deja.com>
In article <3937F3E0.8C19CC25@attglobal.net>,
Drew Simonis <care227@attglobal.net> wrote:
> Derek D'Angelo wrote:
> >
> > Whenever I try using the use CGI qw(:standard); directive it never
> > works.
> >
> > this is the error message I just got on the script you've already
> > pourded over (thanks everyone)
> >
> > Your script produced this error: Unable to create sub named
> > "*Member::header" at ./param.pl line 13
> >
>
> Have you tried changing the call "print $obj->header();" to just
> "print $obj->header;" ?
>
I have, a previous message explained I could use the functions from
CGI.pm without worrying about the OO method ( object->function )
I have not been able to do this successfully. Even the first line,
when I include the CGI library like above, I can't use header; or header
(), or anything without the object reference. I've tried a number of
ways, even copying and pasting code from examples without the object
reference and I've had zero luck. I always get a member error.
thanks again
--
derek@ccil.org
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 02 Jun 2000 15:20:45 -0400
From: Drew Simonis <care227@attglobal.net>
Subject: Re: CGI.pm param function troubles
Message-Id: <3938090D.40CCF17D@attglobal.net>
Derek D'Angelo wrote:
>
> I have, a previous message explained I could use the functions from
> CGI.pm without worrying about the OO method ( object->function )
> I have not been able to do this successfully. Even the first line,
> when I include the CGI library like above, I can't use header; or header
> (), or anything without the object reference. I've tried a number of
> ways, even copying and pasting code from examples without the object
> reference and I've had zero luck. I always get a member error.
>
So that begs the question as to what version of Perl and CGI.pm
you are using. I have no problems using either the function or
object ways of dealing with CGI.pm
------------------------------
Date: Fri, 2 Jun 2000 15:01:12 -0400
From: "Eric M. Winslow" <ewinslow@his.com>
Subject: Re: Cookies stopped working w/Perl 5.6
Message-Id: <39380478_3@news1.his.com>
"jason" <elephant@squirrelgroup.com> wrote in message
news:MPG.13a235f1a9b8ba27989700@news...
> ericwinslow@yahoo.com writes ..
> >print $r->header('cookie'=>$shit);
> ^^
> something's missing here
>
> perldoc CGI::Cookie
If I'm not mistaken, CGI.pm has the cookie functions within it. No need to
call in CGI::Cookie. And if this were the case it shouldn't be working under
5.005 as it is.
Eric
>
> --
> jason - elephant@squirrelgroup.com -
------------------------------
Date: Fri, 02 Jun 2000 15:01:57 -0700
From: Makarand Kulkarni <makarand_kulkarni@My-Deja.com>
Subject: Re: DBI.pm CGI.pm tutorial needed
Message-Id: <39382ED5.819F3EDB@My-Deja.com>
> I see in deja that most people tend to respond to this question in two
> parts: Here's a good DBI book, and here's a good CGI book.
>
> I need examples of how to use them together. I'm decent at DBI already, but
> new to CGI.pm. For example, what should I do with the password that my user
> submits? You name it, I need to figure it out.
>
> Any leads appreciated. I'll eventually get something working using seperate
> materials, but I wish I could stand on someone's shoulders...
try the book
MySQL and mSQL -- R J Yarger, George Reese and Tim King.
Chapter 10.
Not the best book, but this is exactly what you want.
------------------------------
Date: Fri, 02 Jun 2000 20:00:02 GMT
From: rk27@my-deja.com
Subject: Re: Email this story to a friend - html to text
Message-Id: <8h93np$6j7$1@nnrp1.deja.com>
But how do I installed these modules. I tried extracting the files and
putting them in a HTML folder inside the lib folder but the perl
program was unable to find the files.
I am on an NT.
Thanks,
-rk
In article <87itvsghyl.fsf@limey.hpcc.uh.edu>,
Tony Curtis <tony_curtis32@yahoo.com> wrote:
> >> On Fri, 02 Jun 2000 16:19:28 GMT,
> >> rk27@my-deja.com said:
>
> > I would like to add a feature to my website where the
> > clients can email a story to their friends. I want the
> > email to be sent in *plain text*. I have already written
> > the code to grab the contents of a website in html and
> > email it but I would like to convert the html to plain
> > text before I mail it.
>
> Try the HTML::Parser, HTML::TreeBuilder and
> HTML::FormatText modules.
>
> hth
> t
> --
> "Trying is the first step towards failure"
> Homer Simpson
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 2 Jun 2000 20:21:04 GMT
From: Hemant Shah <shah@typhoon.xnet.com>
Subject: END{} alternative?
Message-Id: <8h94vg$rq2$2@flood.xnet.com>
Folks,
Is there an alternative to END{} block. It is supposed to be the replacement
of POSIX atexit() function, but it does not seem to work.
I would like to create a lock directory so that only one instance of my
program runs at time. I would like to automatically remove the lock file
when program exits normally or is interupted via <Ctrl>-C or other signals.
Here is a sample code:
---------cut-------------cut-------------cut-------------cut----
$LockDir="/tmp/mylock.lck"
sub CreateLockFile
{
if(!mkdir($LockDir, 0777))
{
print STDERR "Someone elase is using regionmgt.\n";
exit(1);
}
END {
rmdir($LockDir);
}
}
sub RemoveLockFile
{
rmdir($LockDir);
}
#########################################################################
# Main Program
#########################################################################
&ParseCommandLine;
&CreateLockFile;
&DoSomething
&RemoveLockFile;
exit;
---------cut-------------cut-------------cut-------------cut----
When I start the first instance, the lock directory is created. While first
instance is running if I start second instance, the program exits with error
message, but the lock directory is deleted.
The end block is not yet called, why does it delete the lock directory?
If I interrupt the program with <CTRL>-C, the lock directory is not deleted.
I am looking for something like a trap statement in Korn shell or an atexit()
function in C.
Thanks in advance.
--
Hemant Shah /-------------------\ ^~~~~^
E-mail: NoJunkMailshah@xnet.com |TECHNOLOGY | | |
|No place for wimps | o|-OO-|o
TO REPLY, REMOVE NoJunkMail | -Dilbert |--- | () |
FROM MY E-MAIL ADDRESS. \-------------------/ | |
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind, Above opinions are mine only.
it's backed up on tape somewhere. Others can have their own.
------------------------------
Date: Fri, 02 Jun 2000 19:51:19 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Get the time, plus one hour (was: code cleanup)
Message-Id: <39380fc1.15801318@news.skynet.be>
Bill wrote:
>Thank you all for the help you've afforded me thus far. I have one more question
>regarding GMT. When I set this code for 1 hour from now GMT, does it expire
>according to GMT or will it expire relative to my local time (EST). The above
>code sets the expiry time to 5 hours from my local time.
>
>As this code pertains to cookie expiration, will the cookie expire in 1 hour or
>5 ?
Er... you can say what time your system thinks it is, in a "Date:"
header in GMT. If your add an extra hour for the expiration date, one
hour is what you get.
--
Bart.
------------------------------
Date: Fri, 02 Jun 2000 15:40:34 -0400
From: "Dennis M. Parrott" <dparrott@ford.com>
Subject: Re: LWP POST and send cookies
Message-Id: <39380DB2.84E11134@ford.com>
yahya95@hotmail.com wrote:
>
> I am attempting to interact with remote cgi-script from a cgi script.
> Posting parameters to the remote cgi script is fine using LWP. But what
> need to do is also submit a cookie along with that LWP POST.
>
> Effectively I am creating a dedicated browser which only browsers one
> page and sends a cookie to the server.
>
> Can anyone help with the cookie sending part?
>
use HTTP::Request;
...
$r = new HTTP::Request 'POST', 'some.net.address.whatever';
...
$r->header('Cookie'=>'samcookie: one_cool_dude'); #impervious to y'ung
'uns...
print $r->as_string();
...the foregoing liberally cribbed from _Web Client Programming with
Perl_
by Clinton Wong (pg. 101) published by O'Reilly.
> Thanks
>
HTH
> Ian Nisbet
> ian@nisbet.com
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
------------------------------
Date: Fri, 02 Jun 2000 19:06:59 GMT
From: Bart Kappenburg <b.kappenburg@rcondw.rug.nl>
Subject: making the source unreadable
Message-Id: <393805CF.B94F1A15@rcondw.rug.nl>
Hello,
How can I make the source of a perl-script unreadable? I want to sell a
script but I don't want the buyers to see how I did it...
Plz help
Bart
------------------------------
Date: Fri, 2 Jun 2000 12:26:34 -0700
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: making the source unreadable
Message-Id: <8h91rh$ive$1@brokaw.wa.com>
Bart Kappenburg <b.kappenburg@rcondw.rug.nl> wrote in message
news:393805CF.B94F1A15@rcondw.rug.nl...
> Hello,
>
> How can I make the source of a perl-script unreadable? I want to sell a
> script but I don't want the buyers to see how I did it...
perlfaq3: How can I hide the source for my Perl program?
Lauren
------------------------------
Date: Fri, 02 Jun 2000 19:48:43 GMT
From: jerome@activeindexing.com (Jerome O'Neil)
Subject: Re: making the source unreadable
Message-Id: <vcUZ4.139$nk3.4149@news.uswest.net>
Bart Kappenburg <b.kappenburg@rcondw.rug.nl> elucidates:
> Hello,
>
> How can I make the source of a perl-script unreadable? I want to sell a
> script but I don't want the buyers to see how I did it...
>
It's a lawyer problem. Write your contract protecting your work.
> Plz help
>
>
> Bart
>
------------------------------
Date: Fri, 02 Jun 2000 21:23:57 GMT
From: Denis Haskin <dwhaskin@earthlink.net>
Subject: Re: making the source unreadable
Message-Id: <39382553.79DDD2FE@earthlink.net>
Bart Kappenburg wrote:
> Hello,
>
> How can I make the source of a perl-script unreadable? I want to sell a
> script but I don't want the buyers to see how I did it...
>
Actually, following the coding style of many well-known modules should
prevent them from understanding what's going on in your code...
<grin>
(Sorry, I couldn't resist...)
dwh
------------------------------
Date: 2 Jun 2000 19:07:56 GMT
From: abigail@arena-i.com (Abigail)
Subject: MI in Perl (was Re: Perl vs Python for Numerical Analysis)
Message-Id: <8h90mc$qvq$1@news.panix.com>
On 02 Jun 2000 17:55:45 GMT, zenin@bawdycaste.org <zenin@bawdycaste.org> wrote:
++
++ Perl's object model is lifted from Python, actually. Multiple
++ inheritance and operator overloading are supported. Perl's object
++ model is far more relaxed then most, and even includes things like
++ dynamic inheritance (dynamically redefining a class's inheritance
++ tree at run time).
MI is supported in Perl, but it's such a pain it's pretty useless.
Constructors "build" the object by creating a reference, and initializing
them with data. So, the class that is inheriting from several classes
needs to merge several references into one, in such a way that all the
base classes still can find the stuff they think is there.
You can only do that in a truely non-OO way: knowing the intimate
implementation details of the classes you inherit. And if one of the
classes you inherit change the way it's implemented, you can be majorly
screwed.
Abigail
------------------------------
Date: Fri, 02 Jun 2000 20:29:09 GMT
From: mr_lowell@my-deja.com
Subject: mod_perl
Message-Id: <8h95e2$7uo$1@nnrp1.deja.com>
Can anyone help with this please:
I keep getting the following error when I start the perl enabled server.
Syntax error on line 930 of /usr/local/apache-1.3.12/conf/httpd.conf:
Invalid command 'PerlModule', perhaps mis-spelled or defined by a module
not included in the server configuration
/usr/local/apache-1.3.12/bin/apachectl start: httpd could not be started
This is how I configured the server to run perl scripts under
Apache::Registry in httpd.conf. The server complains about the line that
begins with 'PerlModule'. Do I need to add a specific module????
Alias /perl/ /data/htdocs/modperl/
PerlModule Apache::Registry
<Location /perl>
#AllowOverride None
SetHandler perl-script
PerlHandler Apache::Registry
Options ExecCGI
allow from all
PerlSendHeader On
</Location>
Please help
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 02 Jun 2000 21:11:05 GMT
From: aqumsieh@hyperchip.com (Ala Qumsieh)
Subject: Re: my Foo $self = shift;
Message-Id: <8F47A3EA4aqumsiehhyperchipcom@198.235.216.4>
kaih=7f04f891w-B@khms.westfalen.de (Kai Henningsen) wrote in
<7f04f891w-B@khms.westfalen.de>:
>I haven't been able to find any documentation at all on what this
>syntax *means* (though I've found it *mentioned* in two or three
>other places, enough to believe it's not a typo). Where is it
>hidden?
I do agree that it is not properly documented, but I got a thorough
understand of it by reading Damian Conway's "Object-Oriented Perl". In
some chapter (I can't remember exactly), he discusses pseudo-hashes.
Very intriguing.
--Ala
------------------------------
Date: 2 Jun 2000 21:52:38 GMT
From: damian@cs.monash.edu.au (Damian Conway)
Subject: Re: my Foo $self = shift;
Message-Id: <8h9ab6$ene$1@towncrier.cc.monash.edu.au>
aqumsieh@hyperchip.com (Ala Qumsieh) writes:
>>I haven't been able to find any documentation at all on what this
>>syntax *means* (though I've found it *mentioned* in two or three
>>other places, enough to believe it's not a typo). Where is it
>>hidden?
>I do agree that it is not properly documented, but I got a thorough
>understand of it by reading Damian Conway's "Object-Oriented Perl". In
>some chapter (I can't remember exactly), he discusses pseudo-hashes.
Chapter 4, Section 4.3, pages 126-135.
Specifically, you want Subsection 4.3.5, but read all of Section 4.3 and
it will make more sense.
Damian
------------------------------
Date: 2 Jun 2000 14:15:11 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Non-reuse of memory for lexically-scoped variables?
Message-Id: <8h8fhf$10h$1@charm.magnus.acs.ohio-state.edu>
[A complimentary Cc of this posting was sent to Yitzchak Scott-Thoennes
<sthoenna@efn.org>],
who wrote in article <Bh1N5gzkgGnY092yn@efn.org>:
> If you did have to, would: C<eval <<'ENDOFCODE';> do the trick (so
> long as the eval'd code doesn't define subs with lexicals)?
> env PERL_DEBUG_MSTATS=2 perl -wle "sub a {my $x = 'x' x 1e5} a; 1"
Memory allocation statistics after compilation: (buckets 4(4)..8188(8192)
18748 free: 123 116 37 20 11 8 0 2 1 0 0
442 69 35 23 18
62380 used: 132 138 152 73 5 8 4 16 0 1 1
69 101 305 103 32
Total sbrk(): 81920/14:163. Odd ends: pad+heads+chain+tail: 0+792+0+0.
Memory allocation statistics after execution: (buckets 4(4)..135164(131072)
18748 free: 123 116 37 20 11 8 0 2 1 0 0 0 0 0 0
442 69 35 23 18
332708 used: 132 138 152 73 5 8 4 16 0 1 1 0 0 0 2
69 101 305 103 32
Total sbrk(): 352256/16:165. Odd ends: pad+heads+chain+tail: 0+800+0+0.
> env PERL_DEBUG_MSTATS=2 perl -wle "eval q(my $x = 'x' x 1e5); 1"
Memory allocation statistics after compilation: (buckets 4(4)..8188(8192)
19904 free: 123 120 43 22 11 7 1 2 1 0 0
446 70 38 30 19
61224 used: 132 134 146 71 5 9 3 16 0 1 1
65 100 302 96 31
Total sbrk(): 81920/14:163. Odd ends: pad+heads+chain+tail: 0+792+0+0.
Memory allocation statistics after execution: (buckets 4(4)..135164(131072)
290232 free: 123 120 43 22 11 7 1 2 1 0 0 0 0 0 2
446 70 38 30 19
61224 used: 132 134 146 71 5 9 3 16 0 1 1 0 0 0 0
65 100 302 96 31
Total sbrk(): 352256/16:165. Odd ends: pad+heads+chain+tail: 0+800+0+0.
As you see, in the second case 2 large blocks are free, but in the
first case 2 large blocks are used.
Note also that this stats contradict my statment that 1 large block
will be created at compile time. Do not know when this
optimization/pessimization was implemented (or by who).
Ilya
------------------------------
Date: Fri, 02 Jun 2000 14:34:38 -0400
From: Ted Marz <tfm@sei.cmu.edu>
Subject: Re: NT & Sockets
Message-Id: <3937FE3E.3762A16@sei.cmu.edu>
I don't know, but I suspect this is part of the semantics of your read,
and has little or nothing to do with the actual socket.
rather than using $newvalue=<$socket>, using send() and recv() will
probably get past this. The problem with this is that since you are
operating on a stream,
rather than datagrams, that you may have to catenate a couple of recv
responses together to parse a (completed) input.
If you want to keep with the <$socket> format, there MAY be some perl
variables that allow you to modify the end-of-line detection semantics.
Good Luck
Ted
------------------------------
Date: Fri, 02 Jun 2000 18:44:54 GMT
From: Rodney Engdahl <red_orc@my-deja.com>
Subject: Re: NT & Sockets
Message-Id: <8h8vb2$399$1@nnrp1.deja.com>
In article <eyPB#xLz$GA.326@cpmsnbbsa09>,
"tserface" <tserface@ims.msn.com> wrote:
> The read looks like this:
> $newvalue = <$socket>;
>
> I open the socket like this:
>
> $socket = IO::Socket::INET->new(
> Proto => "tcp",
> PeerAddr => "myserver",
> PeerPort => "11112",
> Type => SOCK_STREAM);
>
> Anyone else figure this one out?
Need to see a little more of the code, i.e. your actual
read/recv/sysread/send/print/syswrite code . . .
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 2 Jun 2000 13:38:29 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: NT & Sockets
Message-Id: <MPG.13a1bb1eb6545b6c98ab1d@nntp.hpl.hp.com>
In article <eyPB#xLz$GA.326@cpmsnbbsa09> on Fri, 2 Jun 2000 10:59:29 -
0700, tserface <tserface@ims.msn.com> says...
> OK, I've been through all of the documents, purchased 3 books, and read
> everything I can find on the web about Perl and sockets. I got sockets
> working in my Perl program on NT, but when I go to read it always blocks
> (waits) unless the packet ends with a NL (\n) character. 2 of the books I
> purchased talk about using fcntl (like in C) to turn off blocking, but these
> don't seem to work on NT (for whatever reason). I know it is possible to
> turn off blocking because the same sort of stuff works in C++, C, and Java.
> I need to do this through a web interface so I will end up either using Perl
> or Java servlets. I really want to use Perl, but the whole thing runs
> really slowly.
my $old_fh = select $socket;
$| = 1;
select $old_fh;
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 2 Jun 2000 20:27:01 GMT
From: The WebDragon <nospam@devnull.com>
Subject: Re: oops Re: seeking method to encode email addresses in web pageforms
Message-Id: <8h95al$7u3$1@216.155.33.21>
In article <39346AE1.5A226285@stomp.stomp.tokyo>, "Godzilla!"
<godzilla@stomp.stomp.tokyo> wrote:
| First time Posix dumps a multi-mega core into
| your script directory, you will be back,
Macintoshes don't 'dump multimega cores' :)
--
send mail to mactech (at) webdragon (dot) net instead of the above address.
this is to prevent spamming. e-mail reply-to's have been altered
to prevent scan software from extracting my address for the purpose
of spamming me, which I hate with a passion bordering on obsession.
------------------------------
Date: Sat, 3 Jun 2000 19:14:29 +0200
From: "Kumanan" <Kumanan@uni.de>
Subject: pattern matching???
Message-Id: <8h94em$rp9$1@piggy.rz.tu-ilmenau.de>
hi,
i want to get the email address from a file (url).
the file look like somethings...
fdf fd dfd df d fd d d d d web@dot.com dff fs fd ff sf f f
dsf sdf df fds fd fdsf asdf@dff.com f ffsdf
so on... (its a html file)
who to write the patten match for this, so that the emails are put in to a
variable
$mail = ~/ / /;
kumanan
kumanan@tamilline.com
------------------------------
Date: Fri, 2 Jun 2000 13:37:52 -0700
From: "Lauren Smith" <lauren_smith13@hotmail.com>
Subject: Re: pattern matching???
Message-Id: <8h9617$j45$1@brokaw.wa.com>
Kumanan <Kumanan@uni.de> wrote in message
news:8h94em$rp9$1@piggy.rz.tu-ilmenau.de...
>
> i want to get the email address from a file (url).
>
> so on... (its a html file)
>
Did you miss the other answers when you posted this exact same text last
time?
Lauren
------------------------------
Date: Fri, 2 Jun 2000 13:48:00 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: pattern matching???
Message-Id: <MPG.13a1bd5eb676399b98ab1f@nntp.hpl.hp.com>
In article <8h94em$rp9$1@piggy.rz.tu-ilmenau.de> on Sat, 3 Jun 2000
19:14:29 +0200, Kumanan <Kumanan@uni.de> says...
> hi,
>
> i want to get the email address from a file (url).
>
> the file look like somethings...
>
> fdf fd dfd df d fd d d d d web@dot.com dff fs fd ff sf f f
> dsf sdf df fds fd fdsf asdf@dff.com f ffsdf
>
> so on... (its a html file)
>
> who to write the patten match for this, so that the emails are put in to a
> variable
>
> $mail = ~/ / /;
You posted this identical message, with the same weird syntax and
semantics errors in the line above, yesterday. Is there some reason to
post it again?
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 02 Jun 2000 21:25:55 GMT
From: Denis Haskin <dwhaskin@earthlink.net>
Subject: Re: pattern matching???
Message-Id: <393825C8.C9DACF13@earthlink.net>
Kumanan wrote:
> i want to get the email address from a file (url).
>
> the file look like somethings...
>
> fdf fd dfd df d fd d d d d web@dot.com dff fs fd ff sf f f
> dsf sdf df fds fd fdsf asdf@dff.com f ffsdf
>
> so on... (its a html file)
And I don't know how I feel about helping someone write a script to harvest
email addresses from web pages...
dwh
------------------------------
Date: Fri, 02 Jun 2000 21:15:20 GMT
From: Hardy Merrill <hmerrill@my-deja.com>
Subject: Re: pattern matching???
Message-Id: <8h984o$a6d$1@nnrp1.deja.com>
> i want to get the email address from a file (url).
>
> the file look like somethings...
>
> fdf fd dfd df d fd d d d d web@dot.com dff fs fd ff sf f f
> dsf sdf df fds fd fdsf asdf@dff.com f ffsdf
>
> so on... (its a html file)
>
> who to write the patten match for this, so that the emails are put in
to a
> variable
>
> $mail = ~/ / /;
This is one simple approach:
#!/usr/bin/perl -w
#
use strict;
my $line;
my $email_addr;
$line = "abc def ghi\@jkl.com nop qrs";
#$line = "abc def nop qrs";
print "Start with line=$line\n";
$line =~ /(\S+\@\S+\.\S+)/;
if (defined($1)) {
$email_addr = $1;
}
else {
$email_addr = "";
}
print "\$email_addr = $email_addr\n";
Hope this helps.
--
Hardy Merrill
Mission Critical Linux
http://www.missioncriticallinux.com
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
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 3238
**************************************