[11207] in Perl-Users-Digest
Perl-Users Digest, Issue: 4807 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Feb 2 15:07:12 1999
Date: Tue, 2 Feb 99 12:00:20 -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 Tue, 2 Feb 1999 Volume: 8 Number: 4807
Today's topics:
"control-c" kills fork and script (I don't want this) <bruce.hartley@tivoli.com>
Re: advertising script problem <dgris@moiraine.dimensional.com>
Re: ancestry of perl features droby@copyright.com
Re: are regular expression rationaly designed ? <ebohlman@netcom.com>
Re: are regular expression rationaly designed ? (Ilya Zakharevich)
Re: beginner question <webmaster@macdaddyusa.com>
Re: Changing drives with ActiveState Perl on NT (Phil Tomson)
DBM/CGI problems mdorn@247media.com
flock not working <usenet-replies@rocketmail.com>
Re: Getting the wildcard value (brian d foy)
grep and a variable jimbob4334@my-dejanews.com
help: perl scripting on .org group <jnapier@bigfoot.com>
Re: help: perl scripting on .org group <ebohlman@netcom.com>
Re: newbie having trouble with concatination (Steve Linberg)
perform a su - [user] in perl <jehoughton@itd.ssb.com>
Re: Perl Crashes IIS4! (closed for now) <Richard.Walker@west-server.com>
perllocale <dperez@eurosur.org>
Problem executing a cgi counter. <stud0v64@nortel.com>
Re: Problem executing a cgi counter. <jeromeo@atrieva.com>
Re: Regex for e-mail addresses? (John Stanley)
Re: Regex for e-mail addresses? <jdf@pobox.com>
Re: Regex for e-mail addresses? <revjack@radix.net>
Re: Using Perl to parse input from a url <spike_YYwhiteYY@YYdellYY.com>
Re: Visual Perl? (Andrew Johnson)
web load testing code <ctbates@tva.gov>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 02 Feb 1999 13:57:56 -0600
From: Bruce Hartley - TPS Consultant <bruce.hartley@tivoli.com>
Subject: "control-c" kills fork and script (I don't want this)
Message-Id: <36B758C3.84574AF3@tivoli.com>
I have commands coming back with pages of data I am forking a process
and piping the data to "more -c". The operators want to press ctrl-c
when they have seen enough and the ctrl-c kills the fork and the script.
I have traps in place, but the script still gets killed. Does anyone
have any hints as to how I can get around this (besides writting on
there hands not to push ctrl-c and use "q" instead)
thanks,
Bruce
------------------------------
Date: 02 Feb 1999 12:07:05 -0700
From: Daniel Grisinger <dgris@moiraine.dimensional.com>
Subject: Re: advertising script problem
Message-Id: <m3soco39ra.fsf@moiraine.dimensional.com>
"myname@mydomain.com" <elst.fels@nospam.ping.be> writes:
> Yeah good answer, but that wasn't the question was it ?!
You asked a question that isn't related to perl on a perl newsgroup,
what did you expect?
> Don't be a smartass and let me try to figure this out OK ?
This sentence doesn't appear to have any communicative value. Perhaps
you'd like to rephrase it into something sensible.
> If I only wanted one banner I wouldn't have asked the freaking question !!!
Generally speaking, we aren't here to hand out complete applications
to just anyone who asks. I'll make an exception to get you to go
away, though. This isn't complete code, but it should get you going
in the right direction. This returns banner0 50% of the time, banner1
30% of the time, and banner2 and banner3 10% of the time each.
$banner{$_} = 'banner0.gif' for 0..4;
$banner{$_} = 'banner1.gif' for 5..7;
$banner{$_} = 'banner2.gif' for 8;
$banner{$_} = 'banner3.gif' for 9;
my $random_banner = $banner {int(rand(scalar keys %banner))};
dgris
--
Daniel Grisinger dgris@moiraine.dimensional.com
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'
------------------------------
Date: Tue, 02 Feb 1999 19:22:02 GMT
From: droby@copyright.com
Subject: Re: ancestry of perl features
Message-Id: <797j8e$kdu$1@nnrp1.dejanews.com>
In article <01be4dfd$29034f60$12322389@Joel.monsanto.com>,
"Joel Finkle" <jjfink@searle.monsanto.com> wrote:
>
>
> Larry Rosler <lr@hpl.hp.com> wrote in article
> <MPG.111027517359d2ef9899b2@nntp.hpl.hp.com>...
> > In article <393e5531xn.fsf@ibnets.com> on 20 Jan 1999 19:27:32 -0500,
> > Uri Guttman <uri@ibnets.com> says...
> > >
> > > i have been pondering perl's ancestry and for curiosity's sake i have
> > > been thinking about which languages (if any) influenced various perl
> > > feature.
> ...
> > > statement modifiers perl?
> >
> > I believe Snobol, but it's been SOOOO long!
>
> Various flavors of BASIC have used statement modifiers for many years,
> especially those created by Digital (DEC).
>
I think Snobol's probably older than Basic. It might be older than Digital.
However, I don't think it had anything resembling Perl's statement modifiers.
In fact, it didn't have IF/THEN, WHILE, FOR, .... Lots of GOTOs.
It did however have a builtin EVAL().
--
Don Roby
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 2 Feb 1999 18:50:28 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: are regular expression rationaly designed ?
Message-Id: <ebohlmanF6JJ04.HE9@netcom.com>
olivier_pelletier@my-dejanews.com wrote:
: I would like to know if there is a theory hidden behind regular expression
: matching ?
Yes, the theory of finite automata.
: Could anyone point me out a link to a document explaining this
: theory if it exists ?
Search for things like "automata theory," "finite-state-machines" and
"regular-expression matching algorithms." Any book on compiler theory
should also talk about regex matching algorithms, and many books on
algorithms (e.g. Sedgewick) also do.
: In particular can any pattern be matched by a regular
: expression ?
No. This is a fundamental result of automata theory. There is a
hierarchy of formal languages (i.e. the languages at each level form a
subset of those at the next higher level), each of which corresponds to a
certain kind of abstract machine that can decide whether or not a string
belongs to the language.
Regular expressions are capable of describing regular languages
(recognizable by finite-state automata), which are a subset of
context-free languages (recognizable by push-down automata), which are a
subset of context-sensitive languages (recognizable, I think, by linear
bounded automata), which in turn are a subset of phrase-structure
languages (recognizable by Turing machines). The hierarchy was first
elaborated by the linguist Noam Chomsky.
Probably the simplest example of a pattern that cannot be recognized by a
regular expression is that of a string consisting of an arbitrary number
of balanced parentheses (if you specify a specific maximum nesting depth,
you can write an extremely ugly regexp to recognize it, but it will fail
beyond that level). Such a string is, however, a member of a context-free
language and can be recognized by a simple parser. Colloquially, we say
that "finite automata can't count." Augmenting a finite automaton with a
stack (which in the case of parentheses can be simulated by a counter)
enables it to recognize general context-free languages.
However, some patterns cannot be described by a context-free language.
One such pattern is "a sequence of alphanumeric characters followed by a
left parenthesis, zero or more sequences of alphanumerics separated by
commas, a right parenthesis, some arbitrary text, the same initial
sequence followed by a parenthesis followed by the same number of
comma-separated sequences followed by a right parenthesis" which is an
abstraction of the common compiler task of verifying that a function is
called with the same number of parameters it's declared with. Since most
programming languages have context-free grammars (Perl being one that
doesn't), parameter-count checking is normally handled by ad-hoc routines
in the semantic analysis part of a compiler rather than in syntax analyzer.
The field is a fascinating one.
P.S. Perl's regular expressions are capable of recognizing strings in
some non-regular languages because they allow backreferencing. However,
they cannot match context-free languages in general, even though they
*can* match some patterns in context-sensitive languages.
------------------------------
Date: 2 Feb 1999 19:20:02 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: are regular expression rationaly designed ?
Message-Id: <797j52$6uc$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Eric Bohlman
<ebohlman@netcom.com>],
who wrote in article <ebohlmanF6JJ04.HE9@netcom.com>:
> olivier_pelletier@my-dejanews.com wrote:
> : I would like to know if there is a theory hidden behind regular expression
> : matching ?
>
> Yes, the theory of finite automata.
Which has practically nothing to do with *Perl* regular expressions.
> : In particular can any pattern be matched by a regular
> : expression ?
>
> No. This is a fundamental result of automata theory. There is a
> hierarchy of formal languages (i.e. the languages at each level form a
> subset of those at the next higher level), each of which corresponds to a
> certain kind of abstract machine that can decide whether or not a string
> belongs to the language.
Since Perl's RExen can do anything now (well, between 5.005 and
5.005_53 they could do *many* things), if the pattern is decidable,
they can do it. They cannot recognize a correct C program which loops
forever. ;-)
Ilya
------------------------------
Date: Tue, 02 Feb 1999 09:46:12 -0800
From: dan <webmaster@macdaddyusa.com>
Subject: Re: beginner question
Message-Id: <36B739E4.4D7F7614@macdaddyusa.com>
i must say thanks for your amazing, intuitive input. youve managed to waste all
of our time. thanks a lot!
Sam Holden wrote:
> On Thu, 28 Jan 1999 20:24:43 -0800, dan <nospam-seallama@mailcity.com> wrote:
> >lets say a user inputs number in a form. how do i get the cgi script to
> >make the length of the image the number the user put in? thanks
>
> The same way you would in any other language.
>
> A perl question would help?
> Some code that doesn't quote work would help?
> Actually learning some perl would be good too...
>
> --
> Sam
>
> Simple rule: include files should never include include files.
> --Rob Pike
------------------------------
Date: 2 Feb 1999 10:54:18 -0800
From: ptkwt@user2.teleport.com (Phil Tomson)
Subject: Re: Changing drives with ActiveState Perl on NT
Message-Id: <797hkq$cv5$1@user2.teleport.com>
In article <03usUKwS#GA.249@pet.hiwaay.net>,
Rob Lemley <RobLemley@nospam.com> wrote:
>Phil Tomson wrote in message <78qem9$lbc$1@user1.teleport.com>...
>...
>>chdir('F:\somedir') won't work if I'm running the script on drive c: - the
>>working directory is still going to be the one I'm in on drive c:. I
>...
>
>Perl 5 ActivePerl binary build 507, WinNT 4.0, ServicePack 3:
>
>system('cd');
>chdir 'c:\temp';
>system('cd');
>print "$_\n" while(<*>);
>
>
This doesn't do what we want it to....
>You could be hitting NT permission problems,
>which is very common. Or, maybe your
>syntax is different than the text in your
>message. A little sample script would help!
>
To reiterate the problem (and add some info): We're starting a perl script
on drive C: (for example) and at some later time we want to move the
current working directory to a networked drive, drive F:, for example, and
perform some operations there.
So, let's say I started this little script running at C:\temp and later on
I want the current working directory to be at F:\somedir (It has to be
this way since we're actually running another perl script on a Sun which
is monitoring what is going on in /usr/home/somedir [mapped to F: on the
PC] in case the PC bluescreens ( BSODs, dies ) - that's a very simplified
explanation). The problem is I can't issue something like:
system("cd F:\somedir");
or
chdir("F:\somedir");
because all that does is change the current directory of drive F:, my
current working directory in the context of the perl script is still
C:\temp.
Now, if I issue the command:
chdir("C:\temp\somedir");
That will work since C is the drive I started out on.
Like I said before, this isn't a problem on Unix since drives and
directories all look the same - how does one deal with this on the PC?
(OK, I know, run Linux - how does one deal with this on a PC running
Windows?)
Phil
--
Phil Tomson
FreeHDL Project
http://www.freehdl.seul.org/
------------------------------
Date: Tue, 02 Feb 1999 18:32:19 GMT
From: mdorn@247media.com
Subject: DBM/CGI problems
Message-Id: <797gbj$hkp$1@nnrp1.dejanews.com>
I'm having a very curious problem with the following code:
---------------------------------------- #!/usr/local/bin/perl5 -w
$db="../247data/acemail.db"; dbmopen %emails, $db, 0666 or die "Can't
open acemail.db: $!\n"; print "Content-type: text/html\n\n"; print
"<html><head><title>HELP!!!</title></head><body>"; foreach $k (sort keys
%emails) { print "$k $emails{$k}<br>\n"; } dbmclose %emails; print
"</body></html>\n"; ---------------------------------------------- When I run
this script in the shell, it runs properly with the following output:
-----------------------------------
Content-type: text/html
<html><head><title>HELP!!!</title></head><body>chicago x@blank.org<br>
san francisco xyz@sf.com<br>
</body></html>
------------------------------------
But when I try to run it in my Web browser, the HTML sent to the browser is as
follows:
---------------------
<html><head><title>HELP!!!</title></head><body></body></html>
---------------------
It totally omits the info from the database. Read/write permissions are set
the same for everybody.
Anybody know what might be the trouble?
Matt Dorn
mdorn@247media.com
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 02 Feb 1999 12:07:56 -0500
From: Debbie Whitten <usenet-replies@rocketmail.com>
Subject: flock not working
Message-Id: <36B730EC.37909F1@rocketmail.com>
I've read the book, and I am trying to implement flock. Why can't I
understand this? Am I missing something? Here is the script I wrote to
test flock'ing. I am trying to get an exclusive lock on a file. I run
the script and the file is supposed to stay locked until I type a u.
While the file is locked, I run the script a 2nd time. I expect the 2nd
script to wait - the file should be locked. But it does not wait - it
goes ahead and 'locks' the file in exclusive mode. Shouldn't this be
impossible?
#!/usr/local/bin/perl -w
use FileHandle;
$| = 1;
$LOCK_SH = 1;
$LOCK_EX = 2;
$LOCK_NB = 3;
$LOCK_UN = 4;
open FH, ">> test.txt";
FH->autoflush(1);
print "Locking file.";
while (($x = flock ("test.txt", $LOCK_EX))) { # supposedly wait
print "flock returned $x, $!\n"; # if the file is
locked.
flock (FH, $LOCK_UN);
print ".";
sleep 1;
}
print "Flock returned $x.\n";
print "\n";
print "Enter u to unlock: ";
while (<STDIN> !~ /^u/) {
print "$$ writing to file.";
print FH "$$\n";
print "Enter u to unlock: ";
}
flock (FH, $LOCK_UN);
close FH;
------------------------------
Date: Tue, 02 Feb 1999 10:04:58 -0500
From: comdog@computerdog.com (brian d foy)
Subject: Re: Getting the wildcard value
Message-Id: <comdog-ya02408000R0202991004580001@news.panix.com>
In article <36B70D06.FC56F44@watson.ibm.com>, Rick Holt <holt@watson.ibm.com> posted:
> I am attempting to extract the data from a line of HTML
> using perl. For example, given the line:
>
> <meta name="Author" content="Rick Holt">
the module HTML::HeadParser is a godsend. thanks Gisle!
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
------------------------------
Date: Tue, 02 Feb 1999 19:28:47 GMT
From: jimbob4334@my-dejanews.com
Subject: grep and a variable
Message-Id: <797jl2$ks6$1@nnrp1.dejanews.com>
Can someone tell me how to use
grep on the following?
@date - is an array with many dates including 1-12-98
$var="1-12-98";
@match = grep(/\Q$var\E/, @date);
$no_of_mathces = $#match;
I get $no_of_matches = -1
TIA,
Jim
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 02 Feb 1999 18:31:40 GMT
From: "John Napier" <jnapier@bigfoot.com>
Subject: help: perl scripting on .org group
Message-Id: <01be4eda$5cb5adc0$f7eb7ece@jnapier.xsite.net>
I am the webmaster (clueless newbie) on the www.openview.org site.
I am looking for help in developing the site and am looking for a Perl
programmer to help me with some short routines. The script would capture
the visitors time,date,domain,IP and email.
I realize that the email is the difficult one but we are looking to capture
more than generic information.
This is a .org site and does not sell or make a profit. All I am able to
provide in return is references and a link. The site get 150 users per day
from businesses across the world.
John Napier
www.openview.org
------------------------------
Date: Tue, 2 Feb 1999 18:56:45 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: help: perl scripting on .org group
Message-Id: <ebohlmanF6JJAL.Hvu@netcom.com>
John Napier <jnapier@bigfoot.com> wrote:
: I am the webmaster (clueless newbie) on the www.openview.org site.
: I am looking for help in developing the site and am looking for a Perl
: programmer to help me with some short routines. The script would capture
: the visitors time,date,domain,IP and email.
: I realize that the email is the difficult one but we are looking to capture
: more than generic information.
s/difficult/impossible/
The only way you can get a visitor's e-mail address, in Perl or
otherwise, is to have the user supply it as part of a form submission and
to trust it to be correct. Period. The information is simply not
transmitted as a default part of an HTTP transaction. Period. Even if
it were, you'd have no guarantee that the value was correct. Period.
------------------------------
Date: Tue, 02 Feb 1999 14:12:55 -0500
From: linberg@literacy.upenn.edu (Steve Linberg)
Subject: Re: newbie having trouble with concatination
Message-Id: <linberg-0202991412550001@ltl1.literacy.upenn.edu>
In article <36B70CF4.3AB3@ee.surrey.ac.uk>, Gavin Ian Andrew Kenny
<eem3gk@ee.surrey.ac.uk> wrote:
> $line =~ /\s*(\S+.*)$/; # this gets rid of tab at the start and \n
> at # the end
That will get rid of whitespace at the start of the string, but not the
end. Your .* matches everything to the end of the string.
Look into chomp() if you want to kill end-of-line newlines. Or do
something like this:
$line =~ s/\s*(.*?)\s*$/$1/;
--
Steve Linberg, Systems Programmer &c.
National Center on Adult Literacy, University of Pennsylvania
email: <linberg@literacy.upenn.edu>
WWW: <http://www.literacyonline.org>
------------------------------
Date: Tue, 02 Feb 1999 13:18:19 -0500
From: Jack Houghton <jehoughton@itd.ssb.com>
Subject: perform a su - [user] in perl
Message-Id: <36B74169.21C1BD9E@itd.ssb.com>
I have a perl script that is run as root. In this script I need to su to
another user and stay as that user until the script completes. I
basically do not want create any files owned by root. One soolution
would be to run the script with su - [user] but that is not possible.
This script is invoked by a parent process. I have looked at the
dotsh.pl routine but this offers no more assistance. If I use system()
the program simply changes to the user in the shell and closes the
shell. This does me no good.
Please Help!
Jack Houghton
------------------------------
Date: Tue, 02 Feb 1999 13:15:46 -0500
From: Richard Walker <Richard.Walker@west-server.com>
Subject: Re: Perl Crashes IIS4! (closed for now)
Message-Id: <36B740D2.CA668591@west-server.com>
This is the word from someone at ActivePerl who took a serious look at
this problem:
<quote>
At 2/1/99 10:06 PM, Richard Walker wrote:
>Now it is a ZIP file.
Thanks,
This will be fixed in the next build of ActivePerl.
</quote>
So I guess it ISN'T a "bug", nor is it a "feature", of IIS4. We shall
have to wait for build 510 of ActivePerl.
Richard Walker wrote:
>
> Any assistance or tips appreciated.
>
> Every time I run a PerlScript in ASP that uses IO::Sockets, it executes,
> then promptly shuts my IIS4 server down. Following are some details:
>
> -- Entry created in the Event Viewer/Application Log: --
> An object call caused an exception. (IID:
> {51372AEF-CAE7-11CF-BE81-00AA00A2FA25}) (Method: 3) (Microsoft
> Transaction Server Internals Information: File:
> d:\viper\src\runtime\mtxex\activity.cpp, Line: 886)
> -- --
>
> -- Operating System --
> Windows NT 4.0 SP3 (workstation/server, same problem)
> IIS4.0
> ActiveState Perl build 509
> -- --
>
> -- One suspect script, though others have same problem --
> <script language="perlscript" runat="server">
> use IO::Socket;
>
> sub ErrorReport(){
> $Response->Write("Cannot connect!");
> $Response->end;
> }
>
> sub whois {
> my ($domain, $server) = @_;
> my $returnString="";
>
> my $remote=new IO::Socket::INET(
> Proto => "tcp",
> PeerAddr => "$server",
> PeerPort => "whois(43)",
> ) or die ErrorReport;
>
> $remote->autoflush(1);
> print $remote "$domain\n" . $BLANK;
> while ( <$remote> ) {
> $returnString.=$_;
> }
> close $remote;
> return $returnString;
> }
>
> </script>
> -- --
>
> Again, any help appreciated.
>
> --
> What is time? If no one asks me, I know; if I wish
> to explain to one who asks, I do not know.
> -- St. Augustine
--
What is time? If no one asks me, I know; if I wish
to explain to one who asks, I do not know.
-- St. Augustine
Feel Lost In Email? Get Answers Quick On The HOT ASP Discussion Forum
--> http://www.aspalliance.com/richardwalker/forum/ <--
------------------------------
Date: 2 Feb 1999 18:59:27 GMT
From: "David Pirez Gil" <dperez@eurosur.org>
Subject: perllocale
Message-Id: <01be4edf$0b915520$043f35c3@davidper>
I4ve installed "GNU gettext" and Perl module "Locale::gettext", but
I can4t make it work!
I4ve written the following test script (test.pl):
#! /usr/local/bin/perl
use locale;
use POSIX;
use Locale::gettext;
setlocale (LC_MESSAGES, "de");
print dcgettext("test", "Wellcome to my program", LC_MESSAGES), "\n";
------------------------------------------------------------------
My test.po file looks like this:
domain "test"
msgid "Wellcome to my program"
msgstr "Willkommen in mein program"
I4ve built my test.mo file running the following command:
msgfmt test.po -o test.mo -v
I4ve copied the test.mo file to /usr/local/share/de/LC_MESSAGES
I4ve been checking my system and I have the following locale
settings:
The locale information is stored under /usr/share/locale
I have a directory called de_DE and one called de (plus other directories
for other languages).
/usr/share/locale/de_DE contains:
LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC, LC_TIME,
man_db.cat files and a subdirectory (LC_MESSAGES) which contains a file:
SYS_LC_MESSAGES.
/usr/share/locale/de contains a subdirectory (LC_MESSAGES) with the
following
files: fileutils.mo, sh-utils.mo, sharutils.mo and textutils.mo.
I4ve copied everything under /usr/share/locale/de_DE to
/usr/share/locale/de as "de" is
the notation I4ll be using.
I4ve also created a libc.cat file under /usr/share/locale/de.
When I run:
export LC_MESSAGES=de
prueba.pl
everything goes OK, but if I only run
prueba.pl
the message doesn4t get translated (even though setlocale sets LC_MESSAGES
to "de")
I4d really appreciate any help you could offer!
Thank you,
David e-mail:dperez@eurosur.org
------------------------------
Date: Tue, 02 Feb 1999 13:51:03 -0500
From: "Michalowski, Martin" <stud0v64@nortel.com>
Subject: Problem executing a cgi counter.
Message-Id: <36B74917.B2C8EBB0@nortel.com>
Hi, I'm having a problem with my new server. I've been using perl
counter application Version 4.0.7 and it worked fine on my old server.
Seems like my new server doesn't even execute the <!--#exec ... >
command.
I'm using the exact same format as I did on the old server so I know
that the above exec line is correct. However, it doesn't do anything and
I don't know who else to ask. Could it be that the server doesn't
recognize the comment as a command? How can I change that?
thanks
--
------------------------------
Date: Tue, 02 Feb 1999 11:32:21 -0800
From: Jerome O'Neil <jeromeo@atrieva.com>
To: martin007@ottawa.com
Subject: Re: Problem executing a cgi counter.
Message-Id: <36B752C5.3C4D170B@atrieva.com>
Michalowski, Martin wrote:
> I'm using the exact same format as I did on the old server so I know
> that the above exec line is correct. However, it doesn't do anything and
> I don't know who else to ask. Could it be that the server doesn't
> recognize the comment as a command?
That would be exactly what it is.
> How can I change that?
Review the documentation for your server. Or ask in one of the many
newsgroups associated with web servers, and server configurations.
Good Luck!
--
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947
The Atrieva Service: Safe and Easy Online Backup http://www.atrieva.com
------------------------------
Date: 2 Feb 1999 19:14:13 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Regex for e-mail addresses?
Message-Id: <797iq5$jo1$1@news.NERO.NET>
Keywords: Hexapodia as the key insight
In article <7972n5$4ac$1@news1.Radix.Net>,
Ed Hitler <revjack@radix.net> wrote:
>Is there a single perl regular expression that will allow me to extract the
>e-mail addresses from the following header lines?
The following lines contain no email address, at least not in the
Internet syntax as required by RFC 1036:
>From: Joe (joe@blow.com)
>From: Joe Blow (joe@blow.com)
>From: (joe@blow.com)
>From: Joe "Remove the DotFrom: joe@blow.com-nospam
If your regex tells you there is a valid address there, it's wrong.
------------------------------
Date: 02 Feb 1999 16:21:52 +0100
From: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: Regex for e-mail addresses?
Message-Id: <m3vhhkygof.fsf@joshua.panix.com>
Ed Hitler <revjack@radix.net> writes:
^^^^^^
Wow, the thread's over before it really began.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: 2 Feb 1999 19:30:38 GMT
From: Ed Hitler <revjack@radix.net>
Subject: Re: Regex for e-mail addresses?
Message-Id: <797jou$64e$1@news1.Radix.Net>
Keywords: Hexapodia as the key insight
John Stanley explains it all:
:In article <7972n5$4ac$1@news1.Radix.Net>,
:Ed Hitler <revjack@radix.net> wrote:
:>Is there a single perl regular expression that will allow me to extract the
:>e-mail addresses from the following header lines?
:The following lines contain no email address, at least not in the
:Internet syntax as required by RFC 1036:
:>From: Joe (joe@blow.com)
:>From: Joe Blow (joe@blow.com)
:>From: (joe@blow.com)
:>From: Joe "Remove the DotFrom: joe@blow.com-nospam
:If your regex tells you there is a valid address there, it's wrong.
Interesting answers, all.
Let me rephrase the question.
Using News::NNTPClient, I extract all the heads of all the articles in
comp.lang.perl.misc.
>From that, I extract all the /^From: / lines.
Now I have a list that looks like this:
From: Mark Hamlin <mark.c.hamlin@bt.com>
From: richm@ucesucks.rochester.rr.com (Rich)
From: Douglas Nichols <dnichols@fhcrc.org>
From: Kent Perrier <kperrier@blkbox.com>
From: Mark Hamlin <mark.c.hamlin@bt.com>
From: Kent Perrier <kperrier@blkbox.com>
From: "sysadmin" <charlesjourdan@worldnet.att.net>
From: droby@copyright.com
From: Jessica Sockel <jsockel@drew.edu>
From: Jerome O'Neil <jeromeo@atrieva.com>
From: Kruman <#kruman#@radix.net>
From: Richard Nilsson <qdtrini@jdicms88.ericsson.se>
From: "DaveH" <DaveH@nnoossppaamm.acinom.com>
I am looking for a perl regex that will turn the above list into this:
mark.c.hamlin@bt.com
richm@ucesucks.rochester.rr.com
dnichols@fhcrc.org
kperrier@blkbox.com
mark.c.hamlin@bt.com
kperrier@blkbox.com
charlesjourdan@worldnet.att.net
droby@copyright.com
jsockel@drew.edu
jeromeo@atrieva.com
qdtrini@jdicms88.ericsson.se
DaveH@nnoossppaamm.acinom.com
What I'm after is, "the stuff on either side of the @ sign, but not
brackets or parentheses".
The two regex lines I use work. I was just wondering if there was a more
succinct or elegant way to do it.
Thanks for the responses so far.
--
/~\ curt hecatomb integrable inherent mantle stooge inexperience la
C oo lopseed proteolysis anorthosite Cambridge burgess Lipscomb gene
_( ^) 1 , 0 0 0 , 0 0 0 m o n k e y s c a n ' t b e w r o n g
/___~\ http://3509641275/~revjack 02/02/99 14:26:35 revjack@radix.net
------------------------------
Date: Tue, 2 Feb 1999 12:07:44 -0600
From: "Spike White" <spike_YYwhiteYY@YYdellYY.com>
Subject: Re: Using Perl to parse input from a url
Message-Id: <797e95$5ua$1@obsidian.us.dell.com>
Here's one way that works if your company uses a HTTP proxy server. This
is a snippet from a "get stock quote" perl script posted a few weeks ago.
use IO::Socket;
my $proxy='proxy.your.company.com';
my $proxyport=80;
$sock = new IO::Socket::INET (PeerAddr => $proxy,
PeerPort => $proxyport,
Proto => 'tcp',
);
die "Socket could not be created. Reason $!\n" unless $sock;
# the following line is spilt in 2 parts to fit 80 columns
$getcmd="http://quote.yahoo.com/download/quotes.csv?";
$getcmd=$getcmd . "symbols=$SymbolStr&format=sl1d1t1c1ohgv&ext=.csv";
# send the cmd to the proxy
print $sock "GET $getcmd\r\n";
#retrieve the stock info
@info=<$sock>;
Then parse each line of @info in the usual way.
Spike
marc1859@my-dejanews.com wrote in message
<795vgp$6mo$1@nnrp1.dejanews.com>...
>I would like to write a small PERL routine that downloads a url and scans
it
>for a specific string. For example, I might want to download a weather
>webpage and extract the temperature to place in a separate variable. How do
I
>read a url and down load it into variables to parse?
------------------------------
Date: Tue, 02 Feb 1999 18:49:21 GMT
From: andrew-johnson@home.com (Andrew Johnson)
Subject: Re: Visual Perl?
Message-Id: <RMHt2.1965$O5.13335@news.rdc1.on.wave.home.com>
In article <HOst2.69$wk3.6331@nsw.nnrp.telstra.net>,
Martien Verbruggen <mgjv@comdyn.com.au> wrote:
! In article <36B632CD.2CEF@lubypublishing.com>,
! Sven Davies <svend@lubypublishing.com> writes:
!
! > Yeah, this reminds me of a popular program called GirlFriend 1.0. It
! > doesn't always know what you want either. But then again, I don't think
! > it is a Perl Script.
!
! I upgraded mine to Wife 1.0. Works a lot better :)
I did that quite a while ago, but it turns out it not only did it not
know what I wanted any more than any previous GirlFriend version,
but it doesn't seem to know what it wants either--- inputs that work
fine for a while suddenly leave me confronted with the 'Blue Scream of
Death', all the more so when spawning a Child process. I attempted
to develop a Wife.pm module to try to provide a stable interface, but
found that there were too many special cases which proved too
unpredictable --- the only semi-reliable solution was a special case
module, Wife.pms, that itself merely calls 'supply_chocolate('Crispy
Crunch Bar') in an endless loop...but this has drawbacks as well. :-)
regards
andrew
--
Andrew L Johnson (Raven*Tec Solutions)
<andrew-johnson@home.com>
263 Knightsbridge Dr. "They're not soaking...they're rusting!"
Winnipeg, MB R2M 4K5 --my wife, on my dishwashing habits.
------------------------------
Date: Tue, 02 Feb 1999 13:30:16 -0500
From: Tom Bates <ctbates@tva.gov>
Subject: web load testing code
Message-Id: <36B74438.B097086F@tva.gov>
Is anyone aware of any published perl code or modules out there for load
testing a web server?
Thanks,
Tom
------------------------------
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 4807
**************************************