[25403] in Perl-Users-Digest
Perl-Users Digest, Issue: 7648 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jan 14 11:05:58 2005
Date: Fri, 14 Jan 2005 08:05:25 -0800 (PST)
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, 14 Jan 2005 Volume: 10 Number: 7648
Today's topics:
Re: [perl-python] 20050113 looking up syntax <peter@engcorp.com>
Re: Adding a delimiter inbetween number characters and <bik.mido@tiscalinet.it>
Re: Adding a delimiter inbetween number characters and <bik.mido@tiscalinet.it>
Re: Adding a delimiter inbetween number characters and <news@chaos-net.de>
Re: Adding a delimiter inbetween number characters and <bik.mido@tiscalinet.it>
Re: Adding a delimiter inbetween number characters and <bik.mido@tiscalinet.it>
Re: another 'POST from perl' question <jcdoerr@verizon.net>
Re: comp.lang.perl.misc & gmane.org <bik.mido@tiscalinet.it>
Re: convention regarding lexical filehandles <bik.mido@tiscalinet.it>
Re: daemonizing a process AND capture stdout, stderr <bik.mido@tiscalinet.it>
Re: daemonizing a process AND capture stdout, stderr <gyruss@hushmail.com>
Re: disk space script <tadmc@augustmail.com>
Re: disk space script <jgarretthood@gmail.com>
Re: disk space script <mritty@gmail.com>
Re: disk space script <do-not-use@invalid.net>
Re: eliminating empty elements of a list <zen13097@zen.co.uk>
Except script error <geen@mail.invalid>
Re: Except script error <noelt.dolan@virgin.net>
Re: Except script error <geen@mail.invalid>
Re: Formmail Question <deepiceman@yahoo.com>
Re: Log File parser <bik.mido@tiscalinet.it>
Re: Log File parser <bik.mido@tiscalinet.it>
Re: Log File parser <jgarretthood@gmail.com>
Re: Log File parser <jgarretthood@gmail.com>
Re: Loop through a text file line by line <bik.mido@tiscalinet.it>
Re: portable no warnings "uninitialized" <uffesterner@spamhole.com>
Re: Print question <bik.mido@tiscalinet.it>
Re: Print question <bik.mido@tiscalinet.it>
Re: Regular expression lookahead question <tadmc@augustmail.com>
Re: Regular expression lookahead question <do-not-use@invalid.net>
Re: Regular expression lookahead question <phaylon@dunkelheit.at>
Re: sql script will net <2005-01@spam.verbrennung.org>
Re: Unix-format text from STDOUT under Windows (AcitveP <shawn.corey@sympatico.ca>
Re: Unix-format text from STDOUT under Windows (AcitveP <mjcarman@mchsi.com>
Re: Works great! <bik.mido@tiscalinet.it>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 14 Jan 2005 07:54:02 -0500
From: Peter Hansen <peter@engcorp.com>
Subject: Re: [perl-python] 20050113 looking up syntax
Message-Id: <EfGdnZgK0535XHrcRVn-vQ@powergate.ca>
Xah Lee wrote:
[snip]
> Note: this post is from the Perl-Python a-day mailing list at
> http://groups.yahoo.com/group/perl-python/
> to subscribe, send an email to perl-python-subscribe@yahoogroups.com
So why duplicate the posts by posting them to the newsgroups?
Now that you've advertised the mailing list (and thank you,
I'll be sure to hurry off now and subscribe) there's no longer
any reason to post to the newsgroups, is there? Please?
-Peter
------------------------------
Date: Fri, 14 Jan 2005 12:21:08 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Adding a delimiter inbetween number characters and letter characters
Message-Id: <k09fu0hi7tfpg6t60ushmtempset29rh8m@4ax.com>
On 14 Jan 2005 00:24:40 GMT, Martin Kissner <news@chaos-net.de> wrote:
>>> 5 my $lastline="";
>>> 6 my @lastline;
[snip code]
>> Do you _really_ need this $lastline algorithmic madness?
>
>Good question. What do you think of that solution?
^^^^
^^^^
Of _that_ solution or...
>#!/usr/bin/perl
>
>use warnings;
>use strict;
>
> local $/;
> my $content = <DATA>;
> $content =~ s/\n\D//g;
> $content =~ s/(^\d+|\n\d)/$1-/g;
> print $content;
>
>__DATA__
...of _this_ solution?
Whatever, IIRC the OP just wanted to put in a delimiter between a
number of an arbitrary length at the beginning of each line and
whatever follows. Then I'd just do:
perl -pi -e 's/^(\d+)/$1-/' file1 file2...
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Fri, 14 Jan 2005 12:21:10 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Adding a delimiter inbetween number characters and letter characters
Message-Id: <kb9fu09in3nr0iqs525h5tm2o3s5uinogl@4ax.com>
On 14 Jan 2005 06:36:15 GMT, Martin Kissner <news@chaos-net.de> wrote:
>> [...] Unless you _know_ that you need & for a specific reason, you are
>> better off not using it. Simple rule, really.
>
>I will keep that in mind.
>My Perl book (which is not the best one) mentioned only the &foo call.
Probably it may have been a good one when it was written, but chances
are that in the meantime it became too old... (wild guess: it may well
be that it's never been "the best one", whatever this may mean, in the
first place!)
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: 14 Jan 2005 11:42:14 GMT
From: Martin Kissner <news@chaos-net.de>
Subject: Re: Adding a delimiter inbetween number characters and letter characters
Message-Id: <slrncufc0m.2ui.news@maki.homeunix.net>
Michele Dondi wrote :
> On 14 Jan 2005 00:24:40 GMT, Martin Kissner <news@chaos-net.de> wrote:
>
>
> Whatever, IIRC the OP just wanted to put in a delimiter between a
> number of an arbitrary length at the beginning of each line and
> whatever follows. Then I'd just do:
>
> perl -pi -e 's/^(\d+)/$1-/' file1 file2...
He also wants to join lines with no numbers at the beginning with the
preceding line.
--
Epur Si Muove (Gallileo Gallilei)
------------------------------
Date: Fri, 14 Jan 2005 16:59:35 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Adding a delimiter inbetween number characters and letter characters
Message-Id: <upifu0do7bit12oa8bgihlctshboi3ogdn@4ax.com>
On 14 Jan 2005 10:43:23 +0100, Arndt Jonasson <do-not-use@invalid.net>
wrote:
>> So there are two possibilities: (i) you don't know Perl, and you don't
>> want to, and claim so; so you're asking una tantum: so far so fine!
>
>Thank you for letting me learn an expression I hadn't encountered before.
>I found it explained on
>http://www.eurofound.eu.int/emire/ITALY/UNATANTUM-IT.html.
>(I wonder what its etymology is - "una" is feminine, and "tantum" looks
>like Latin neuter or masculine accusative.)
"Una" is an adverb and it means (either "in the same place" or) "at
the same time".
"Tantum" is an adverb as well and it means (either "so much" or)
"only".
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Fri, 14 Jan 2005 16:59:37 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Adding a delimiter inbetween number characters and letter characters
Message-Id: <h0jfu0hqtspch6os08q934i120vj4mgqg6@4ax.com>
On Thu, 13 Jan 2005 16:04:22 -0500, Sherm Pendley
<spamtrap@dot-app.org> wrote:
>> There's hardly any need IMHO to include line numbers. To be fair,
>> personally I find them to be disturbing...
>
>10 PRINT "Having BASIC flashbacks, Michele? :-)"
>20 GOTO 10
Nice one!
But no, I really didn't. Actually I had an encounter with BASIC, but
it was much later than one could expect: at that time I had already
had some programming experience with Pascal and C. Maybe it was even
more traumatic then!!
It was in my first university year, and we had to take this
"programming lab"... in GWBASIC (IIRC) under 8088's!!!!
I remember the first lesson:
- Now I'll teach you how to turn on PCs!
- But we know how to do it, you just press a button!
- No guys, 8088's do _not_ have a swithc on button...
[...]
- Can we have a copy of the interpreter so to use it at home?
- No guys, it's not sw, it's hw: it's on the motherboard!
(Incidentally there was actually a sw version that I personally used
to a great advantage for I could at least type the program with a real
editor - I remember I used qedit under DOS at that time...)
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Fri, 14 Jan 2005 14:11:25 GMT
From: JD <jcdoerr@verizon.net>
Subject: Re: another 'POST from perl' question
Message-Id: <hqQFd.1$Os6.0@trnddc08>
Thanks for replying.
Sherm Pendley wrote:
> Hmmm... your script seems incomplete, so I'm assuming it begins with the
> usual:
>
> #!/usr/bin/perl
> use strict;
> use warnings;
Sure, I have that, I posted just a snippet. My script runs, it just
appears to not successfully submit data.
>> my $ua = LWP::UserAgent->new;
>> my $submit_str = "x_login=$acct_id&x_tran_key=$tran_key";
>> my $request = new HTTP::Request 'POST', $transaction_server;
>> $request->content_type('application/x-www-form-urlencoded');
>> $request->content($submit_str);
>> my $response = $ua->request($request);
>
> That looks pretty convoluted. Any particular reason you're creating the
> HTTP::Request object manually? Using LWP::UserAgent's post() method would
> be simpler:
I really don't know perl oop, I've just copied examples and tried to
adapt them.
> Now, judging by your description of their requirements, it appears they want
> *both* a query string appended to the URL, and POST-ed form data. That is,
> the rough equivalent of what would happen with an HTML form element
I found it strange, but the instructions from the rep state, "When using
AIM, you will need to post a series of name/value pairs to us, in a
query string format:
https://secure.authorize.net/gateway/transact.dll?x_login=YOURLOGINID&x_tran_key=YOURTRANSACTIONKEY
"AIM is a secure server to secure server connection that uses a string
POST."
I guess I don't really know what a string post is. Their server
responds with a posted pipe-delimited string--not a query_string--but
I'll be able to capture and parse that.
Thanks for your advice and examples. I'll work on it some more.
-jd
------------------------------
Date: Fri, 14 Jan 2005 16:59:48 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: comp.lang.perl.misc & gmane.org
Message-Id: <gcifu0tl21sicc4urs8gtjed3ea4n8687o@4ax.com>
On Fri, 14 Jan 2005 11:08:38 +0100, "Bernard El-Hagin"
<bernard.el-haginDODGE_THIS@lido-tech.net> wrote:
>"Xah Lee" <xah@xahlee.org> wrote:
>
>> does anyone know which list at gmane.org is the comp.lang.perl.misc?
>
>Do you have a Perl question?
Well, despite Xah Lee being an insufferable troll, indeed this is
somewhat a Perl question in that it is Perl related, albeit vaguely.
Said this, IIRC gmane is an nntp front end for mailing lists. But
clpmisc is a newsgroup on its own so chances are that it is _not_
available from gmane. I cannot say for sure, however...
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Fri, 14 Jan 2005 12:21:11 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: convention regarding lexical filehandles
Message-Id: <ekafu0d40sq6ddmjb5s8ml7mnh9aap1s2h@4ax.com>
On 13 Jan 2005 22:42:51 GMT, Abigail <abigail@abigail.nl> wrote:
>I find the two arg form of 'open' useful. And no, I don't create file
>names that start with '|', '<' or '>', nor filenames that end with a
>'|'. Nor do I include leading or trailing spaces in my filenames.
Please note that I'm not one of those '"Perl" eq "CGI"' kinda guys: to
be fair I've hardly done any CGI et similia at all, but what if a CGI
script (is not run in taint mode and) accepts a parameter to be
interpreted as a filename to be opened and someone passes
%7Cecho%20'%3CHTML%3E%0A%3CHEAD%3E%0A%3CTITLE%3EYou%20have%20been%20hacked!%3C%2
FTITLE%3E%0A%3C%2FHEAD%3E%0A%3CBODY%3E%3CH1%3EYou%20have%20been%20hacked!%3C%2FH
1%3E%3C%2FBODY%3E%0A%3C%2FHTML%3E'%20%3Eindex.html%0A
(beware of line wraps)
to it?
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Fri, 14 Jan 2005 12:21:13 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: daemonizing a process AND capture stdout, stderr
Message-Id: <t4afu0pqki2oupjkarsqv66lvat5gvb7r2@4ax.com>
On Fri, 14 Jan 2005 19:00:51 +1100, "Gyruss" <gyruss@hushmail.com>
wrote:
>I've written a front end that kicks off various unix processes. I want to
>completely daemonize each process so that even if a user were to kill his
>front end, the process would continue to run without interruption. This
>isn't too difficult to accomplish, there's even a module that will do it all
>for you: Proc::Daemon.
>
>The tricky bit is that I want to be able to capture stdout and stderr from
>the script in my front end.
>
>How can I daemonize a process but still capture it's output?
You, know, I'm not sure about what you're asking: is it about
daemonizing the main script that launches the other processes, or
these processes themselves? However whatever you do, a child will
always have a parent: in some sense "true orphans" do not exist,
because they will be "inherited" by process 0.
Given that it's not entirely clear to me what you really want to do,
the only thing that I can add is that nobody prohibites you to close
any filehandle and then re-open it. In a script of mine that I happen
to have handy I have this snippet:
close STDIN;
close STDOUT;
close STDERR and
open STDERR, '>', $_ or
die "$0: Can't redirect STDERR to `$_': $!\n"
for "$home/.$name-log";
(In this case I only need STDERR for error and informative messages
logging.)
HTH,
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Sat, 15 Jan 2005 02:25:03 +1100
From: "Gyruss" <gyruss@hushmail.com>
Subject: Re: daemonizing a process AND capture stdout, stderr
Message-Id: <41e7e450@dnews.tpgi.com.au>
"Michele Dondi" <bik.mido@tiscalinet.it> wrote in message
news:t4afu0pqki2oupjkarsqv66lvat5gvb7r2@4ax.com...
> You, know, I'm not sure about what you're asking: is it about
> daemonizing the main script that launches the other processes, or
> these processes themselves? However whatever you do, a child will
> always have a parent: in some sense "true orphans" do not exist,
> because they will be "inherited" by process 0.
>
> Given that it's not entirely clear to me what you really want to do,
The result I want is to have my child process live on if the parent process
is killed. The parent process should just read stderr and stdout from the
child process. I want to 'daemonize' the child process (it's not really the
right term), not the parent process.
------------------------------
Date: Fri, 14 Jan 2005 07:52:24 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: disk space script
Message-Id: <slrncufjko.4ss.tadmc@magna.augustmail.com>
jc8glp1hu <jgarretthood@gmail.com> wrote:
> Ahh, nifty. I didn't know about that.
What "that" is that?
It is customary to quote some context.
Please learn the proper way of composing a followup.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 14 Jan 2005 06:23:39 -0800
From: "jc8glp1hu" <jgarretthood@gmail.com>
Subject: Re: disk space script
Message-Id: <1105712619.675435.95700@f14g2000cwb.googlegroups.com>
Sorry
Tad McClellan wrote:
> What "that" is that?
that = qx()
. I didn't quote because it was from the post above. I'll work on it, I
am new to the whole forum type / google grouping. Thanks for the
advice.
------------------------------
Date: Fri, 14 Jan 2005 14:52:31 GMT
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: disk space script
Message-Id: <P0RFd.653$rs2.635@trndny07>
"jc8glp1hu" <jgarretthood@gmail.com> wrote in message
news:1105712619.675435.95700@f14g2000cwb.googlegroups.com...
> Sorry
>
> Tad McClellan wrote:
> > What "that" is that?
>
> that = qx()
>
> . I didn't quote because it was from the post above. I'll work on it,
I
> am new to the whole forum type / google grouping. Thanks for the
> advice.
This is not google groups, nor is it a forum. This is Usenet. Google
merely provides an interface and an archive. Please use that archive to
search for an article entitled "Posting Guidelines". Following those
guidelines will help maximize the help you receive in this newsgroup.
Paul Lalli
------------------------------
Date: 14 Jan 2005 16:12:24 +0100
From: Arndt Jonasson <do-not-use@invalid.net>
Subject: Re: disk space script
Message-Id: <yzd4qhkkpt3.fsf@invalid.net>
"jc8glp1hu" <jgarretthood@gmail.com> writes:
>
> Tad McClellan wrote:
> > What "that" is that?
>
> that = qx()
>
> . I didn't quote because it was from the post above. I'll work on it, I
> am new to the whole forum type / google grouping. Thanks for the
> advice.
The "post above" is visible to you, but for most people reading News
with a News reader, an article they've already read is not visible
anymore because they read it in an earlier session. It may perhaps not
even be obtainable locally anymore, if enough time has passed - old
articles are removed to save space. On www.dejanews.com, you can see
the complete thread.
Apart from that, the article you refer to may not appear as the one
immediately above, for everyone.
Third, if they choose to comment on what you wrote, it becomes
increasingly difficult to keep track of what is being referred to.
------------------------------
Date: 14 Jan 2005 15:54:41 GMT
From: Dave Weaver <zen13097@zen.co.uk>
Subject: Re: eliminating empty elements of a list
Message-Id: <41e7eb41$0$7973$db0fefd9@news.zen.co.uk>
On Tue, 11 Jan 2005 00:40:11 GMT, David Sletten <david@slytobias.com>
wrote:
>
> So this should work for your purposes:
> @out = grep { $_ || $_ eq '0' } @in;
But the trouble with that is:
Use of uninitialized value in string eq at ...
if the list contains undef. You *are* using 'warnings', aren't you? ;-)
------------------------------
Date: Fri, 14 Jan 2005 13:36:16 +0100
From: ruud <geen@mail.invalid>
Subject: Except script error
Message-Id: <cs8ec6$a17$1@box.nl-netwerken.com>
I am rewriting my Except script from bash to Perl.
But i get an syntax error at the Send command.
Google is not helping me out here, so i hope for an answer here.
Here is a part of the script:
#!/usr/bin/perl -w
use Expect;
$post = "post";
$quit = "quit";
spawn telnet "news.nl-netwerken.com 119";
expect {
200}
send "$post\r";
expect {
340}
And here is the error:
syntax error at ./p line 12, near "send"
Execution of ./p aborted due to compilation errors.
What is wrong with this line ?
Thanks for your time.
--
Gr. Ruud
news://news.nl-netwerken.com
------------------------------
Date: Fri, 14 Jan 2005 14:01:33 GMT
From: "Noel" <noelt.dolan@virgin.net>
Subject: Re: Except script error
Message-Id: <1hQFd.1363$Pp4.1094@newsfe6-win.ntli.net>
"ruud" <geen@mail.invalid> wrote in message
news:cs8ec6$a17$1@box.nl-netwerken.com...
> I am rewriting my Except script from bash to Perl.
> But i get an syntax error at the Send command.
> Google is not helping me out here, so i hope for an answer here.
>
> Here is a part of the script:
>
> #!/usr/bin/perl -w
> use Expect;
>
> $post = "post";
> $quit = "quit";
>
> spawn telnet "news.nl-netwerken.com 119";
>
> expect {
> 200}
>
> send "$post\r";
> expect {
> 340}
>
> And here is the error:
> syntax error at ./p line 12, near "send"
> Execution of ./p aborted due to compilation errors.
>
> What is wrong with this line ?
> Thanks for your time.
> --
> Gr. Ruud
> news://news.nl-netwerken.com
# Always use...
use strict;
use warnings;
#... at the start of your code.
At the very least your ~expect~ commands seem to be missing the closing
semi-colon ~;~. Include these then try it.
------------------------------
Date: Fri, 14 Jan 2005 15:51:44 +0100
From: ruud <geen@mail.invalid>
Subject: Re: Except script error
Message-Id: <cs8ma9$afr$1@box.nl-netwerken.com>
Noel wrote:
> # Always use...
> use strict;
> use warnings;
> #... at the start of your code.
>
> At the very least your ~expect~ commands seem to be missing the closing
> semi-colon ~;~. Include these then try it.
I changed is a little bit, but still 1 error left:
Not enough arguments for send at ./p line 10, near ""post\n")"
Here is the new script:
#!/usr/bin/perl -w
use Expect;
use strict;
use warnings;
post ("post");
spawn telnet ("news.nl-netwerken.com 119");
expect ("200");
send ("post\n");
expect ("340");
Thanks for helping me out b.t.w.
--
Gr. Ruud
news://news.nl-netwerken.com
------------------------------
Date: 14 Jan 2005 07:20:04 -0800
From: "Deepster" <deepiceman@yahoo.com>
Subject: Re: Formmail Question
Message-Id: <1105716004.755299.208170@c13g2000cwb.googlegroups.com>
Thanks for the update guys, Yes I was wanting to use Matt's form
script. I dont think I want to go take up skydiving just yet so I will
stick with nms...
Thanks again
Deep
Tad McClellan wrote:
> Deepster <deepiceman@yahoo.com> wrote:
>
> > I want to use formmail
>
>
> No you don't.
>
>
>
> Crackers cruise the web looking for sites that use Matt's scripts
> so they can exploit any of several security holes.
>
> If you still *want* that, then you must be a real thrill seeker,
> consider taking up skydiving instead. :-)
>
>
>
> --
> Tad McClellan SGML consulting
> tadmc@augustmail.com Perl programming
> Fort Worth, Texas
------------------------------
Date: Fri, 14 Jan 2005 12:21:12 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Log File parser
Message-Id: <52afu0pfgv1kkcdqb74kg5sj21jsqogmio@4ax.com>
On Thu, 13 Jan 2005 23:25:54 -0500, Sherm Pendley
<spamtrap@dot-app.org> wrote:
>Or to put it another way: "Give a man to fish, and you feed him for a day.
>Teach him to fish, and you feed him for a lifetime." We prefer to give
Teach him how to fish, he'll tell you that he's too hungry to loose
his time playing with rods and lines...
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Fri, 14 Jan 2005 12:21:12 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Log File parser
Message-Id: <hh0fu0hoi81tuh3h1mc6rp6f3ofes7oogb@4ax.com>
On 13 Jan 2005 23:16:58 -0800, "jc8glp1hu" <jgarretthood@gmail.com>
wrote:
>my $logFile = "errors.log";
>
>my $warningLines = qx(grep WARN $logFile);
Yuk!
>my $errorLines = qx(grep ERROR $logFile);
Yuk! x 2
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: 14 Jan 2005 06:09:45 -0800
From: "jc8glp1hu" <jgarretthood@gmail.com>
Subject: Re: Log File parser
Message-Id: <1105711785.127233.248710@c13g2000cwb.googlegroups.com>
So, are people on google groups to criticize or help people out?
When someone asks how to do something, they don't want to be told what
they already know. He stated that he would like a script to check for
those two things and mail him the results. So there it is, a script
that does that.
If someone asks you to do something in perl, why do you even waste your
time posting a message that says "go to ...perl.com and you will find
some tips.". That's completely unfair to the person asking the question
because if they wanted to know that they would have asked something
like "Hey, where can I get more information on learning Perl, id like
to write this script to do .... etc".
NOW LET ME SIDE W/ SHERM. I do believe that you should come w/ some
code to show for what you have tried. But when I started learning Perl
I was clueless to how to use it and it is kind of hard to get started
unless you get a little guidance. I use it for web scripts primarily so
these side projects are fun for me to try and figure out as I see them
here and there.
So instead of criticizing and posting just to have your say in things,
why don't you try and help someone out when they have a problem.
I wrote that script in about 5 minutes to give him something to go
from. Instead of coming on here and complaining about someone who took
their time to help, why don't you show how you would write it. The main
point here is post if you are going to help, if not then don't waste
everyone's time.
Finally, I just don't think the purpose here is to be an almighty
mentor and oversee what is going on by telling people to read posting
rules and trying to be a professor pointing people in the right
direction. This is a place to ask questions about perl to help get your
question answered, so if you know an answer to the post then post about
it. It just goes back to common courtesy of answering what you are
asked. If people are asking a question they are wanting an answer, an
instant solution, unless of course they ask not to be told how to do it
and just be given some tips.
Anyway, I am on here to help some people out. The script I wrote gives
him a starting place to do what he is wanting to do. He is new to perl,
and wanted some help, so there ya go. Take it and run with it. I hope
what I posted has helped you some, despite rude comments from someone
who didn't have the time to post anything constructive. They apparently
were never new to the Perl language at all.
------------------------------
Date: 14 Jan 2005 06:16:57 -0800
From: "jc8glp1hu" <jgarretthood@gmail.com>
Subject: Re: Log File parser
Message-Id: <1105712217.077518.277530@c13g2000cwb.googlegroups.com>
Sorry for the rant, I am not out to make anyone feel bad or offend
anyone. I am just having some sympathy for the thread starter who asked
a question and didn't get what he wanted because I have been told
before to go somewhere and read up, which is what I did, but I still
didn't "understand" what I was doing.
Sherm is right too, head to the site he suggested to learn some more
about it if you so desire because Perl is a really neat language.
So, sorry to anyone I offended. I just feel strongly about helping
people when they ask for it because we all have struggled with
something new before.
------------------------------
Date: Fri, 14 Jan 2005 16:59:41 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Loop through a text file line by line
Message-Id: <aebfu0pe5nt26d534ltlr5ooel8k5jvifi@4ax.com>
On 14 Jan 2005 10:24:09 GMT, Martin Kissner <news@chaos-net.de> wrote:
>> Not exactly. From 'perldoc perlop':
>> [...]
>
>In <yzdu0ponibh.fsf@invalid.net> Arndt wrote to me:
>| The "diamond" operator <> is described in perlop and perlopentut.
>| You read from STDIN by using the normal Unix syntax:
>|
>| ./myperlscript.pl < file
>
>This worked for me.
So what?!?
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: 14 Jan 2005 04:11:13 -0800
From: "DKW" <uffesterner@spamhole.com>
Subject: Re: portable no warnings "uninitialized"
Message-Id: <1105704672.991228.210030@z14g2000cwz.googlegroups.com>
Thank you all, guys!
I will try some of these techniques.
------------------------------
Date: Fri, 14 Jan 2005 16:59:38 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Print question
Message-Id: <inlfu0hmgemmu28vnuckqbofs6blhg8u4d@4ax.com>
On Fri, 14 Jan 2005 08:36:53 GMT, "edgrsprj" <edgrsprj@ix.netcom.com>
wrote:
>> Putting aside the imprecision about "CGI type language" et similia, as
>> already pointed out by other posters, are you _seriously_ thinking of
>> porting your computational perl program to CGI?!? I mean: are you
>
>The idea is to have programs running at a Web site which people around the
>world can visit. There they would use a data entry screen to submit their
Well, I mean: I don't know the details of your work[*] but the kind of
applications it has to do is well known to be of a formidable
computational complexity. It seems to be unrealistic to suppose that
such a thing can be run as a CGI script.
Of course if you want a web-based front end or interface for whatever
(i.e. reporting or submitting data), then no problem, but the claim
that (the very core of) an earthquake prevention program can be run as
a CGI script tends to support the crackpottery accuse hinted to in the
footnote below.
[*] And FWIW, please don't take this as a personal offence, but I
can't help perceiving some smell of crackpottery judging from the
posts you made here.
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Fri, 14 Jan 2005 16:59:40 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Print question
Message-Id: <9rlfu0taqvcm9gqck09qpg772tiqr4l69c@4ax.com>
On Fri, 14 Jan 2005 08:24:18 GMT, "edgrsprj" <edgrsprj@ix.netcom.com>
wrote:
<OT wrt="Perl">
>For any who are interested, the following is the direction in which all of
>this is hopefully heading:
>
>The output of the latest version of my main Earthquake and Tornado Data
>Evaluation Perl language computer program can presently be seen in the data
>table on the following Web page:
>
>http://www.freewebz.com/eq-forecasting/Data.html
>
>That approach to forecasting earthquakes and perhaps even some tornados does
>appear to work though much improvement is needed.
Listen: I am willing to be as gentle and as positive as possible, but
all this sounds so strange, at best! I mean, it's evident that you're
animated by good will, taking into account that your final goal has a
relevant "humanitarian" component...
It's still not entirely clear to me wether you're taking part to this
project within the framework of an academic or private research group
or if you're "simply" (no offence intended) an amateur scientist, but
evidence supports the latter interpretation.
However "this kind of things" is notoriously complex and there are
surely many academic groups involved in research areas having to do
with it. From the practical point of view the kind of resources that
are required are extremely expensive and complex: even from the purely
computational point of view typically it takes clusters of
workstations, not to say supercomputers.
Now, the claim that your simple (however complex it can be) Perl
program running on a pc does yield promising results is unavoidably
dubious. But indeed it's also well known that there have been (_rare_)
cases in which amateur scientists have actually had interesting ideas
that have been entually acknowledged by the community.
So, even if I'm inclined to believe it is not so, let us suppose that
your program really works with the good results you claim: then it
can't be a side effect of the actual implementation, but a feature of
the algorithm you have implented, that hence we're implicitly assuming
to be a somewhat revolutionary idea. Have you tried contacting someone
in a specifically related research area to discuss about it? Have you
tried submitting a paper for publishing?
In short, I mean: either all this is BS (respectfully, because I have
already acknowledged your good will) or it is authentically good
stuff, but then there's no point in bringing it on on your own. You
really should communicate your idea(s) to someone who can develop them
to the best advantage and cooperate with them, instead.
</OT>
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Fri, 14 Jan 2005 07:50:21 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Regular expression lookahead question
Message-Id: <slrncufjgt.4ss.tadmc@magna.augustmail.com>
Peroli <peroli@gmail.com> wrote:
> I donno if thats english enough for you,
That was fine.
Please don't use "cutsie" spellings (r=are, u=you ...),
it is inconsiderate of your readers.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: 14 Jan 2005 16:14:28 +0100
From: Arndt Jonasson <do-not-use@invalid.net>
Subject: Re: Regular expression lookahead question
Message-Id: <yzdzmzcjb57.fsf@invalid.net>
Tad McClellan <tadmc@augustmail.com> writes:
> Peroli <peroli@gmail.com> wrote:
>
>
> > I donno if thats english enough for you,
>
>
> That was fine.
>
> Please don't use "cutsie" spellings (r=are, u=you ...),
> it is inconsiderate of your readers.
One wonders, does that apply to using only lower-case letters too?
Though I do admit to finding those articles easier to read than ones
with the cute spellings.
------------------------------
Date: Fri, 14 Jan 2005 16:19:40 +0100
From: phaylon <phaylon@dunkelheit.at>
Subject: Re: Regular expression lookahead question
Message-Id: <pan.2005.01.14.15.19.40.657835@dunkelheit.at>
Arndt Jonasson wrote:
> One wonders, does that apply to using only lower-case letters too?
Believe me, it's much more annoying in german. ;)
p
--
http://www.dunkelheit.at/
Kunst kommt von Koennen, kaeme sie von Wollen, hiesse sie Wulst.
-- Nietzsche - Bonmot
------------------------------
Date: Fri, 14 Jan 2005 12:42:06 +0100
From: Enno Lenze <2005-01@spam.verbrennung.org>
Subject: Re: sql script will net
Message-Id: <34ppg6F4cd6n5U1@individual.net>
hi!
sorry this was supposed to eb posted in a german newsgroup, but i missed
the de..
Thanks for the help!
regards, enno
--
http://www.hacktrain.de http://www.verbrennung.org
------------------------------
Date: Fri, 14 Jan 2005 07:42:15 -0500
From: Shawn Corey <shawn.corey@sympatico.ca>
Subject: Re: Unix-format text from STDOUT under Windows (AcitvePerl 5.8.x)?
Message-Id: <X4PFd.47639$TN6.1751020@news20.bellglobal.com>
Jim Monty wrote:
> In fact, that's what I've been doing in this case: post-processing the
> file.
>
> C:\>perl ScriptThatUsesXMLWriter.pl Input.csv | tr -d "\r" >Output.xml
>
#/usr/bin/perl
use strict;
use warnings;
close STDOUT;
open STDOUT, "| tr -d \"\\r\"" or die $!;
...
close STDOUT or die $!; # flush last buffer
__END__
--- Shawn
------------------------------
Date: 14 Jan 2005 07:34:46 -0800
From: "Michael Carman" <mjcarman@mchsi.com>
Subject: Re: Unix-format text from STDOUT under Windows (AcitvePerl 5.8.x)?
Message-Id: <1105716886.098941.266710@c13g2000cwb.googlegroups.com>
Jim Monty wrote:
>
> In fact, that's what I've been doing in this case: post-processing
> the file.
>
> C:\>perl ScriptThatUsesXMLWriter.pl Input.csv | tr -d "\r" Output.xml
>
> But now I'd like to be able to hand the Perl script to someone who
> will have ActivePerl, but not necessarily tr (Cygwin or MKS Toolkit).
So write a trivial Perl utility to do it and give it to the user along
with your script:
#!/usr/bin/perl -w
binmode(STDIN);
binmode(STDOUT);
while (<STDIN>) {
s/\015\012/\012/;
print;
}
[apologies if the formatting is poor, google groups seems to strip what
it deems to be extraneous whitespace.]
Then you can run
c:\>perl xmlscript.pl input.csv | perl tr.pl > output.xml
or, after using pl2bat on the translator:
c:\>perl xmlscript.pl input.csv | tr.bat > output.xml
It's not ideal (it would be nicer if you could hide that detail inside
your main script) but it's functional.
-mjc
------------------------------
Date: Fri, 14 Jan 2005 16:59:43 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Works great!
Message-Id: <u0kfu09mk6lq43kjve9o4cuhot3v22hdpd@4ax.com>
On 14 Jan 2005 09:57:51 +0100, Arndt Jonasson <do-not-use@invalid.net>
wrote:
>Speaking of Perl golf, does anyone know if that activity is defunct?
>Nothing is happening on http://terje2.perlgolf.org, anyway.
What a pity! When I saw what some of the people there could do I
thought they were Perl programmers from another planet!!
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 7648
***************************************