[12439] in Perl-Users-Digest
Perl-Users Digest, Issue: 6039 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jun 18 03:07:24 1999
Date: Fri, 18 Jun 99 00:00:23 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 18 Jun 1999 Volume: 8 Number: 6039
Today's topics:
Re: a thread on threads (the skinny on the schedule) <uri@sysarch.com>
Re: a thread on threads (the skinny on the schedule) <rra@stanford.edu>
Re: a thread on threads (the skinny on the schedule) <uri@sysarch.com>
Re: blank row in array (Abigail)
CGI Simple Question <chongsun@krdl.org.sg>
changing hash keys thru subroutine irfna@my-deja.com
Re: changing text in a file? (Abigail)
Re: email owner name (Abigail)
Re: GDBM and no lock... <Tim.Potter@anu.edu.au>
Help- time olmert@netvision.net.il
Re: How do I jump from one web page to another? (Abigail)
Re: How do I the equiv. of csh echo $0 in perl? (Abigail)
Re: how to change a line of text in a file? (Abigail)
Re: how to change a line of text in a file? (Abigail)
Re: Is Perl4 Y2K compliant? (Abigail)
Re: Neet Perl Obfucation Program (Abigail)
Re: newbie (Jeff D)
Re: newbie <rra@stanford.edu>
Re: OO-Trap! I am confused (Abigail)
Re: Perl Script Question (Abigail)
Re: premature end of script headers (Abigail)
Re: Regular expresions as parameters (Abigail)
sorting an array from 2nd element onwards (JQ)
Re: sorting an array from 2nd element onwards <uri@sysarch.com>
Re: Sorting an Array (Abigail)
Re: Sorting an Array <uri@sysarch.com>
Using perl to run system commands <streaking_pyro@my-deja.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 18 Jun 1999 01:10:24 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: a thread on threads (the skinny on the schedule)
Message-Id: <x71zfaccvz.fsf@home.sysarch.com>
>>>>> "RA" == Russ Allbery <rra@stanford.edu> writes:
RA> Right, threaded programs have to be written very carefully, and
RA> locking is hard. It took most of the class quite a while to
RA> understand locking issues when I took a class in operating system
RA> design.
what about an application (in c) that used threads and had not a single
lock or mutex and has been running full bore for over 2 years? i slurps
in over 5 GB of web pages a day and is rock solid. it is the crawler
used by northern light and i designed it that way.
someone in this thread emailed me asking me about it and i lost the
message so here is a little on how it works. the main thread loop is a
select loop which handles all the sockets and pipes. all code is written
in short events which run to completion without any blocking allowed so
all data is accessible with no locks. when a blocking operation is
needed, a pointer to a control block is passed down a pipe to a thread
pool blocking on reading that pipe. the thread does the I/O or dns
lookup which block. upon return they update the control block and its
pointer is pased back up the pipe. the main select loop sees that and
calls an event to handle the result. the pipes and select do the locking
and sync stuff for you. threads own the control block and its data but
nothing else. it's a different way to look at threads and it has its
advantages. all events have total control over the system and can do
malloc, and other things with no fear. all threads do just their
specialized tasks and nothing else.
the reason for threads is that i can pass a pointer down a pipe and the
thread can use it as is. separate processes would work too if i shared
memory and passed an offset in the shared area to the control
block. this is a general purpose system at its core and not dedicated to
being a crawler. i have removed the application specific code and made
it a library for use by other applications.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: 17 Jun 1999 22:53:12 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: a thread on threads (the skinny on the schedule)
Message-Id: <ylk8t22gxj.fsf@windlord.stanford.edu>
Uri Guttman <uri@sysarch.com> writes:
>>>>>> "RA" == Russ Allbery <rra@stanford.edu> writes:
> RA> Right, threaded programs have to be written very carefully, and
> RA> locking is hard. It took most of the class quite a while to
> RA> understand locking issues when I took a class in operating system
> RA> design.
> what about an application (in c) that used threads and had not a single
> lock or mutex and has been running full bore for over 2 years?
What about it?
Designing a system so that it doesn't need locks is a part of designing a
locking system. Locking is still hard, whether you're doing it or
avoiding it. You're avoiding it by using a clearly-defined protocol for
sharing data, which is essentially what locks are too.
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: 18 Jun 1999 02:40:04 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: a thread on threads (the skinny on the schedule)
Message-Id: <x7k8t2au63.fsf@home.sysarch.com>
>>>>> "RA" == Russ Allbery <rra@stanford.edu> writes:
RA> Uri Guttman <uri@sysarch.com> writes:
>>>>>>> "RA" == Russ Allbery <rra@stanford.edu> writes:
RA> Right, threaded programs have to be written very carefully, and
RA> locking is hard. It took most of the class quite a while to
RA> understand locking issues when I took a class in operating system
RA> design.
>> what about an application (in c) that used threads and had not a single
>> lock or mutex and has been running full bore for over 2 years?
RA> What about it?
RA> Designing a system so that it doesn't need locks is a part of
RA> designing a locking system. Locking is still hard, whether you're
RA> doing it or avoiding it. You're avoiding it by using a
RA> clearly-defined protocol for sharing data, which is essentially
RA> what locks are too.
i never meant that my design doesn't keep the data locked but that it
didn't use standard lock calls to do it. by changing the data sharing
protocol to this it simplifies the code tremendously as you don't have
to figure out how and where to put all the mutexes and friends. all the
locking is done via the pipes and the select/event loop. and they are
pretty much invisible to the code that does the real application work.
it makes for a very easy and highly efficient way to program a
client/server core with multiple threads, multiple i/o and sockets and
no need to call mutexes and locks. as you said writing threaded code is
hard and that is a major trouble spot. i have designed several multiple
process systems with this fundamental design for over a decade and it
has served (sic) me very well. i have just made it more general purpose
over time.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: 17 Jun 1999 21:37:57 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: blank row in array
Message-Id: <slrn7mjc82.fo7.abigail@alexandra.delanet.com>
Michael Hill (l463520@lmtas.lmco.com) wrote on MMCXVI September MCMXCIII
in <URL:news:37692373.C8EF9F32@lmtas.lmco.com>:
!! I created this array like this:
!!
!! @myarr = ($mypart);
!!
!! then populated it like:
!!
!! push (@myarr, "parta");
!! push (@myarr, "partb");
!! push (@myarr, "partc");
!!
!! Then when i display the array I have a blank row.
!!
!! Shouldn't I be able to create the array empty instead of with a blank
!! row?
Well, yes, of course. But you aren't doing so! You initialize the array
with $mypart, so the first element of the array will be $mypart. Which
may, or may not, show up as "a blank row", depending on what's in $mypart
and how you display the array.
Abigail
--
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Fri, 18 Jun 1999 13:46:32 +0800
From: "CacheBoy" <chongsun@krdl.org.sg>
Subject: CGI Simple Question
Message-Id: <7kcmgb$29o$1@godzilla.krdl.org.sg>
How to open another web page in my perl script?
Eg.
if ($in{'option'} eq 'open') {
??? open another html document.
}
------------------------------
Date: Fri, 18 Jun 1999 05:22:56 GMT
From: irfna@my-deja.com
Subject: changing hash keys thru subroutine
Message-Id: <7kcl39$87j$1@nnrp1.deja.com>
Hello, I'm having a problem changing a hash's keys
globally, through a sub, using typeglobs:
-------------------------------
%aHash=qw(hello monkey);
foreach $key{keys %aHash){
print "$key\n";
}
&changeHash{
local(*myHash)=@_;
foreach $key(keys %myHash){
$key="bye bye";
print "$key\n";
}
}
&changeHash(*aHash);
foreach $key{keys %aHash){
print "$key\n";
}
-----------------------------
output:
-------
hello
bye bye
hello
desired output:
---------------
hello
bye bye
bye bye
please help me - thanks
irfan
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 17 Jun 1999 21:39:19 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: changing text in a file?
Message-Id: <slrn7mjcal.fo7.abigail@alexandra.delanet.com>
Ariel (fake@nospam.edu) wrote on MMCXVI September MCMXCIII in
<URL:news:7kbqv0$njf@news.or.intel.com>:
{}
{} to change a few lines of text in a file, my code went like this:
That's a FAQ.
Abigail
--
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 17 Jun 1999 21:41:25 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: email owner name
Message-Id: <slrn7mjcej.fo7.abigail@alexandra.delanet.com>
Keerthi K Arutla (arutla@csee.wvu.edu) wrote on MMCXVI September MCMXCIII
in <URL:news:19990617.183759.938382.NETNEWS@WVNVM.WVNET.EDU>:
\\
\\ I need to find the name of a person given his email-id. Can anybody tell me
\\ how to do that, can atleast provide some useful hints. Ant help is
\\ appreciated. Thank You.
Send him or her an email and ask for it. That's the only thing you can do.
Abigail
--
perl -we '$_ = q ;4a75737420616e6f74686572205065726c204861636b65720as;;
for (s;s;s;s;s;s;s;s;s;s;s;s)
{s;(..)s?;qq qprint chr 0x$1 and \161 ssq;excess;}'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 18 Jun 1999 15:25:26 +1000
From: Tim Potter <Tim.Potter@anu.edu.au>
To: Sebastian Ahrens <dataadm@elfi2.rz.ruhr-uni-bochum.de>
Subject: Re: GDBM and no lock...
Message-Id: <6y4sk6rsft.fsf@acronym.anu.edu.au>
Sebastian Ahrens <dataadm@elfi2.rz.ruhr-uni-bochum.de> writes:
> Hmm I4ve been trying to find out thisone for a while, but for the very
> first time after reading all the manpages and perldoc-pages
> I still don4t have a clue how to let two perlscripts tie one hash-file
> for GDBM.
>
> Could anyone give me a hint?
GDBM supports a readers/writers module of locking. Either many
readers can tie to the database at once, or one writer. To achieve
this, call tie() with GDBM_READER or GDBM_WRITER respectively.
Unfortunately, to get interleaved reading and writing happening in
separate processes, you need to constantly tie and untie your database
as GDBM does database level locking. This may not be so convenient
for you. I've got around this for one application by writing
open_db_reader(), open_db_writer(), close_db() functions but it gets
pretty messy after a while.
You might consider going for something like mysql which provides finer
grained locking.
Tim.
>
> -Sebastian-
>
--
Tim Potter, System Admin/Programmer, Head Bee Guy
Advanced Computational Systems CRC, RSISE Bldg Australian National University,
Canberra 0200, AUSTRALIA Ph: +61 2 62798813 Fax: +61 2 62798602
------------------------------
Date: Fri, 18 Jun 1999 04:31:34 GMT
From: olmert@netvision.net.il
Subject: Help- time
Message-Id: <7kci36$7db$1@nnrp1.deja.com>
Hello
I want to create a script that reads a file, prints it's content and
then sleeps for 4 seconds, checks if there is any new content in the
file, and if so- PRINTS ONLY THE NEW CONTENT.
I am not a perl expert, so with the help of some ppl, I made this
follwoing code. It doesn't work, so the server ptoduces no output. Any
ideas? I run an NT server:
use CGI qw(:standard);
print header, start_html("Chat session");
$fileLocation="chat.txt";
$count = 0;
open (IN, $myfile);
while (<IN>) {
print $_;
$count++;
}
close (IN);
#Wait 20 seconds
sleep 4;
#Begin indefinite loop (you might want to change this to
#run for a certain time or terminate when the user presses
#a key)...
while (1) {
#Test if file is less than 20 seconds old (-M
#returns the age of the file in days...0.0007 is
#the equivalent of 20 seconds...approximately)
if (-M $myfile < 0.0016) {
open (IN, $myfile);
#Ignore the lines from the file that we have
#already displayed
for ($count2 = 0; $count2 < $count;
$count2++) {
$scrap = <IN>;
}
#Print out the new lines and update our
#count
while (<IN>) {
print $_;
$count++;
}
close (IN);
#Wait another 20 seconds
sleep 4;
}
print end_html;
Please reply to olmert@netvision.net.il
Thanks a lot!
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 17 Jun 1999 21:19:29 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: How do I jump from one web page to another?
Message-Id: <slrn7mjb5f.fl5.abigail@alexandra.delanet.com>
Andrew Chang (bikejog@zdial.com) wrote on MMCXVI September MCMXCIII in
<URL:news:376925BA.D40AE225@zdial.com>:
~~
~~ This is probably not perl related, but how do I jump to another
~~ web page from my home page automatically?
It is indeed not Perl related. Ask elsewhere.
Abigail
--
sub f{sprintf$_[0],$_[1],$_[2]}print f('%c%s',74,f('%c%s',117,f('%c%s',115,f(
'%c%s',116,f('%c%s',32,f('%c%s',97,f('%c%s',0x6e,f('%c%s',111,f('%c%s',116,f(
'%c%s',104,f('%c%s',0x65,f('%c%s',114,f('%c%s',32,f('%c%s',80,f('%c%s',101,f(
'%c%s',114,f('%c%s',0x6c,f('%c%s',32,f('%c%s',0x48,f('%c%s',97,f('%c%s',99,f(
'%c%s',107,f('%c%s',101,f('%c%s',114,f('%c%s',10,)))))))))))))))))))))))))
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 17 Jun 1999 21:43:24 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: How do I the equiv. of csh echo $0 in perl?
Message-Id: <slrn7mjcia.fo7.abigail@alexandra.delanet.com>
Kevin Inscoe (inscoe@iag.net) wrote on MMCXVI September MCMXCIII in
<URL:news:7kbnvo$ohu$1@news.iag.net>:
&& In a csh script I can print the full patch of the script
&& by doing an echo $0 such as:
Did you try reading perlvar?
Abigail
--
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(
HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (
LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET",
"http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content))
=~ /(.*\))[-\s]+Addition/s) [0]'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 17 Jun 1999 21:43:52 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: how to change a line of text in a file?
Message-Id: <slrn7mjcj6.fo7.abigail@alexandra.delanet.com>
Ariel (fake@nospam.edu) wrote on MMCXVI September MCMXCIII in
<URL:news:7kbpdc$m30@news.or.intel.com>:
{} Hi, i just started learning Perl on monday, i bought a book on it, but i
{} still have a few questions...first one..how do you change a line of text in
{} a file??
You read the faq.
Abigail
--
perl -wle '$, = " "; print grep {(1 x $_) !~ /^(11+)\1+$/} 2 .. shift'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 17 Jun 1999 21:44:44 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: how to change a line of text in a file?
Message-Id: <slrn7mjckq.fo7.abigail@alexandra.delanet.com>
Ariel (fake@nospam.edu) wrote on MMCXVI September MCMXCIII in
<URL:news:7kbqj7$n9m@news.or.intel.com>:
||
|| i did read several FAQs online...but none of them seemed to help with my
|| specific problem. and another thing is i'm currently using perl for win32
|| (not unix, so a lot of stuff they have on there does not apply)
Huh? You are mistaken. There are some differences. But not for your problem.
Abigail
--
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 17 Jun 1999 21:49:33 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Is Perl4 Y2K compliant?
Message-Id: <slrn7mjctr.fo7.abigail@alexandra.delanet.com>
Daniel W. Burke (dwb1@home.com) wrote on MMCXVII September MCMXCIII in
<URL:news:Pine.LNX.3.96.990617205354.21090B-100000@cc569157-a.warn1.mi.home.com>:
--
-- Hopefully I can wade through all these messages to see the response...
-- but, can perl4 be considered "Y2K Compliant"? I imagine so, but we have
-- an aweful lot of scripts at work that run off perl4/oraperl...
Y2K compliancy isn't your biggest worry when using perl4.
perl4 is insecury, see the CERT archives.
Abigail
--
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
"\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
"\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 17 Jun 1999 21:52:27 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Neet Perl Obfucation Program
Message-Id: <slrn7mjd39.fo7.abigail@alexandra.delanet.com>
Harry P Bloomberg (hpb+@pitt.edu) wrote on MMCXVI September MCMXCIII in
<URL:news:7kbg1t$kb9$1@usenet01.srv.cis.pitt.edu>:
;; I need to be able to deliver some code written in Perl and I want
;; to make it very difficult for unauthrorized personnel to read.
chmod 000 program
;; I've dealt with some commercial packages that have been delivered with
;; Perl source that has been obsfucated to the point that a mere mortal
;; could not make sense of the code. Alas, I've been unable to find a program
;; that can do this, but I know they exist.
You could hire a bad programmer.
;; So, could someone please point me towards a Perl obfucation program,
;; free or commercial?
Just make a license.
Abigail
--
sub f{sprintf'%c%s',$_[0],$_[1]}print f(74,f(117,f(115,f(116,f(32,f(97,
f(110,f(111,f(116,f(104,f(0x65,f(114,f(32,f(80,f(101,f(114,f(0x6c,f(32,
f(0x48,f(97,f(99,f(107,f(101,f(114,f(10,q ff)))))))))))))))))))))))))
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 17 Jun 1999 22:10:48 PDT
From: argnon@argnon.com (Jeff D)
Subject: Re: newbie
Message-Id: <376cd430.16591378@news.concentric.net>
>Is java overtaking perl?
I doubt it. Java while cool has too much political posturing
surrounding it whilst Perl seems to keep cruising along nicely.
Jeff D.
On Fri, 18 Jun 1999 03:40:30 GMT, jvavatara@my-deja.com wrote:
>I'm curious, I am just getting into web programming. I'm a vb
>programmer by trade so I was going to approach the things by learning
>asp, javascript, and vbscript (html is a given).
>
>Is javascript easy to implement on the client for both browsers? Do I
>need to know any C or Perl??
>
>Is java overtaking perl?
>
>
>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.
------------------------------
Date: 17 Jun 1999 22:56:01 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: newbie
Message-Id: <ylhfo62gsu.fsf@windlord.stanford.edu>
In comp.lang.perl.misc, jvavatara <jvavatara@my-deja.com> writes:
> Is javascript easy to implement on the client for both browsers? Do I
> need to know any C or Perl??
If you're asking questions about Javascript, why are you posting them to
newsgroups on Perl and awk? My experience with Javascript is that getting
it to work on more than one browser is a royal pain, but you'll get better
responses from the Javascript group.
I'm not aware of a browser with embedded awk, although it would be rather
nice and a lot more fun to write in than most of the languages people
actually use.
> Is java overtaking perl?
Are they racing? Why do you assume that the answer is one or the other
and not both?
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: 17 Jun 1999 21:59:34 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: OO-Trap! I am confused
Message-Id: <slrn7mjdgj.fo7.abigail@alexandra.delanet.com>
Janning Vygen (janning@vygen.de) wrote on MMCXVI September MCMXCIII in
<URL:news:3769723C.A57CC937@vygen.de>:
..
.. package Customer;
.. my %fields = (
.. cards => [],
.. coins => [],
.. );
..
.. sub new {
.. my $class = shift;
.. my $self = {
.. %fields,
.. };
.. return bless $self, $class;
.. }
..
.. package main;
.. $foo1 = Foo->new();
.. $foo2 = Foo->new();
..
.. $foo1->{'cards'}->[0] = "VISACard";
.. print $foo2->{'cards'}->[0];
Yes, that's because Perl has an unintuitive OO model; one that basically
sucks. Perl happily shares data between objects; there's no copy-on-write.
What you need to do is:
sub new {
my $class = shift;
my $self = {
cards => [],
coins => [],
};
return bless $self, $class;
}
such that all instances of the objects get their own copy of the anon arrays.
Abigail
--
perl -MNet::Dict -we '(Net::Dict -> new (server => "dict.org")
-> define ("foldoc", "perl")) [0] -> print'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 17 Jun 1999 22:02:46 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Perl Script Question
Message-Id: <slrn7mjdmk.fo7.abigail@alexandra.delanet.com>
John Fung (microfhy@netvigator.com) wrote on MMCXVI September MCMXCIII in
<URL:news:37691765.768E64F9@netvigator.com>:
## Perl Script Question
##
## Dear Sir,
##
## I would to have a perl script that when I input
## my name : JJ and age : 19, then
## click "Send", it will display in another page :
## Your Name is JJ
## Your age is 19
##
## Please help me and reply !!
## Thank you very much for your help !!
This is four times, not counting the one I found in my mailbox as
a followup to a totally unrelated thread.
Please, go away.
Abigail
--
perl -e '$_ = q *4a75737420616e6f74686572205065726c204861636b65720a*;
for ($*=******;$**=******;$**=******) {$**=*******s*..*qq}
print chr 0x$& and q
qq}*excess********}'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 17 Jun 1999 21:23:13 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: premature end of script headers
Message-Id: <slrn7mjbce.fl5.abigail@alexandra.delanet.com>
j_a_p@my-deja.com (j_a_p@my-deja.com) wrote on MMCXVI September MCMXCIII
in <URL:news:7kbdh0$q5o$1@nnrp1.deja.com>:
""
"" Again I checked the error log and an premature
"" end of script headers was given. Does anyone
"" know why.
Looks like you ran out of headers too soon!
Now, what's your Perl question?
Abigail
--
package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g;
print } sub __PACKAGE__ { &
print ( __PACKAGE__)} &
__PACKAGE__
( )
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 17 Jun 1999 22:04:35 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Regular expresions as parameters
Message-Id: <slrn7mjdq1.fo7.abigail@alexandra.delanet.com>
Derek Lavine (derek@realware.com.au) wrote on MMCXVI September MCMXCIII
in <URL:news:3768C234.F2F911A9@realware.com.au>:
//
// I would like to be able to call a function passing it a hash of regular
// expressions and a hash of field values. Both hashes will have a common
// index (namely the field names) to which the field values correspond.
You want qr.
Abigail
--
perl -MNet::Dict -we '(Net::Dict -> new (server => "dict.org")
-> define ("foldoc", "perl")) [0] -> print'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Fri, 18 Jun 1999 06:05:24 GMT
From: pigs_can_fly@mindless.com (JQ)
Subject: sorting an array from 2nd element onwards
Message-Id: <3774e157.23315031@news.cyberway.com.sg>
Hi
Is it possible to sort an array alphabetically only from the 2nd
element onwards?
For example:
from:
-----------------------------
MONKEY
Mouse
Zebra
Elephant
Dog
Cat
-----------------------------
result:
-----------------------------
MONKEY
Cat
Dog
Elephant
Mouse
Zebra
-----------------------------
I know I could extract the first element (MONKEY) from the array, sort
the array, then put MONKEY back in using "unshift", but is there a
shorter and more efficient way to do this?
Thanks
JQ
------------------------------
Date: 18 Jun 1999 02:45:46 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: sorting an array from 2nd element onwards
Message-Id: <x7emjaatwl.fsf@home.sysarch.com>
>>>>> "J" == JQ <pigs_can_fly@mindless.com> writes:
J> Is it possible to sort an array alphabetically only from the 2nd
J> element onwards?
J> I know I could extract the first element (MONKEY) from the array, sort
J> the array, then put MONKEY back in using "unshift", but is there a
J> shorter and more efficient way to do this?
pray tell, how would you do it? sort requires the ability to mangle its
input order so how could it know not to touch slot 0? your idea is
probably as good as any. i am sure others will try to come up with more
fun ways.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: 17 Jun 1999 22:07:12 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Sorting an Array
Message-Id: <slrn7mjduu.fo7.abigail@alexandra.delanet.com>
news.boeing.com (jim.ray@west.boeing.com) wrote on MMCXVI September
MCMXCIII in <URL:news:FDHMt3.DtB@news.boeing.com>:
[] Is there a way to sort and array.
[]
[] Case:
[] I have 7 fields delimited by a ;
[] I want to sort on field 5.
[] Then I willl write the file back out.
[]
[] Thank you.
[] --
[] Jim Ray
[] Delta Program NT Administrator
[] The Boeing Company
[] 714-896-2038
[] jim.ray@west.boeing.com
One would assume Boeing employees can read a FAQ.
But then again, it might explain the Delta launch failures.
Abigail
--
perl -we '$@="\145\143\150\157\040\042\112\165\163\164\040\141\156\157\164".
"\150\145\162\040\120\145\162\154\040\110\141\143\153\145\162".
"\042\040\076\040\057\144\145\166\057\164\164\171";`$@`'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 18 Jun 1999 02:42:50 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Sorting an Array
Message-Id: <x7hfo6au1h.fsf@home.sysarch.com>
>>>>> "A" == Abigail <abigail@delanet.com> writes:
A> news.boeing.com (jim.ray@west.boeing.com) wrote on MMCXVI September
A> MCMXCIII in <URL:news:FDHMt3.DtB@news.boeing.com>:
A> [] --
A> [] Jim Ray
A> [] Delta Program NT Administrator
A> [] The Boeing Company
A> One would assume Boeing employees can read a FAQ.
A> But then again, it might explain the Delta launch failures.
both can be explained by the choice of the OS he works with.
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Fri, 18 Jun 1999 04:46:31 GMT
From: R.Joseph <streaking_pyro@my-deja.com>
Subject: Using perl to run system commands
Message-Id: <7kciv5$7l3$1@nnrp1.deja.com>
I would like to use a Perl script to run the command "htpasswd."
However, I want to do this using CGI because my web server does not
allow Telnet. Because htpasswd prompts you for a password twice after
running it, would this script be possible to be used over a CGI-type
interface, or am I totally delusional? Thanks in advance!!
--
R.Joseph
http://www.24-7design.com
http://bowdown.to
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 6039
**************************************