[10625] in Perl-Users-Digest
Perl-Users Digest, Issue: 4217 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Nov 13 20:07:27 1998
Date: Fri, 13 Nov 98 17:00:21 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 13 Nov 1998 Volume: 8 Number: 4217
Today's topics:
Re: 64-bit Perl? (Ilya Zakharevich)
Re: a RE for email addresses? <nospam.gear4u@hotmail.com>
Re: CGI.pm book, reviews? (brian d foy)
Re: Double pipe question (Tad McClellan)
emacs cperl-mode: Yank Problem (Sam Tregar)
Re: emacs cperl-mode: Yank Problem (Ilya Zakharevich)
Extracting substrings <nkanth@cnd.hp.com>
Re: Extracting substrings <baliga@synopsys.com>
Re: Extracting substrings (Sean McAfee)
File Locking Problems <cheers69@email.msn.com>
Re: Holy Abounding Books, Batman! (Tad McClellan)
Re: Holy Abounding Books, Batman! (Ilya Zakharevich)
Re: Holy Abounding Books, Batman! vikkki@my-dejanews.com
Re: Is this a regex bug? <r28629@email.sps.mot.com>
Re: MacPerl, Help, and Internet Config (Paul J. Schinder)
Re: Need a two way hash <aqumsieh@matrox.com>
Re: Need a two way hash <r28629@email.sps.mot.com>
Perl equiv of java showDocument()? <bchapman@best.com>
Re: Perl for CGI scripts <perlguy@technologist.com>
Problem with sendmail in Perl <benhaj@eleves.enpc.fr>
Re: Q: Frustrated! Converting Cisco config files to (Larry Rosler)
Re: Q: Frustrated! Converting Cisco config files to DNS (Kathleen Applegate)
Re: Raw Sockets <carvdawg@patriot.net>
Regular expression for "B, except after A"? (Ian Underwood)
Re: Regular expression for "B, except after A"? (Sean McAfee)
Sorting Question supradave@earthlink.net
Re: Year 2000 issues with localtime & gmtime <upsetter@ziplink.net>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 13 Nov 1998 23:30:05 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: 64-bit Perl?
Message-Id: <72ifdt$4s2$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to John Porter
<jdporter@min.net>],
who wrote in article <364C8725.1A28A466@min.net>:
> > Well, it improved a tiny bit since then, but only a really *tiny* bit.
>
> What do you mean, "a *tiny* bit" ???
>
> Aren't all bits the same size?
Only if they are put the same distance from you.
Ilya
------------------------------
Date: Fri, 13 Nov 1998 19:10:21 -0500
From: sara starre <nospam.gear4u@hotmail.com>
Subject: Re: a RE for email addresses?
Message-Id: <364CCA6D.E39477EB@hotmail.com>
hi Clay-
Thanks for posting the only helpful response to my question. Apparently the others
require one does a doctoral dissertation on a topic before they ask a question about
it. Even when I pointed out that I'd already researched it in my Camel book, on the
www, and even written an attempt and gave examples. Anyhow- thanks for for being a
(!jerk).. :)
Anyow, One question- you said that
good: m1ymail@my1place2.mystate. (space) com3
is a *good* email address? That seems odd doesn't it? I don't recall seeing a space in
an email address before.
Clay Irving wrote:
> In <364B953A.C359E0BB@hotmail.com> sara starre <nospam.gear4u@hotmail.com> writes:
>
> >I tried to use the /.+\@.+\..+(\..+)*/ to find good email addresses, but
> >it let
> >"my mail@myplace.com" thru, so I modified it to: /.+\@.+\..+(\..+)*/ &&
>
------------------------------
Date: Fri, 13 Nov 1998 17:26:31 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: CGI.pm book, reviews?
Message-Id: <comdog-ya02408000R1311981726310001@news.panix.com>
In article <JB132.118$_g.811467@news.rdc1.sfba.home.com>, jbharvey@corp.home.net posted:
> Official Guide to Programming with CGI.pm: The Standard for Building Web
> Scripts by Lincoln Stein, ISBN 0471247448
>
> Anyone own it or read it? I'm interested in purchasing it but haven't
> seen it in bookstores, would like some feedback on the quality of it.
it's the best CGI book that i've seen, although that's only a
relative measure of worth. if you absolutely wanted to buy a
book, that's the one that i would recommend.
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
------------------------------
Date: Fri, 13 Nov 1998 17:57:48 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Double pipe question
Message-Id: <s1hi27.h01.ln@flash.net>
Matthew Paulson (mpaulson@tiac.net) wrote:
: Does anybody know if there's a way to create a read and write pipe to a
: filter program so that I could write to its stdin and process its
: stdout?
Perl FAQ, part 8:
"How can I open a pipe both to and from a command?"
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 13 Nov 1998 22:12:41 GMT
From: sdt201@is6.nyu.edu (Sam Tregar)
Subject: emacs cperl-mode: Yank Problem
Message-Id: <72iasp$tdo$1@news.nyu.edu>
Hello. I'm having a problem using cperl-mode version 4.12 with GNU Emacs
version 20.2.1 on Redhat Linux 5.1. Whenever I do a CTRL-Y yank I get a
beep and the error message "Error: '(args-out-of-range 1 1)'".
Anyone have a solution or maybe just advice on how to turn off the
beepingh?
-sam
------------------------------
Date: 13 Nov 1998 23:35:14 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: emacs cperl-mode: Yank Problem
Message-Id: <72ifni$52a$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Sam Tregar
<sdt201@is6.nyu.edu>],
who wrote in article <72iasp$tdo$1@news.nyu.edu>:
> Hello. I'm having a problem using cperl-mode version 4.12 with GNU Emacs
> version 20.2.1 on Redhat Linux 5.1. Whenever I do a CTRL-Y yank I get a
> beep and the error message "Error: '(args-out-of-range 1 1)'".
>
> Anyone have a solution or maybe just advice on how to turn off the
> beepingh?
Yes. Read what Cperl mini-docs (available from menus) say about this.
Ilya
------------------------------
Date: Fri, 13 Nov 1998 16:43:32 -0700
From: Srikanth Natarajan <nkanth@cnd.hp.com>
Subject: Extracting substrings
Message-Id: <364CC424.F5C7C6BA@cnd.hp.com>
Hi
I have a sample string like this
!!1%abcdefgh!!2%dfdfddfd!!10%dfdddddd
The number between !! and the % can be anywhere between 1 and 100
In the above string they are 1,2 and 10
But in reality it can be anywhere b/w 1 and 100
Now, given this string I want to extract all the numbers in it and
store them in an array. The numbers will be stored in the same order
in which they occur in the string.
Can somebody help me?
Srikanth
------------------------------
Date: Fri, 13 Nov 1998 15:56:05 -0800
From: Yogish Baliga <baliga@synopsys.com>
To: Srikanth Natarajan <nkanth@cnd.hp.com>
Subject: Re: Extracting substrings
Message-Id: <364CC715.916A9B2A@synopsys.com>
my $tmp="!!10%asdc!!10%0asdasddas!!asdasd100%0adads!!";
shift @array1;
my @array2 = map { my $t=$_; $t=~s/.*?([0-9]*)%([0-9]*).*/\1\2/; $t; }
split /!!/
, $tmp;
shift @array2;
print join "\n", @array2;
-- Baliga
Srikanth Natarajan wrote:
> Hi
>
> I have a sample string like this
>
> !!1%abcdefgh!!2%dfdfddfd!!10%dfdddddd
>
> The number between !! and the % can be anywhere between 1 and 100
> In the above string they are 1,2 and 10
> But in reality it can be anywhere b/w 1 and 100
>
> Now, given this string I want to extract all the numbers in it and
> store them in an array. The numbers will be stored in the same order
> in which they occur in the string.
>
> Can somebody help me?
>
> Srikanth
------------------------------
Date: Sat, 14 Nov 1998 00:04:42 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: Re: Extracting substrings
Message-Id: <uO332.6544$fS.21627844@news.itd.umich.edu>
In article <364CC424.F5C7C6BA@cnd.hp.com>,
Srikanth Natarajan <nkanth@cnd.hp.com> wrote:
>I have a sample string like this
>!!1%abcdefgh!!2%dfdfddfd!!10%dfdddddd
>The number between !! and the % can be anywhere between 1 and 100
>In the above string they are 1,2 and 10
>But in reality it can be anywhere b/w 1 and 100
>Now, given this string I want to extract all the numbers in it and
>store them in an array. The numbers will be stored in the same order
>in which they occur in the string.
Check the perlop manpage. Read how the m//g operator behaves in list
context:
$str = "!!1%abcdefgh!!2%dfdfddfd!!10%dfdddddd";
@nums = $str =~ m/!!(\d+)%/g;
Ain't Perl grand?
--
Sean McAfee | GS d->-- s+++: a26 C++ US+++$ P+++ L++ E- W+ N++ |
| K w--- O? M V-- PS+ PE Y+ PGP?>++ t+() 5++ X+ R+ | mcafee@
| tv+ b++ DI++ D+ G e++>++++ h- r y+>++** | umich.edu
------------------------------
Date: Fri, 13 Nov 1998 23:22:01 -0000
From: "Grace Carter" <cheers69@email.msn.com>
Subject: File Locking Problems
Message-Id: <O0tLfx1D#GA.250@upnetnews05>
I need help please!
I have a problem with file locking (it seems)
The situation is this:
Several scripts Each accessing a database consisting of simple text files
(Each simple text database entry consists of 5-6 lines of text)
It appears one or all of my scripts are trying to access files at the same
time and I've ended up with a load of corrupt database entries.
Fortunately anticipating any problems I made backups of each text file. But
I can't just ovewrite the existing DB's with the backups as the existing
ones although corrupt (in parts) have recent and updated info which haas
survived.
EXAMPLE :
backup file:
---------------------
SITENAME: Perl Site
VISITORS: 0
------------------
corrrupt file:
------------------
(empty)
VISITORS: 12000000
------------------
Bearing in mind I'm VERY new to perl. Can anyone advise on how I might go
about writing a script to replace empty lines in existing DB's with lines
from the backup files.
Also, can anyone help with my file-locking problem I've entered flock
(FILE,2); to lock and flock (FILE,8); to unlock
at every open and close in my scripts but it doesn't seem to have helped.
Thanks
-Gary
------------------------------
Date: Fri, 13 Nov 1998 17:54:36 -0600
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Holy Abounding Books, Batman!
Message-Id: <srgi27.h01.ln@flash.net>
David Bolton (dbolton@IdeaPlace.org) wrote:
: I'd like to learn a little cgi/perl, but after reading Amazon.com book
: reviews for a couple of evenings, I have to say that the number of how-to
: books on the subject is staggering.
As you are a beginner I must point out that there is copious
free documentation that is included as part of the perl
distribution.
Better than any book (even the Camel) when a reference is needed.
Though not appropriate for learning Perl.
Included in the above (look for a 'pod/' subdirectory in the
directories listed by 'perl -V' to find them on your system)
are:
1) The 'perlbook' man page.
2) Perl FAQ part 2, (perlfaq2.pod) that has a section "Perl Books".
That answer to your Frequently Asked Question also supplies
a URL to some book critiques on www.perl.com
: For a beginner (with a modest background in Java programming), which books
: do the better job teaching cgi/perl to the novice?
^^^^^^^^
These are not joined at the hip. Perl had a vibrant life before
the WWW was even invented.
I would suggest *not* trying to learn both Perl and CGI programming
at the same time. Learn Perl first, _then_ work on the CGI.
(and when you do get to CGI, use the CGI.pm module)
: My tentative plan is:
: 1) Discover Perl 5 (Barkokati) for a brief intro tutorial.
: 2) Learning Perl (Schwartz) for the follow-up in-depth learning.
: 3) Programming Perl (Wall) for reference
: Thanks in advance for the help,
I advise going straight to Learning Perl.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 13 Nov 1998 23:33:26 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Holy Abounding Books, Batman!
Message-Id: <72ifk6$510$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Darrin Edwards
<d-edwards@nospam.uchicago.edu>],
who wrote in article <tgbtmbs9ce.fsf@noise.bsd.uchicago.edu>:
> > 3) Programming Perl (Wall) for reference
> I can heartily recommend 3; it contains essentially _all_ of the
> information contained in perl's man pages _plus_ more in-depth
> explanations and copious examples.
I would not think so. Perl manpages are nowadays 3..5 times larger
than Programming Perl. They do not bend to how-to mentality, though,
so reading PP should provide an important *addition* to manpages.
Ilya
------------------------------
Date: Fri, 13 Nov 1998 23:49:26 GMT
From: vikkki@my-dejanews.com
Subject: Re: Holy Abounding Books, Batman!
Message-Id: <72igi6$33f$1@nnrp1.dejanews.com>
Hi!
I started with:
Learning Perl 2nd Edition - Schwartz/Christiansen/Wall
Programming Perl 2nd Edition - Wall/Christiansen/Schwartz
Mastering Regular Expressions - Friedl (I feel is a must have)
Web Client Programming with Perl - Wong
CGI Programming on the World Wide Web - Gundavaram
and to finish it all off
CGI/Perl Cookbook - Patchett/Wright
And then...I spend lots of time reading at www.perl.com
Vikki
"The day I become perfect is the day I have license to criticize...today is
not that day....tomorrow is not looking good either" -- me
In article <72hk5n$l17$1@news3.mr.net>,
"David Bolton" <dbolton@IdeaPlace.org> wrote:
> I'd like to learn a little cgi/perl, but after reading Amazon.com book
> reviews for a couple of evenings, I have to say that the number of how-to
> books on the subject is staggering.
>
> For a beginner (with a modest background in Java programming), which books
> do the better job teaching cgi/perl to the novice?
>
> My tentative plan is:
>
> 1) Discover Perl 5 (Barkokati) for a brief intro tutorial.
> 2) Learning Perl (Schwartz) for the follow-up in-depth learning.
> 3) Programming Perl (Wall) for reference
>
> Thanks in advance for the help,
>
> Dave
>
>
--
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 13 Nov 1998 17:45:39 -0600
From: Tk Soh <r28629@email.sps.mot.com>
Subject: Re: Is this a regex bug?
Message-Id: <364CC4A3.6D607301@email.sps.mot.com>
Randal Schwartz wrote:
>
> >>>>> "miles33" == miles33 <miles33@ix.netcom.com> writes:
>
> miles33> Hi
> miles33> The code included below generates:
>
> miles33> *tag1
> miles33> *tag2
> miles33> **tag3
> miles33> **tag4
>
> As I expected.
>
> miles33> I expected:
>
> miles33> *tag1
> miles33> *tag2
> miles33> **tag1
> miles33> **tag2
> miles33> **tag3
> miles33> **tag4
>
> No. :)
>
> miles33> Changing the hashref to a scalar gives me the results I expect.
>
> Hmm. I doubt this, unless you are making a copy at the same time.
It does.
> miles33> Am I misunderstanding something about the relation between
> miles33> hashrefs and the /g match option or is this a bug?
>
> It's no bug.
>
> miles33> -- Start of code --
> miles33> #!/usr/bin/perl -w
> miles33> use strict;
>
> miles33> my $hashref = {};
>
> miles33> $hashref->{TEXT} = '<tag1><tag2><tag3><tag4>';
>
> miles33> process_1($hashref);
> miles33> process_2($hashref);
>
> miles33> sub process_1 {
> miles33> my $text1 = $hashref;
>
> miles33> while ($text1->{TEXT} =~ /<([^>]+)>/g) {
> miles33> print "*", $1, "\n";
> miles33> last if $1 =~ /2/;
> miles33> }
> miles33> }
>
> miles33> sub process_2 {
> miles33> my $text2 = $hashref;
>
> miles33> while ($text2->{TEXT} =~ /<([^>]+)>/g) {
> miles33> print "**", $1, "\n";
> miles33> }
> miles33> }
> miles33> -- End of code --
>
> There's only one "scalar" involved. pos($hashref->{TEXT}) will be
> shared amongst all the /g iterators.
>
> If you copy the data to a new scalar var, then you'll get a new pos().
> If that's what you want, you need to do it yourself.
If $hashref was a scalar variable, $text1 and $text2 in the subs will be
copies of $hashref, which then get a new pos() as you stated.
-tk
------------------------------
Date: 13 Nov 1998 22:49:10 GMT
From: schinder@leprss.gsfc.nasa.gov (Paul J. Schinder)
Subject: Re: MacPerl, Help, and Internet Config
Message-Id: <72id16$637$1@clarknet.clark.net>
In <72g5eo$312$1@nnrp1.dejanews.com> johnny99@sydney.dialix.oz.au writes:
>I'm sure this question has been asked before, and I apologise like hell, but I
>can't seem to find a fix for it, or a reference on DejaNews:
>I can't get MacPerl's help menu to work. Every time I try it says:
>Could not find helper for "pod". Do you want to create one?
And did you create one? Just as it tells you to do in the file
"README.MAC" in your MacPerl folder? I'm not running MacOS at the
moment, so this is from memory, but in the same place in Internet
Config where you set up a helper for "file", you should see a New
button. So you should use it to set up a helper for "pod".
>"For "file" you should specifiy a WWW browser as the helper"
>and then offers to open internet Config. I have done various things with
>internet config, (like, oh, I don't know, specifying a WWW browser as the
>helper for "file" for instance!) and nothing seems to work.
>What the hell is going on?
>TIA, please crosspost, redirect me, flame me, etc as appropriate,
>jh
>--
>I'll have this thing looking like the Mac in no time!
>Neil Kontzen, Windows Developer, 1984
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
--------
Paul J. Schinder
NASA Goddard Space Flight Center
schinder@leprss.gsfc.nasa.gov
------------------------------
Date: 13 Nov 1998 15:41:08 -0500
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Need a two way hash
Message-Id: <x3ybtmbe36j.fsf@tigre.matrox.com>
Balazs Rauznitz <prauz@sprynet.com> writes:
>
> Awrobinson wrote:
> >
> > I'm building an application where I have two quantities matched up. In some
> > cases, I need to use one set as the key to the other. In other cases, I need to
> > use the second set as the key to the first. Can anyone suggest a convenient way
> > to do this? Is there a way to use the values in a hash to get to the keys?
> >
> > TIA...
> >
> > Andrew Robinson
> > ---
> > Disclaimer: The opinions expressed are mine alone and do not represent the
> > views of America Online
>
> %other_way = reverse (%one_way);
>
> one_way is put into list context so it will only be a list of (key1,
> val1, key2, val2 .....keyN, valN). Now if you reverse it then it will be
> (valN, keyN .....,val1, key1) which is what you wanted to do.
>
Wooooah! what if the original hash contained similar values for
different keys?
if $a{1} = 10;
and $a{2} = 10;
%b = reverse %a;
$b{10} = 2;
you'll lose the other value!
Ala
------------------------------
Date: Fri, 13 Nov 1998 17:13:35 -0600
From: Tk Soh <r28629@email.sps.mot.com>
To: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Need a two way hash
Message-Id: <364CBD1F.8846B0B4@email.sps.mot.com>
[posted to c.l.p.m and opy emailed]
Ala Qumsieh wrote:
>
> Balazs Rauznitz <prauz@sprynet.com> writes:
>
> >
> > Awrobinson wrote:
> > >
> > > I'm building an application where I have two quantities matched up. In some
> > > cases, I need to use one set as the key to the other. In other cases, I need to
> > > use the second set as the key to the first. Can anyone suggest a convenient way
> > > to do this? Is there a way to use the values in a hash to get to the keys?
> > >
> > > TIA...
> > >
> > > Andrew Robinson
> > > ---
> > > Disclaimer: The opinions expressed are mine alone and do not represent the
> > > views of America Online
> >
> > %other_way = reverse (%one_way);
> >
> > one_way is put into list context so it will only be a list of (key1,
> > val1, key2, val2 .....keyN, valN). Now if you reverse it then it will be
> > (valN, keyN .....,val1, key1) which is what you wanted to do.
> >
>
> Wooooah! what if the original hash contained similar values for
> different keys?
>
> if $a{1} = 10;
> and $a{2} = 10;
>
> %b = reverse %a;
>
> $b{10} = 2;
>
> you'll lose the other value!
>
> Ala
By wanting to access the key from value, the assumption is that the
values are also uniq among themself, else the lost of duplicated key
(value, when reversed) is expected.
-tk
------------------------------
Date: Fri, 13 Nov 1998 15:37:22 -0800
From: Bill Chapman <bchapman@best.com>
Subject: Perl equiv of java showDocument()?
Message-Id: <364CC2B2.9E6F86D@best.com>
In Java, there is a routine where you can say "replace the current html
file with another one right now". It is called
AppletContext.showDocument(url), for example,
AppletContext.showDocument(new URL("http://www.yahoo.com"))
Means go to yahoo.com, without the user having to do anything.
HTML
Is there a way to do this in html? For example, suppose a site moves.
Would it be possible to leave an html page at the old place that just
goes straight to the new site without the user doing anything?
Perl
Does Perl have any such capability?
Please cc: me in your reply, ie use "reply all" in Netscape 4.5.
Thanks,
Bill Chapman
------------------------------
Date: Fri, 13 Nov 1998 18:43:46 -0600
From: Brent Michalski <perlguy@technologist.com>
To: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: Perl for CGI scripts
Message-Id: <364CD242.DD9E101F@technologist.com>
Randal Schwartz wrote:
> >>>>> "Brent" == Brent Michalski <perlguy@technologist.com> writes:
>
> >> What is your opinion on PERL versus other languages for writing CGI
> >> scripts?
> Brent> Perl is __THE__ best language for it. Would you expect a different
> Brent> answer from this newsgroup?
>
> I wouldn't quite go that far. Perl is probably the predominant CGI
> language simply because it can be optimized in so many different
> directions, usually all leaning towards rapid development, deployment,
> and re-engineering... all very important problems to solve in this
> wild world of web.
>
> However, there are other languages that can compete with Perl for
> narrow segments of CGI applications.
>
> If you're gonna learn just one thing to make you a "web programmer",
> be sure it's Perl.
>
> But if you're gonna learn five things about "web programming", make
> sure one of them is Perl. :)
Blasphemist! ;-)
Randal,
Just kidding. I *know* that there are some other languages that (gulp)
may be better under certain circumstances.
BUT, (there is always a big but), asking __this__ question in the
**PERL** newsgroup is probably the wrong place to get a subjective
opinion - from me at least :-)
I know that Perl pays my bills and I am a bit fanatical about it. Has
anyone noticed this yet?
Take care Randal - I hope to see you when you are in St. Louis!
Brent
--
Java? I've heard of it, it is what I drink while hacking Perl! -me
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
$ Brent Michalski $
$ -- Perl Evangelist -- $
$ E-Mail: perlguy@technologist.com $
$ Resume: http://www.inlink.com/~perlguy $
$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
------------------------------
Date: Sat, 14 Nov 1998 00:39:43 +0100
From: Adel BEN HAJ YEDDER <benhaj@eleves.enpc.fr>
Subject: Problem with sendmail in Perl
Message-Id: <364CC33F.2C030ACC@eleves.enpc.fr>
Hello,
I have a Perl program in wich the user can get a copy of the form by
mail. My
problem is that, when the e-mail adress given by the user is invalid, I
don't
receve any returned mail. Does anyone have a solution that allows me to
get
a retuned mail in this case, informing me that the e-mail adress is
invalid.
Thanks in advance.
Adel BEN HAJ YEDDER
benhaj@eleves.enpc.fr
------------------------------
Date: Fri, 13 Nov 1998 16:40:43 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Q: Frustrated! Converting Cisco config files to DNS entries
Message-Id: <MPG.10b6716312e71820989870@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and a copy mailed.]
In article <sarvhkjfgov.fsf@camel.fastserv.com> on 13 Nov 1998 16:04:00
-0500, Uri Guttman <uri@fastengines.com> says...
> >>>>> "KA" == Kathleen Applegate <kathleen@msfc.nasa.gov> writes:
...
> KA> tr/A-Z/a-z/; # translate to lower case
>
> just use this:
>
> lc ;
That has no effect. Surely you meant:
$_ = lc ;
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 13 Nov 1998 22:03:35 GMT
From: kathleen@msfc.nasa.gov (Kathleen Applegate)
Subject: Re: Q: Frustrated! Converting Cisco config files to DNS entries
Message-Id: <72iabn$jk9$1@hammer.msfc.nasa.gov>
In <sarvhkjfgov.fsf@camel.fastserv.com> Uri Guttman <uri@fastengines.com> writes:
>others have fixed the syntax bug but i will comment on your program in
>general. there are several areas that can be improved.
Thanks for taking the time to provide that feedback! I will try
to use everything you gave me.
As far as some variables not being used, that's because it's a
work in progress. The $interfaceType, $slot, and $port variables
will be used to construct the CNAME resource records in the db files.
The whole db files-writing section will be written this weekend.
Thanks again for your kind input.
--
----
Kathleen Applegate kathleen@montana.msfc.nasa.gov
NASA/Wang Government Services Tel. (256)544-7656
Marshall Space Flight Center Huntsville, AL 35812
------------------------------
Date: Fri, 13 Nov 1998 19:45:02 +0000
From: Marquis de Carvdawg <carvdawg@patriot.net>
Subject: Re: Raw Sockets
Message-Id: <364C8C3E.5BB0C52C@patriot.net>
Thanks for your advice...I'll take a look at it...
lordvorp@my-dejanews.com wrote:
> In article <364BCE2D.8E160172@patriot.net>,
> keydet89@yahoo.com wrote:
> > What you have provided is good, and I do appreciate your time,
> > but it is not at all what I am looking for...I am looking for "raw"
> > sockets.
> >
> > I need to be able to specify the header information...TCP flags, even
> > addresses (to check for source routing problems).
> >
> > What you have provided below for the client is the standard TCP connect()
> > code...I have already written port scanners, etc. What I need to do now
> > is craft my own packets.
>
> I suggest looking at &Net::Ping::ping_icmp for the right direction.
>
> Basically, you will have to manually construct, using pack(), a TCP packet.
> This will presumably require you learn the TCP guts enough to do this, but
> the function I've mentioned will be a great start (I'm planning to do this
> myself).
>
> L8r,
> L V
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 13 Nov 1998 23:41:59 GMT
From: science@home.com (Ian Underwood)
Subject: Regular expression for "B, except after A"?
Message-Id: <364cc0d6.72254748@news>
Is there some way, in a single expression, to match something except
when it's immediately preceded by something else? For example, if you
want to find the name "Bob" except if it follows the name "Jim"? So
it would match "Joe Bob" and "Nose Bob" but not "Jim Bob"?
I have to be able to do it in one shot, i.e.,
$str =~ s/$target/$replacement/;
It doesn't help if I have to do something like
if ( $str !~ m/$notTarget/ ) {
$str =~ s/$target/$replacement/;
}
I have the feeling that this should be straightforward, but I'm
somewhat new to Perl, so I could be mistaken about that.
------------------------------
Date: Fri, 13 Nov 1998 23:58:51 GMT
From: mcafee@waits.facilities.med.umich.edu (Sean McAfee)
Subject: Re: Regular expression for "B, except after A"?
Message-Id: <%I332.6543$fS.21625384@news.itd.umich.edu>
In article <364cc0d6.72254748@news>, Ian Underwood <science@home.com> wrote:
>Is there some way, in a single expression, to match something except
>when it's immediately preceded by something else?
Yes, it's called a "negative lookbehind assertion", and it's only available
in Perl 5.005 or later. See the perlre manpage.
>For example, if you
>want to find the name "Bob" except if it follows the name "Jim"? So
>it would match "Joe Bob" and "Nose Bob" but not "Jim Bob"?
print "Match!" if $str =~ /(?<!Jim) Bob/;
>I have to be able to do it in one shot, i.e.,
> $str =~ s/$target/$replacement/;
>It doesn't help if I have to do something like
> if ( $str !~ m/$notTarget/ ) {
> $str =~ s/$target/$replacement/;
> }
One way to do this in pre-5.005 Perl is this:
$str =~ s/((Jim)? Bob)/ length $2 ? $1 : $replacement /e;
--
Sean McAfee | GS d->-- s+++: a26 C++ US+++$ P+++ L++ E- W+ N++ |
| K w--- O? M V-- PS+ PE Y+ PGP?>++ t+() 5++ X+ R+ | mcafee@
| tv+ b++ DI++ D+ G e++>++++ h- r y+>++** | umich.edu
------------------------------
Date: Fri, 13 Nov 1998 23:26:51 GMT
From: supradave@earthlink.net
Subject: Sorting Question
Message-Id: <72if7r$237$1@nnrp1.dejanews.com>
I am trying to sort a file that is multiple line records and needs to be
sorted on a particular line. My data looks something like this and I want to
sort on last:
first=Barney
last=Rubble
phone=234-234-2345
first=Fred
last=Flintstone
phone=123-123-1234
etc.
I begin with opening a file and reading it into an array.
while(<T>) {
chop;
@list = split(/\n/);
}
@sorted = map $_->[0],
sort { $a->[1] <=> $b->[1] }
map { [ $_, /(\d+)/ ] } @list;
I then try to do the above and I'm not sure that I understand what is
happening there.
Then I do a foreach(@sorted){print;} and I get the last line.
I have been trying to find examples on the Usenet, but nothing I can find
referring to multiple line records.
Can I read 4 lines into the array at 1 time and then sort based on
@list[last]?
Thanks.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Fri, 13 Nov 1998 23:09:50 GMT
From: Scratchie <upsetter@ziplink.net>
Subject: Re: Year 2000 issues with localtime & gmtime
Message-Id: <2%232.376$fs.38313@news.shore.net>
Alan J. Flavell <flavell@mail.cern.ch> wrote:
: On Thu, 12 Nov 1998, Anthony Howe wrote:
:> localtime() returns a list where the year has had 1900 subtracted from
:> it.
:>
:> Will this be an issue come year 2000?
: It will still have 1900 subtracted from it. This is only a problem for
: people who have neither RTFM nor RTFFAQ.
In other words, yes, it will be an issue.
--Art
--
--------------------------------------------------------------------------
National Ska & Reggae Calendar
http://www.agitators.com/calendar/
--------------------------------------------------------------------------
------------------------------
Date: 12 Jul 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 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 4217
**************************************