[12708] in Perl-Users-Digest
Perl-Users Digest, Issue: 117 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jul 12 10:07:29 1999
Date: Mon, 12 Jul 1999 07:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 12 Jul 1999 Volume: 9 Number: 117
Today's topics:
Abigail <kent7777@hutchcity.com>
Re: Abigail (Marcel)
Re: Accessing POP mail? <dgris@moiraine.dimensional.com>
Calling C libs from C libs from Perl with XS (Rob Sweet)
Re: Changing case local-specifically <rick.delaney@home.com>
Re: Getting very irregular single 'name' field into fir (Bart Lateur)
Re: Getting very irregular single 'name' field into fir (Abigail)
Re: grep with empty list (Marcel)
Re: How do you get rid of a remainder in a number (Bart Lateur)
Re: How do you get rid of a remainder in a number (I R A Aggie)
Re: How do you get rid of a remainder in a number (Abigail)
Re: How do you get rid of a remainder in a number (Andreas Fehr)
Re: How to dereference an array reference? (Bernie Cosell)
Re: How to dereference an array reference? (Bernie Cosell)
Re: md5 passwords via perl :Answer <witchy@netserv.net.au>
Re: Modules and Perl2exe <frederic.descamps@origin-it.com>
Re: Newbie: Get all directories in a directory: (Stephan Budach)
Old database is erased when I add new information (Perulinks)
redirect perl script to other domain deja@kiama.com
regex question <wcollins@cableworks.org>
Re: regex question (Andreas Fehr)
Re: regex question <wcollins@cableworks.org>
Re: regex question (Andreas Fehr)
Re: regex question (Andreas Fehr)
Sort (Jimtaylor5)
Subroutine references and sort (A.J. Norman)
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 12 Jul 1999 18:56:22 +0800
From: "kent" <kent7777@hutchcity.com>
Subject: Abigail
Message-Id: <7mchlr$l4j2@rain>
Dear Abigail
I can not open your file
------------------------------
Date: Mon, 12 Jul 1999 11:45:02 GMT
From: marcel.grunauer@lovely.net (Marcel)
Subject: Re: Abigail
Message-Id: <3789d51f.10858914@enews.newsguy.com>
On Mon, 12 Jul 1999 18:56:22 +0800, "kent" <kent7777@hutchcity.com>
wrote:
>Dear Abigail
> I can not open your file
Dear Tom
could you send me two copies of that email?
Marcel
--
perl -e 'print unpack(q$u$,q$82G5S="!!;F]T:&5R(%!E<FP@2&%C:V5R$)'
------------------------------
Date: 12 Jul 1999 07:18:07 -0600
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: Accessing POP mail?
Message-Id: <m3g12ut3ao.fsf@moiraine.dimensional.com>
ijg@connect.org.uk (I.J. Garlick) writes:
> Net::POP3 does come as standard with all newer versions of Perl.
No, it doesn't. libnet is not bundled with any version of the
core.
dgris
--
Daniel Grisinger dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'
------------------------------
Date: Mon, 12 Jul 1999 13:44:26 GMT
From: sweet@enterpriseusa.com (Rob Sweet)
Subject: Calling C libs from C libs from Perl with XS
Message-Id: <3789ec8e.308259859@news1.mi.home.net>
Probably a simple answer, but I've read perlxs and perlxstut several
times...
I have a perl module which calls a library compiled from C.
So far so good, works fine.
However, the library itself calls another library, and this is where
I'm failing.
Imagine that I've written a library named libFOO.a and functions in
libFOO.a call functions in libBAR.a (note that both libFOO and libBAR
are by me, not part of the standard distribution).
my.pm -> libFOO.a -> libBAR.a
running make test fails with:
'Can't load 'blib/.../FOO.so' for module FOO: 'blib/...FOO.so:
undefine symbol: a_func_in_libBAR at
/usr/lib/perl5/...../DynaLoader.pm line 169.'
I see that the problem is that I need to either tell it how to find
libBAR.a at run-time, or else how to link it in at compile time... but
I can't figure out how / where.
I expect the answer will be RTF-perldocs of some sort, which is ok
:-), but I promise I've been good and scoured the two xs docs -- so if
that's the answer, could you point me at a section?
FYI the environment is Redhat 6, Perl 5.00503 / i386
Thanks,
Rob Sweet
sweet@enterpriseusa.com
------------------------------
Date: Mon, 12 Jul 1999 12:58:11 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: Changing case local-specifically
Message-Id: <3789E62F.43944DFB@home.com>
[posted & mailed]
Larry Rosler wrote:
>
> In article <378815CF.31C99873@home.com> on Sun, 11 Jul 1999 03:56:42
> GMT, Rick Delaney <rick.delaney@home.com> says...
> >
> > You've never interpolated an array inside double-quotes?
>
> The strings inside a regex or a translation are "double-quoteISH"
> because some semantics differ from those of the ordinary double-quote.
> For example, "\b" means backspace in double-quotes and translate, but
> word-boundary in regex; "\l" means lower-case the next character in
> double-quotes and regex, but 'l' in translate; ... But you knew all
> that, so why are you playing dumb or trying to make me seem dumb?
I would never try to make you seem dumb, Larry. If I did, I wouldn't be
*playing* dumb, myself. I honestly didn't know that you were talking
about the tr/// quoting. Perhaps I should have indicated my confusion
with something other than a "huh?" and a facetious question. Perhaps
you shouldn't be reading between the lines. :-)
Anyway, others have cleared up the confusion but I'd just like to add
one more thing.
> The question was whether the 'join' string was $" in the translate
> environment. As this isn't documented, an experiment would be necessary
> to find out.
It's been pointed out that it is documented that no variable
interpolation is done in tr///. But it is also (almost) documented that
join($", @array) is used in m/@array/ in Gory Details in perlop:
?RE?, /RE/, m/RE/, s/RE/foo/,
Processing of \Q, \U, \u, \L, \l and interpolation happens
(almost)
as with qq// constructs, but [...stuff that is different that
doesn't include any mention of @array interpolation]
where @array interpolation is described under the qq// section. I think
enough people have used this interpolation to build large regexes as in
$" = '|';
m/@array/;# match if any of the patterns in @array matches
that we can probably expect it to stay.
--
Rick Delaney
rick.delaney@home.com
------------------------------
Date: Mon, 12 Jul 1999 11:52:18 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Getting very irregular single 'name' field into first/last name for credit card gateway -- what hit rate is possible?
Message-Id: <378ad608.1383560@news.skynet.be>
Stephen Benson wrote:
>I've posted for years, whether to put the quoted mail top/bottom is
>unregulated, and in practice more people do it the way I do, so people
>instantly see the current message, and scroll down to the old if they need
>it. Matter of taste.
It's a poor habit, especially since that tends to make you lazy: you do
not snip the original post, and keep everything that is not important
for your reply in. That is an enormous waste of bandwidth, as servers
tend to drop older messages as soon as their disks are full. Your nasty
little habit makes sure that fewer posts are kept on the servers.
Second, it is a nice habit to make reply look like a conversation, not
two monologues. The other one says something, your reply to that comes
directly underneath. Then the other says something else, etc. Makes a
much nicer read. What you do looks more like "write only": You've had
your say, but nobody reads it (completely).
Bart.
------------------------------
Date: 12 Jul 1999 08:35:00 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Getting very irregular single 'name' field into first/last name for credit card gateway -- what hit rate is possible?
Message-Id: <slrn7ojrna.h7.abigail@alexandra.delanet.com>
Stephen Benson (stephenb@scribendum.win-uk.net) wrote on MMCXLI September
MCMXCIII in <URL:news:7mch3i$c4f$1@plutonium.compulink.co.uk>:
``
`` I've posted for years, whether to put the quoted mail top/bottom is
`` unregulated, and in practice more people do it the way I do, so people
`` instantly see the current message, and scroll down to the old if they need
`` it. Matter of taste.
*plonk*
Abigail
--
perl -wlpe '}$_=$.;{' file # Count the number of lines.
-----------== 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: Mon, 12 Jul 1999 11:51:08 GMT
From: marcel.grunauer@lovely.net (Marcel)
Subject: Re: grep with empty list
Message-Id: <378bd677.11202548@enews.newsguy.com>
On Sun, 11 Jul 1999 20:55:23 -0700, lr@hpl.hp.com (Larry Rosler)
wrote:
>In article <37890F09.7F14241A@vygen.de> on Sun, 11 Jul 1999 23:39:21
>+0200, Janning Vygen <janning@vygen.de> says...
>
>Actually, it is not returning 'undef' -- it is returning the null
>string, which is just as 'false' as 0, and might not cause a problem if
>used in many numeric contexts. But the question as to why they are
>different is a good one, nevertheless. I awai the answer.
Janning posted the same question in de.comp.lang.perl.misc, and one
answer he got there was:
Perldata:
If you evaluate a named array in a scalar context,
it returns the length of the array. (Note that this
is not true of lists, ..., nor of built-in functions,
which return whatever they feel like returning.)
Does that explain it?
Marcel
--
perl -e 'print unpack(q$u$,q$82G5S="!!;F]T:&5R(%!E<FP@2&%C:V5R$)'
------------------------------
Date: Mon, 12 Jul 1999 11:35:34 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: How do you get rid of a remainder in a number
Message-Id: <3789d2aa.522281@news.skynet.be>
Andreas Fehr wrote:
>Is Abigail a "he" or a "she"?
In one of her posts she wrote: "Maybe I'm your ex-wife". Well, I would
never write anything like that, but she (may I?) seems to like to play
hide-and-seek games with regards to /that matter/.
Bart.
------------------------------
Date: 12 Jul 1999 13:24:55 GMT
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: How do you get rid of a remainder in a number
Message-Id: <slrn7ojr9g.acg.fl_aggie@thepentagon.com>
On Mon, 12 Jul 1999 04:09:32 GMT, Jordan Hiller <hiller@email.com>, in
<37896A84.6B527E@email.com> wrote:
+ I'm afraid Abigail can't get over how fun it is to harass newbies or
+ anyone with questions.
You mean "anyone how can't be bothered to read the documentation".
+ it's Abigail making all the noise!
I'd suggest a newsreader with a killfile...
James
------------------------------
Date: 12 Jul 1999 08:35:40 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: How do you get rid of a remainder in a number
Message-Id: <slrn7ojroj.h7.abigail@alexandra.delanet.com>
Andreas Fehr (backwards.saerdna@srm.hc) wrote on MMCXLI September
MCMXCIII in <URL:news:3789c95c.20062438@news.uniplus.ch>:
?? On 12 Jul 1999 04:35:30 -0500, abigail@delanet.com (Abigail) wrote:
??
?? >Andreas Fehr (backwards.saerdna@srm.hc) wrote on MMCXLI September
?? >MCMXCIII in <URL:news:3789a008.9482905@news.uniplus.ch>:
?? >
?? >But Abigail originates from Europe!
?? >
??
?? The name or the person?
Read the bible lately?
Abigail
--
echo "==== ======= ==== ======"|perl -pes/=/J/|perl -pes/==/us/|perl -pes/=/t/\
|perl -pes/=/A/|perl -pes/=/n/|perl -pes/=/o/|perl -pes/==/th/|perl -pes/=/e/\
|perl -pes/=/r/|perl -pes/=/P/|perl -pes/=/e/|perl -pes/==/rl/|perl -pes/=/H/\
|perl -pes/=/a/|perl -pes/=/c/|perl -pes/=/k/|perl -pes/==/er/|perl -pes/=/./;
-----------== 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: Mon, 12 Jul 1999 13:52:03 GMT
From: backwards.saerdna@srm.hc (Andreas Fehr)
Subject: Re: How do you get rid of a remainder in a number
Message-Id: <3789f058.30042779@news.uniplus.ch>
On 12 Jul 1999 08:35:40 -0500, abigail@delanet.com (Abigail) wrote:
>?? >
>?? >But Abigail originates from Europe!
>?? >
>??
>?? The name or the person?
>
Hmm, I'm not good in geography, but I think I heard, the
region is called near east, that means Asia.
Europe ends between the Turkey (between Thanksgiving?) ;)
Andreas
------------------------------
Date: Mon, 12 Jul 1999 13:42:47 GMT
From: bernie@fantasyfarm.com (Bernie Cosell)
Subject: Re: How to dereference an array reference?
Message-Id: <3790e98c.6760133@news.supernews.com>
theoddone33 <anonymous@web.remarq.com> wrote:
} >It is. A testament to varying skills and sensibilities.
} >Actually filtering spam "locally" [that is, in your mail
} >client] isn't all that hard, but there are a lot of folk
} >who shrink in horror at the very thought of getting
} >_even_one_ unsolicited message, and so violate the RFCs and
} >"spamblock".
}
} Very interesting stuff. I was unaware that the RFCs
} would advise against spam-proofing. Another RFC I saw also
} brought up the fact that the law might view spam-proofing
} as forging email. That's a pretty big "might" though.
} Still, RFCs are not laws and have no punishments attached
} to them. The average Usenet poster, if they even know of
} the existence of RFCs, will most likely not read them, and
} will still be unaware that there are people who dislike
} spam-proofing.
Well, two things: no, RFCs are not "laws", but they are the rules which
glue together the servers and clients on the Internet, and so if you
violate those rules you might find that a picky/carefullywritten server
will simply discard or reject your stuff... you won't be arrested, but you
won't be able to post, either.
As for the the 'forging', that's more problematic...
As for the last, that's not too much of an excuse: that information isn't
hidden, "traditional" news clients would force you to start up in
news.newusers where you'd see the FAQs and "Emily Postnews" and the
Netiquette guidelines [if you haven't read RFC 1855, you should!]
} RFCs aside, I still maintain that if a newsgroup dislikes
} the practice, they should state it in their FAQ, due to the
} fact that the practice is so common.
Usually FAQs for specific newsgroups don't include stuff that is [or at
least _used_to_be_] SOP baseline info. [read 1855 and you'll see]
/Bernie\
--
Bernie Cosell Fantasy Farm Fibers
bernie@fantasyfarm.com Pearisburg, VA
--> Too many people, too few sheep <--
------------------------------
Date: Mon, 12 Jul 1999 13:42:48 GMT
From: bernie@fantasyfarm.com (Bernie Cosell)
Subject: Re: How to dereference an array reference?
Message-Id: <3791eab4.7056303@news.supernews.com>
backwards.saerdna@srm.hc (Andreas Fehr) wrote:
} On Sun, 11 Jul 1999 20:31:32 GMT, bernie@fantasyfarm.com (Bernie
} Cosell) wrote:
}
} >It is. A testament to varying skills and sensibilities. Actually
} >filtering spam "locally" [that is, in your mail client] isn't all that
} >hard, but there are a lot of folk who shrink in horror at the very thought
} >of getting _even_one_ unsolicited message, and so violate the RFCs and
} >"spamblock".
}
} Yes, filtering spam is easy, but here in Europe, most private
} people have a modem dialup connection to the internet and no
} flat rate to connect there. So loading all the spam to your
} computer takes some time and money.
All true, but two things: First, a random spam seems to be about 1K long.
On a 28.8 dialup it'll take about a third-of-a-second to download that
message. Call it a full second. Granted that you have to *pay* for that
second, but just how much does one second of online time cost? [back years
ago in the US, the only way I could access an ISP was via a long distance
phone call... at that time, I managed to find a $US.12/minute phone plan,
and so one second of online time cost me 1/5 of a US penny...
I would guess that the cretins who use the "reply at the top and the ENTIRE
original message glued on at the bottom" style [rather than carefully
editing down the included text, which might take a few seconds of their
precious time] will consume more of your money than will the odd spam
[again, NOT talking about the alleged "spamfest" newsgroups, just the usual
"couple a day" you get for normal visibility on usenet].
Second: there are a bunch of POP3 clients that'll remove the spam on the
server [so you don't even have to download the stuff]. They might well be
of assistance.
I grant you that this isn't all totally inconsequential, but still for most
folk it is not the cataclysm that you might think if you listen to the real
spamophobes...
/Bernie\
--
Bernie Cosell Fantasy Farm Fibers
bernie@fantasyfarm.com Pearisburg, VA
--> Too many people, too few sheep <--
------------------------------
Date: Mon, 12 Jul 1999 21:15:21 +0800
From: Greg Dickson <witchy@netserv.net.au>
Subject: Re: md5 passwords via perl :Answer
Message-Id: <3789EA69.AA5D02FE@netserv.net.au>
The answer to my query didnt require the md5 module at all
the crypt function on recent Linux systems (glibc6) can do it you just
feed it a salt that is 12 characters long
starting with $1$ and finishing with $ like $1$alhd94da$
and that's it
so crypt ('testing','$1$alhd94da$');
gives $1$alhd94da$Hw.do9Z/WE9TgL02uwGVQ0
pretty cool hey
this doesnt work on windows though
> Im trying to get a handle on md5 password generation
> has anyone got an idea how to generate a md5 encrypted string
> from perl.
>
See Ya Greg
--
Greg Dickson
('> witchy@netserv.net.au
//\ Linux System Admin,
v_/_ Perl and Java Programing
Margaret River Western Australia
------------------------------
Date: Mon, 12 Jul 1999 13:55:16 +0200
From: "Frederic Descamps" <frederic.descamps@origin-it.com>
Subject: Re: Modules and Perl2exe
Message-Id: <0E16861EE7BCD111BE9400805FE6841F0A42B93C@c1s5x001.cor.srvfarm.origin-it.com>
Already tried, nothing change...
Andreas Fehr <backwards.saerdna@srm.hc> wrote in message
news:37899f31.9267886@news.uniplus.ch...
> On Mon, 12 Jul 1999 09:27:42 +0200, "Frederic Descamps"
> <frederic.descamps@origin-it.com> wrote:
>
> >Hi,
> >
> >When I want to use Perl2exe with a script (this script works fine with
perl
> >name_name_of_script) using a module, it gives me this following message :
> >
> >Warning: module [name_of_module] not found
> >Make sure that the perl\bin directory is in your path
> >
> >
> >Could somebody help me ?
> >
>
> What about point 8 in the documentation?
>
> Andreas
------------------------------
Date: Mon, 12 Jul 1999 13:54:32 +0200
From: stephan.budach@knsk-bbdo.de (Stephan Budach)
Subject: Re: Newbie: Get all directories in a directory:
Message-Id: <stephan.budach-1207991354320001@budach-stephan.intern.knsk-bbdo.de>
In article <campbell-lange-0807991405420001@campbell-lange.easynet.co.uk>,
campbell-lange@easynet.co.uk (Rory C-L) wrote:
> my @inside = map { ($dir . $_ . ':') } readdir DIR;
> @inside = grep { -d and !/format/i } @inside; #!->eliminate certain dirs#
Rory,
i am having the same problem with unix. Maybe you could tell mw two things:
1st, how are you calling lokkin - just like this &lookin(Directory)?
2nd, i guess with unix i have to change the ":" to a "/", since the
directory separator for unix is "/" (":" is Mac, isnīt it?). And what ist
meant by !/format/i? It seems to be an regexp, but what does it do?
Thanks,
Stephan Budach
------------------------------
Date: 12 Jul 1999 12:30:38 GMT
From: perulinks@aol.com (Perulinks)
Subject: Old database is erased when I add new information
Message-Id: <19990712083038.07296.00011669@ng34.aol.com>
Hello there,
I REALLY would appreciate if somebody helps me here. I bought some very nice
search scrips for my search engine, and the author is unable/uwilling to help
me with an installation problem--it is VERY DIFFICULT to get good tech support
these days. I tried to contact him many times, but he won't just answer.
The problem I have is that everytime I tried to submit a new URL to my search
engine (that works like Yahoo!), the old database is erased!!!! I had submited
already like 800 URLs, and when I add a new one, only the new one remains.
I don't know much about Perl (that is why I bought this scrips in the first
place), but I tried to chmod the database so the URL grabber that automatically
adds more database can write over it, but that doesn't work. I just tried to
upload the old database with the original one to see if I did something wrong.
This time I upload it under binary instead of text, but I don't really thing
this will work either. I had to wait one day before I see if this works.
So if anybody there wants to give me some ideas into what to look at, <b>I
would appreciate.</b> If you would like to see my site--in construction until
I fix this problem-- the URL is:
http://www.perunetwork.com/search/site_searcher.cgi?page=search.thtml
Please email me at perulinks@aol.com (my current web site is
http://members.aol.com/Perulinks/main.htm).
Thanks a lot!!
Carlos M. Chapa
------------------------------
Date: Mon, 12 Jul 1999 13:42:56 GMT
From: deja@kiama.com
Subject: redirect perl script to other domain
Message-Id: <7mcrd0$mng$1@nnrp1.deja.com>
I am looking for a way to make a perl script redirect to another perl
script on a different domain. I tried the obvious, but it doesn't seem
to work:
print "Location: http://otherdomain.com/cgi-bin/myscript.pl\n\n";
Can someone tell me if this is supposed to work?
I also want to pass the parameters which were passed to the first
script on to the redirected script. A working example of this would be
really cool.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Mon, 12 Jul 1999 08:06:10 -0400
From: Wayne Collins <wcollins@cableworks.org>
Subject: regex question
Message-Id: <3789DA31.F928E3E4@cableworks.org>
This is a multi-part message in MIME format.
--------------4995FCD9CA9DB5CF14983E91
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
This program prints "period required" (without the quotes).
I expected both if() conditions to evaluate true.
I expected the asterisk to match on zero or more of whatever character
preceded it.
Can anyone explain why the first if() condition is false?
Thanks.
#!/usr/bin/perl -w
use strict;
my $s = "From Subject Date";
if($s =~ /^(F|S|D)*e$/){
print "no period\n";
}
if($s =~ /^(F|S|D).*e$/){
print "period required\n";
}
--------------4995FCD9CA9DB5CF14983E91
Content-Type: text/x-vcard; charset=us-ascii;
name="wcollins.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Wayne Collins
Content-Disposition: attachment;
filename="wcollins.vcf"
begin:vcard
n:Collins;Wayne
tel;work:(905)575-1212 x3226
x-mozilla-html:FALSE
org:Mohawk College of Applied Arts and Technology;Computer Science and Information Technology
version:2.1
email;internet:collinw@mail.mohawkc.on.ca
title:Professor
adr;quoted-printable:;;Fennell Campus=0D=0AP.O. box 2034=0D=0AL8N 3T2;Hamilton;Ontario;;
x-mozilla-cpt:;-1
fn:Wayne Collins
end:vcard
--------------4995FCD9CA9DB5CF14983E91--
------------------------------
Date: Mon, 12 Jul 1999 12:45:07 GMT
From: backwards.saerdna@srm.hc (Andreas Fehr)
Subject: Re: regex question
Message-Id: <3789e22d.26415203@news.uniplus.ch>
On Mon, 12 Jul 1999 08:06:10 -0400, Wayne Collins
<wcollins@cableworks.org> wrote:
>This is a multi-part message in MIME format.
>--------------4995FCD9CA9DB5CF14983E91
>Content-Type: text/plain; charset=us-ascii
>Content-Transfer-Encoding: 7bit
What about another news client?
>#!/usr/bin/perl -w
>use strict;
>my $s = "From Subject Date";
>
>if($s =~ /^(F|S|D)*e$/){
> print "no period\n";
>}
>if($s =~ /^(F|S|D).*e$/){
> print "period required\n";
>}
/^(F|S|D)*e$/ fails because there are other characters than
'F', 'S' or 'D' between the beginning of the string and the
ending 'e'.
Some "SFFFSSDFSFSDSe" would match.
Andreas
------------------------------
Date: Mon, 12 Jul 1999 09:28:36 -0400
From: Wayne Collins <wcollins@cableworks.org>
Subject: Re: regex question
Message-Id: <3789ED84.1F9E3CDA@cableworks.org>
What client would you recommend?
Your answer is not clear. I expected * to match on zero or more of
whatever character
was at the start of the line, as long as it is F,S or D.
Andreas Fehr wrote:
> On Mon, 12 Jul 1999 08:06:10 -0400, Wayne Collins
> <wcollins@cableworks.org> wrote:
>
> >This is a multi-part message in MIME format.
> >--------------4995FCD9CA9DB5CF14983E91
> >Content-Type: text/plain; charset=us-ascii
> >Content-Transfer-Encoding: 7bit
>
> What about another news client?
>
> >#!/usr/bin/perl -w
> >use strict;
> >my $s = "From Subject Date";
> >
> >if($s =~ /^(F|S|D)*e$/){
> > print "no period\n";
> >}
> >if($s =~ /^(F|S|D).*e$/){
> > print "period required\n";
> >}
>
> /^(F|S|D)*e$/ fails because there are other characters than
> 'F', 'S' or 'D' between the beginning of the string and the
> ending 'e'.
>
> Some "SFFFSSDFSFSDSe" would match.
>
> Andreas
------------------------------
Date: Mon, 12 Jul 1999 14:01:09 GMT
From: backwards.saerdna@srm.hc (Andreas Fehr)
Subject: Re: regex question
Message-Id: <3789f3d6.30936354@news.uniplus.ch>
On Mon, 12 Jul 1999 09:28:36 -0400, Wayne Collins
<wcollins@cableworks.org> wrote:
>What client would you recommend?
>Your answer is not clear. I expected * to match on zero or more of
>whatever character
>was at the start of the line, as long as it is F,S or D.
/^(F|S|D)*e$/
But there are only F|S|Ds allowed between the starting F|S|D and
the ending e$. If you want other characters between, allow them.
(xxx)* means zero or more than what is in the brackets.
There is a difference between the filesystem ('ls' or 'dir') and
regular expression. I would translate something like '*' from the
filesystem to '.*' .
Andreas
------------------------------
Date: Mon, 12 Jul 1999 14:03:50 GMT
From: backwards.saerdna@srm.hc (Andreas Fehr)
Subject: Re: regex question
Message-Id: <3789f56f.31345752@news.uniplus.ch>
On Mon, 12 Jul 1999 09:28:36 -0400, Wayne Collins
<wcollins@cableworks.org> wrote:
>> >This is a multi-part message in MIME format.
>> >--------------4995FCD9CA9DB5CF14983E91
>> >Content-Type: text/plain; charset=us-ascii
>> >Content-Transfer-Encoding: 7bit
>>
>> What about another news client?
Sorry, forgot to answer this one. No problem with the
last post, but the first looked like some HTML post.
Andreas
------------------------------
Date: 12 Jul 1999 13:28:38 GMT
From: jimtaylor5@aol.com (Jimtaylor5)
Subject: Sort
Message-Id: <19990712092838.16903.00011699@ng-fw1.aol.com>
I know how to sort, I've read the notes, etc. But is there a way to sort by
revalant
words before writing without writing to a file, then re-reading again to post
what I have sorted.
In other words, I'm searching for words, I find one line with two instances,
and another line with one instance. I want to put the two instances first. the
Problem I'm having is that I write them for viewing as a matches appears, thus
the one with one match comes up fierst, I've written it already.
I thought maybe to sort and write it to a file, then re-read it and write the
sorted list. Is there a way to do it without writing it to a file and then
re-reading it to write it to an html for viewing online? Am I making any sense
to you? I.e., to simply sort
it all the first time (without writing to a file) with revalent matches first
before writing for viewing?
If there is someone who will answer this question (even by email if you feel
intinidated), please remember I'm just starting out in programming in Pearl.
can you point me in the right direction even if you can't answer?
------------------------------
Date: 12 Jul 1999 14:43:54 +0100
From: nja@le.ac.uk (A.J. Norman)
Subject: Subroutine references and sort
Message-Id: <7mcreq$9ff@harrier.le.ac.uk>
I'm writing CGI scripts today and I'd like to be able to sort a list
depending on the value of one of the CGI parameters - I can think of
several ways to do it, but the one I'd like to use isn't working.
This is what I'd like to do:
my $sortsub = (param('sort_type') eq 'hits')
? \&sort_by_hits
: \&sort_by_host;
my @list = sort &$sortsub keys %data;
Any ideas? I'm probably doing something daft, but I can't see what.
--
Andrew Norman, Leicester, England
nja@le.ac.uk || andrew.norman@le.ac.uk
http://www.le.ac.uk/engineering/nja/
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 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.
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 V9 Issue 117
*************************************