[17719] in Perl-Users-Digest
Perl-Users Digest, Issue: 5139 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Dec 18 09:05:33 2000
Date: Mon, 18 Dec 2000 06:05:13 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <977148313-v9-i5139@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 18 Dec 2000 Volume: 9 Number: 5139
Today's topics:
Re: Attach file in email? (Mariusz Drozdziel)
Re: basic code -- why won't it work??!! (Mariusz Drozdziel)
Build a service like hitbox.com or extreme-dm.com ? conint@my-deja.com
Re: Errors in HTTP/Response & LWP/Response <apiron@ulb.ac.be>
Getting around the @#$@ DOS backslash! <elvis@chowtech.cuug.ab.ca>
Re: Getting around the @#$@ DOS backslash! <josef.moellers@fujitsu-siemens.com>
Re: Getting around the @#$@ DOS backslash! <carvdawg@patriot.net>
HELP: any CGI script for users to change forwarded emai <kit@computer.org>
Re: HELP: any CGI script for users to change forwarded fletchra@post.queensu.ca
Re: Hiding source <johngros@Spam.bigpond.net.au>
Re: Is there an overhead using long variable names? (Philip Lees)
Re: Language evolution C->Perl->C++->Java->Python (Is P <hading@worldnet.att.net>
Re: Language evolution C->Perl->C++->Java->Python (Is P (Steve Lamb)
Merry Christ Mas <root@c237627-d.moline1.il.home.com>
Merry Christ Mas <root@c237627-d.moline1.il.home.com>
newbie - access to dbf foxpro file <kolisko@penguin.cz>
Re: newbie - access to dbf foxpro file <bart.lateur@skynet.be>
newsgroup statistics script in perl (Mariusz Drozdziel)
Re: One-Liner to Sum a Stack of Numbers? <tick.toff@spam.com>
Re: One-Liner to Sum a Stack of Numbers? (Mark Ferguson)
Re: One-Liner to Sum a Stack of Numbers? (Abigail)
perl hanging under iis <markus.rietzler@rzf.fin-nrw.de>
Re: RegEx: \s but not \n <johnlin@chttl.com.tw>
Re: Sendmail script problems <mikelin6@home.com>
Re: Sendmail script problems <willem@veenhoven.com>
Re: Sendmail script problems <iltzu@sci.invalid>
Re: Stripping out meta tags from web pages (Niklas Frykholm)
Re: Upload Image don't refresh <johngros@Spam.bigpond.net.au>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 15 Dec 2000 23:41:23 GMT
From: nova@moo.pl (Mariusz Drozdziel)
Subject: Re: Attach file in email?
Message-Id: <slrn93lb13.bso.nova@salceson.netwerke.org>
Hello,
On Fri, 15 Dec 2000 13:16:12 GMT, Lars Svensson wrote:
> open F, ">email" or die "Fel! :$!";
> print F "To: " . param('to') . "\n";
> print F "From: " . param('from') . "\n";
> print F "Subject: " . param('subject') . "\n\n";
> print F param('message') . "\n";;
I think, that much better way is to use Mail::Sendmail
module instead of this, or at least write strike into sendmail
pipe. Simply open an output defined by:
open(MAIL,"|/usr/lib/sendmail -t -oi") || die "blablabla";
... and then simply print into MAIL instead of F.
There will be no need to create any unnesesery files on disk.
If you want to print this message to the web also, then first
insert all line into for example an array (push), and then
by using foreach type this to sendmail and next to te 'screen'.
> system('/usr/lib/sendmail -t -oi < email');
This method is very unsecure, becouse if somebody will
type something like this " ; command" in place of To:, then
probably the 'command' will be executed.
--
Mariusz.
== Mariusz Drozdziel <M.Drozdziel@elka.pw.edu.pl> * 2:482/52@fidonet ==
------------------------------
Date: 15 Dec 2000 23:43:24 GMT
From: nova@moo.pl (Mariusz Drozdziel)
Subject: Re: basic code -- why won't it work??!!
Message-Id: <slrn93lb4s.bso.nova@salceson.netwerke.org>
Czesc,
Dnia Fri, 15 Dec 2000 10:52:40 -0700, Andy Cantrell napisał:
> foreach $usr (@users) { print ...
Or even better "foreach(@users)" :-) ...
--
Mariusz.
== Mariusz Drozdziel <M.Drozdziel@elka.pw.edu.pl> * 2:482/52@fidonet ==
------------------------------
Date: Mon, 18 Dec 2000 10:47:56 GMT
From: conint@my-deja.com
Subject: Build a service like hitbox.com or extreme-dm.com ?
Message-Id: <91kq0s$crj$1@nnrp1.deja.com>
Is there any script (paid or free) to help you build a stats free service
like hitbox.com or extreme-dm.com ? Please reply to the email or both email
and news cause i check email frequently AT THE SUBJECT PUT THE WORD
"--->VALID EMAIL<---" to remain at the inbox All the other msgs will be
removed to trash for spamming protection
Thanks
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: Mon, 18 Dec 2000 11:06:53 +0100
From: Anthony PIRON <apiron@ulb.ac.be>
To: BUCK NAKED1 <dennis100@webtv.net>
Subject: Re: Errors in HTTP/Response & LWP/Response
Message-Id: <3A3DE1BD.422537D3@ulb.ac.be>
Hi,
Try something like below. It's a HTTP 1.0 request. For more info about
HTTP : www.w3.org.
use IO::Socket;
my $EOL = "\015\012";
my $BLANK = $EOL x 2;
my $remote = IO::Socket::INET->new( Proto => "tcp",
PeerAddr => www.cpan.org,
PeerPort => "http(80)",
);
unless ($remote) { die "cannot connect to http daemon on www.cpan.org"
}
$remote->autoflush(1);
print $remote "GET $document HTTP/1.0" . $BLANK;
while ( <$remote> ) { print }
close $remote;
BUCK NAKED1 wrote:
> I meant to say...
>
> Are there errors in HTTP/Response
> and LWP/UserAgent? ...
>
> And while I'm here, if someone could show me a way to grab a URL and
> store it by using a socket, that'd be great since I'm having trouble
> with the LWP library. I've reviewed IO::Socket and IO::Socket::INET and
> can't figure out how?
>
> Thanks again,
>
> --Dennis
--
Anthony PIRON - Researcher
Universite Libre de Bruxelles, Department of Computer Science
CP 212 - Boulevard du Triomphe, B-1050 Bruxelles, Belgium
Tel. +32 2 650 50 55, Fax +32 2 650 56 09, GSM +32 478 530 022
Email: apiron@ulb.ac.be Web: http://www.ulb.ac.be/di/ssd/apiron
------------------------------
Date: Mon, 18 Dec 2000 10:30:21 GMT
From: <elvis@chowtech.cuug.ab.ca>
Subject: Getting around the @#$@ DOS backslash!
Message-Id: <91i67s$527$1@chowtech.cuug.ab.ca>
Hi All,
I have little project in which I need to extract info from a DOS string
of type C:\dos\command\fruitcake.exe. How can I extract all the sections
between the backslashes and determine how many sections I can extract without
actually knowing anything about the string submitted? Can anyone help?
Elvis
--
-----------------------------------------------------------------------------
Elvis Chow elvis@chowtech.cuug.ab.ca "If you don't ask questions, it could
echow@rockyview.ab.ca mean you are afraid to learn ......"
-----------------------------------------------------------------------------
------------------------------
Date: Mon, 18 Dec 2000 12:08:52 +0100
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: Getting around the @#$@ DOS backslash!
Message-Id: <3A3DF044.B2913121@fujitsu-siemens.com>
elvis@chowtech.cuug.ab.ca wrote:
> =
> Hi All,
> =
> I have little project in which I need to extract info from a DOS string=
> of type C:\dos\command\fruitcake.exe. How can I extract all the sectio=
ns
> between the backslashes and determine how many sections I can extract w=
ithout
> actually knowing anything about the string submitted? Can anyone help?=
use split to break it apart.
-- =
Josef M=F6llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize (T. Pratchett)
------------------------------
Date: Mon, 18 Dec 2000 06:59:54 -0500
From: H C <carvdawg@patriot.net>
Subject: Re: Getting around the @#$@ DOS backslash!
Message-Id: <3A3DFC3A.74B5F959@patriot.net>
> > I have little project in which I need to extract info from a DOS string
> > of type C:\dos\command\fruitcake.exe. How can I extract all the sections
> > between the backslashes and determine how many sections I can extract without
> > actually knowing anything about the string submitted? Can anyone help?
>
> use split to break it apart.
more specifically, call the following code "test.pl" and run it using the following
command line:
test.pl c:\test\tempdir\runme.exe
#! c:\perl\bin\perl.exe
use strict;
my @str;
$str[0] = shift;
$str[1] = 'c:\test\tempdir\runme.exe';
$str[2] = "c:\\test\\tempdir\\runme.exe";
foreach my $test (@str) {
my @segs = split(/\\/,$test);
map{print "$_ ";}@segs;
print "\n";
}
------------------------------
Date: Mon, 18 Dec 2000 10:08:15 GMT
From: Kit-pui Wong <kit@computer.org>
Subject: HELP: any CGI script for users to change forwarded email addresses ??
Message-Id: <91knme$b8h$1@nnrp1.deja.com>
Dear Experts,
Just a simple question:
Is there any secure (and free) CGI script that
lets user change his/her to-be-forwarded email
address over a web interface ?
(either thru' ~/.forward or /etc/aliases)
Our platforms : Redhat 7.0 and Solaris 7
Any hint would be much appreciated !
Many thanks in advance !
kit
kit@computer.org
Sent via Deja.com
http://www.deja.com/
------------------------------
Date: 18 Dec 2000 13:13:12 GMT
From: fletchra@post.queensu.ca
Subject: Re: HELP: any CGI script for users to change forwarded email addresses ??
Message-Id: <91l2h8$aj1$1@knot.queensu.ca>
In comp.unix.programmer Kit-pui Wong <kit@computer.org> wrote:
> Is there any secure (and free) CGI script that
> lets user change his/her to-be-forwarded email
> address over a web interface ?
> (either thru' ~/.forward or /etc/aliases)
http://ist.uwaterloo.ca/~reggers/drafts/cgi-mail-tools.README
http://ist.uwaterloo.ca/~reggers/drafts/cgi-mail-tools.tar
------------------------------
Date: Mon, 18 Dec 2000 11:29:40 GMT
From: "John Boy Walton" <johngros@Spam.bigpond.net.au>
Subject: Re: Hiding source
Message-Id: <Eym%5.23426$xW4.180371@news-server.bigpond.net.au>
> I'm no professional hacker, but I would like
> to know how they can do this to see what kind of >security measures I can
> take.
>
> Please try and get the source of
> http://www.info.polymtl.ca/~sleeping/cgi-bin/test.cgi and if you can see
> the source, tell me how you did it (using which software, which
> strategy, etc.) Thanks a lot.
No they can see the HTML output by your script but they cannot see the
script itself.
------------------------------
Date: Mon, 18 Dec 2000 08:36:16 GMT
From: pjlees@ics.forthcomingevents.gr (Philip Lees)
Subject: Re: Is there an overhead using long variable names?
Message-Id: <3a3dcc0e.1074074@news.grnet.gr>
On 15 Dec 2000 09:09:09 -0700, tchrist@perl.com (Tom Christiansen)
wrote:
>In article <3a373715.67126743@news.grnet.gr>,
>Philip Lees <pjlees@ics.forthcomingevents.gr> wrote:
>>Is there any significant time overhead when using long variable names?
>>
>>e.g. $name_in_old_and_obsolete_database versus $old_name
>
>No.
Thank you! That's the kind of clear cut answer I was hoping for,
Not that a different answer would make me start using single character
variable names, or any rubbish like that - I was just curious. I fully
agree with the disparaging comments about optimisation elsewhere in
this thread.
Phil
--
Philip Lees
ICS-FORTH, Heraklion, Crete, Greece
Ignore coming events if you wish to send me e-mail
'The aim of high technology should be to simplify, not complicate' - Hans Christian von Baeyer
------------------------------
Date: Mon, 18 Dec 2000 13:00:22 GMT
From: Howard Ding <hading@worldnet.att.net>
Subject: Re: Language evolution C->Perl->C++->Java->Python (Is Python the ULTIMATE oflanguages??)
Message-Id: <3A3E0A00.90EC3C62@worldnet.att.net>
Just Me wrote:
>
> No, I certainly don't think so. This only is to preserve the conceptual
> integrity of the language. Where else can you use fractions und numbers of
> unlimited size than in Smalltalk.
Well, lots of places. How about Common Lisp and Scheme?
Smalltalk is a wonderful language, but the tight intergration of IDE and
language and the consequent effects on how one develops with it are a
lot more relevant than this kind of example.
Howard
--
Howard Ding
hading@worldnet.att.net
http://math.sunysb.edu/~hading http://thunder.prohosting.com/~hading
------------------------------
Date: Mon, 18 Dec 2000 08:42:15 -0000
From: grey@despair.rpglink.com (Steve Lamb)
Subject: Re: Language evolution C->Perl->C++->Java->Python (Is Python the ULTIMATE of languages??)
Message-Id: <slrn93rjf7.qb2.grey@teleute.rpglink.com>
On Sat, 16 Dec 2000 17:08:38 GMT, Al Dev <alavoor-nospam@yahoo.com> wrote:
>o Python code is a readable-syntax code, python forces the programmer to
> use tabs to mark program-blocks. Where as Java code can be very ugly
> and does not enforce readable-syntax code. Python removes unnecessary
> braces of Java (which clutters the code) and many other syntax which
> make code un-readable.
Actually, Python encouraged indention but discourages tabs. My tabs are
set to 2. What are yours set to? :)
--
Steve C. Lamb | I'm your priest, I'm your shrink, I'm your
ICQ: 5107343 | main connection to the switchboard of souls.
-------------------------------+---------------------------------------------
------------------------------
Date: Mon, 18 Dec 2000 12:31:56 GMT
From: Charlie Brown <root@c237627-d.moline1.il.home.com>
Subject: Merry Christ Mas
Message-Id: <0tn%5.10317$36.225770@news1.rdc1.il.home.com>
this is a perl schrip a friend and i whipped up
last night for anyone who's religious (christian)
or just interested in a perl schrip to display
some greek schriptures on the win95/98/nt? mchine.
just need to reverse the slashes and change the
jb directory to /root/jb and it'll work
fine in X.
requires Tk and LWP::UserAgent/HTTP::Request
(in order to download the greek scriptures
only downloads a piece at a time, stripped
from the ccat archives and some greek nt
i downloaded a while back (julyish))
from God remembers where on the net.
Merry Christ-mas remember Jesus loves us!
########## start code ##########
------------------------------
Date: Mon, 18 Dec 2000 12:33:46 GMT
From: Charlie Brown <root@c237627-d.moline1.il.home.com>
Subject: Merry Christ Mas
Message-Id: <Kun%5.10329$36.225495@news1.rdc1.il.home.com>
#!/usr/bin/perl
use strict;
use Tk;
use Tk::Font;
my ($height, $width) = (48, 576);
my ($greek, $oz);
my $john = Tk::MainWindow->new();
my $revelate = $john->Canvas(
-height => $height, -width => $width,
-background => "black"
);
my $jbfont = $revelate->Font(
-family => "symbol", -size => 22
);
$revelate->idletasks();
use LWP::UserAgent;
my $johnboat = LWP::UserAgent->new();
if ( ! -d "\jb" ) {
`mkdir \jb` || john();
}
my $bay = archives();
my $dock = HTTP::Request->new("GET",
"http://c237627-d.moline1.il.home.com/johnboat/$bay") || john();
$johnboat->request($dock, "\jb\$bay") || john();
open(JOHN, "\jb\$bay") || john();
foreach $_ (split(" ", <JOHN>)) {
translate($_);
}
exit(0);
# Subroutines
sub john {
foreach $_ ("EN", "ARCH", "HN", "O", "LOGOS", "KAI", "O", "LOGOS",
"HN", "PROS", "TON", "QEON", "KAI", "QEOS", "HN",
"O", "LOGOS") {
translate($_);
}
exit(0);
}
sub translate {
my $greek = shift;
$oz = $revelate->createText(
$width / 2, $height / 2,
-text => $greek, -justify => "center",
-font => $jbfont, -fill => "red"
);
$revelate->pack;
$revelate->idletasks();
$revelate->delete($oz);
sleep(2.4);
}
sub archives {
foreach $_ (
"01.Gen.1.lx", "02.Gen.2.lx", "03.Exod.lx", "04.Lev.lx", "05.Num.lx",
"06.Deut.lx", "07.JoshB.lx", "08.JoshA.lx", "09.JudgesB.lx", "10.JudgesA.lx",
"11.Ruth.lx", "12.1Sam.lx", "13.2Sam.lx", "14.1Kings.lx", "15.2Kings.lx",
"16.1Chron.lx", "17.2Chron.lx", "18.1Esdras.lx", "19.2Esdras.lx",
"20.Esther.lx", "21.Judith.lx", "22.TobitBA.lx", "23.TobitS.lx",
"24.1Macc.lx", "25.2Macc.lx", "26.3Macc.lx", "27.4Macc.lx",
"28.Psalms1.lx", "29.Psalms2.lx", "30.Odes.lx", "31.Proverbs.lx",
"32.Qoheleth.lx", "33.Canticles.lx", "34.Job.lx", "35.Wisdom.lx",
"36.Sirach.lx", "37.PsSol.lx", "38.Hosea.lx", "39.Micah.lx", "40.Amos.lx",
"41Joel.lx", "42.Jonah.lx", "43.Obadiah.lx", "44.Nahum.lx", "45.Habakkuk.lx",
"46.Zeph.lx", "47.Haggai.lx", "48.Zech.lx", "49.Malachi.lx", "50.Isaiah1.lx",
"51.Isaiah2.lx", "52.Jer1.lx", "53.Jer2.lx", "54.Baruch.lx", "55.EpJer.lx",
"56.Lam.lx", "57.Ezek1.lx", "58.Ezek2.lx", "59.BelOG.lx", "60.BelTh.lx",
"61.DanielOG.lx", "62.DanielTh.lx", "63.SusOG.lx", "64.SusTh.lx",
"65.Matthew.lx", "66.Mark.lx", "67.Luke.lx", "68.John.lx", "69.Acts.lx",
"70.Romans.lx", "71.1Corinthians.lx", "72.2Corinthians.lx", "73.Galatians.lx",
"74.Ephesians.lx", "75.Philippians.lx", "76.Colossians.lx",
"77.1Thessalonians.lx", "78.2Thessalonians.lx", "79.1Timothy.lx",
"80.2Timothy.lx", "81.Titus.lx", "82.Philemon.lx", "83.Hebrews.lx",
"84.James.lx", "85.1Peter.lx", "86.2Peter.lx", "87.1John.lx", "88.2John.lx",
"89.3John.lx", "90.Jude.lx", "91.Revelations.lx"
) {
if ( !-e "/.jb/$_" ) { return($_); }
}
return("01.Gen.1.lx");
}
------------------------------
Date: Mon, 18 Dec 2000 09:49:02 +0100
From: "Michal Kolesar" <kolisko@penguin.cz>
Subject: newbie - access to dbf foxpro file
Message-Id: <91kj6d$1moq$1@news.vol.cz>
Hi all!
I am newbie in perl. I get ActivePerl for windows.
Could You write my a example to access to
dbf Visual FoxPro file with sql command?
Ex:
I have a linear.dbf file.
and I would like to use for this file a select:
select * from linear where tcislo > 101000
How is it possible? Must I install any modules?
And how?
Thank You verry much!
--
---
Michal Kolesar
kolisko@penguin.cz
http://www.egarden.cz
public server of free unix services
------------------------------
Date: Mon, 18 Dec 2000 13:19:18 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: newbie - access to dbf foxpro file
Message-Id: <7p2s3t47q4dqo66jarqlkvr7a274f6svjt@4ax.com>
Michal Kolesar wrote:
>I have a linear.dbf file.
>and I would like to use for this file a select:
>select * from linear where tcislo > 101000
>
>How is it possible? Must I install any modules?
>And how?
Try DBD::XBase.
<http://search.cpan.org/search?dist=DBD-XBase>
Activestate, Perl 5.6:
<http://www.activestate.com/packages/x86/DBD-XBase.tar.gz>
You'll most likely need DBI as well.
<http://www.activestate.com/packages/x86/DBI.tar.gz>
To install the packages, you'll need the equivalent PPD files too, which
are one directory up. Download the files, put them in the same relative
position, i.e. the tar.gz files in an "x86" subdirectory, create a
simple BAT file with just this one line:
@ppm install %1
and drop the PPD files on it, one by one (DBI first). Both modules will
be installed. Note that ppm.bat is the module management tool included
in the Activestate distribution. It's in the "bin" subdir.
Next, try some adapted samples from the DBD::XBase docs.
--
Bart.
------------------------------
Date: 15 Dec 2000 23:58:16 GMT
From: nova@moo.pl (Mariusz Drozdziel)
Subject: newsgroup statistics script in perl
Message-Id: <slrn93lc0o.bso.nova@salceson.netwerke.org>
Hello,
Does anybody has something for easy creating newsgroup's
statictis? I want it in perl, becouse propably i will have to
change this, but i have no time to write something like this
from scrath.... :-/
Sorry for little offtopic...
--
Mariusz.
== Mariusz Drozdziel <M.Drozdziel@elka.pw.edu.pl> * 2:482/52@fidonet ==
------------------------------
Date: Mon, 18 Dec 2000 10:09:15 GMT
From: "SuperGumby" <tick.toff@spam.com>
Subject: Re: One-Liner to Sum a Stack of Numbers?
Message-Id: <fnl%5.23209$xW4.177588@news-server.bigpond.net.au>
seperator, terminator, schmirminator,,, this seems to be just a label.
before I go further: am I right ? from my newbie perspective ? that one
could strip all whitespace from a perl script and expect it to run correctly
? Theoretically making all perl scripts "oneliners" (except those with here
documents, I suppose, I'll probably learn of other exceptions as I walk the
path).
and before I again get in trouble for "jeopardy" posting, please be aware:
I do not do it to annoy people, I believe what I refer to as "top posting"
is a much better alternative to "bottom posting", which is EVIL.
I do not wish to make everyone's killfile, but if my style of posting annoys
you THAT MUCH, then so be it. Your style of posting, ie "bottom posting",
annoys me every bit as much. (and I like the analogy)
I only mention this because Abigail (whom I respect after reading several
hundred of the currently available posts in this group) has also asked me
not to do it.
Andrew N. McGuire wrote in message <86hf42dx57.fsf@hawk.ce.mediaone.net>...
>
>[ first, let me apologize for stealth cc'ing you Abigail, I had a slip
> of the fingers, specifically 'R' instead of 'F'. :-( ]
>
>>>>>> "A" == Abigail <abigail@foad.org> writes:
>
>A> On Sat, 16 Dec 2000 01:20:06 GMT, SuperGumby (tick.toff@spam.com) wrote
in comp.lang.perl.misc <URL:
news:<arz_5.19724$xW4.156568@news-server.bigpond.net.au>>:
>A> ++ OK OK, having just commented in another post on the proliferation of
>A> ++ oneliners,,, How can this be described as a oneliner ? Theoretically
it
>A> ++ seems to me any perl program can be written sans <cr> but this thing
has a
>A> ++ 'statement terminator' in the middle of it.
>
>A> Perl doesn't have statement terminator.
>
>[ snip ]
>
> Sure it does, ';' is a statement terminator.
------------------------------
Date: 18 Dec 2000 02:37:00 -0800
From: mefergus@Stanford.EDU (Mark Ferguson)
Subject: Re: One-Liner to Sum a Stack of Numbers?
Message-Id: <91kpcc$rak@GSB-Kwanza.Stanford.EDU>
SuperGumby <tick.toff@spam.com> writes:
>
>I do not do it to annoy people, I believe what I refer to as "top posting"
>is a much better alternative to "bottom posting", which is EVIL.
>
A great deal of communication depends on context
(OBPerl: context is a hguegly important concpet to
understand in Perl as well).
Top posting destroys, or at least obscures, context.
As such it should be avoided.
--
Mark Ferguson <Mark.Ferguson@Stanford.EDU>
------------------------------
Date: 18 Dec 2000 12:11:05 GMT
From: abigail@foad.org (Abigail)
Subject: Re: One-Liner to Sum a Stack of Numbers?
Message-Id: <slrn93rvmp.bel.abigail@tsathoggua.rlyeh.net>
Andrew N. McGuire (anmcguire@ce.mediaone.net) wrote on MMDCLXVI September
MCMXCIII in <URL:news:86hf42dx57.fsf@hawk.ce.mediaone.net>:
<>
<> >>>>> "A" == Abigail <abigail@foad.org> writes:
<>
<> A> On Sat, 16 Dec 2000 01:20:06 GMT, SuperGumby (tick.toff@spam.com) wrote
<> A> ++ OK OK, having just commented in another post on the proliferation of
<> A> ++ oneliners,,, How can this be described as a oneliner ? Theoretically it
<> A> ++ seems to me any perl program can be written sans <cr> but this thing ha
<> A> ++ 'statement terminator' in the middle of it.
<>
<> A> Perl doesn't have statement terminator.
<>
<> [ snip ]
<>
<> Sure it does, ';' is a statement terminator.
Could you come with a reference (in the Camel III, or the standard
documentation) for that?
And furthermore, could you please explain:
$ perl -wce 'print "This is a statement with no terminator"'
-e syntax OK
$
How could the syntax be ok if Perl would have statement terminators?
Abigail
--
perl -wle\$_=\<\<EOT\;y/\\n/\ /\;print\; -eJust -eanother -ePerl -eHacker -eEOT
------------------------------
Date: Mon, 18 Dec 2000 12:14:24 +0100
From: markus rietzler <markus.rietzler@rzf.fin-nrw.de>
Subject: perl hanging under iis
Message-Id: <3A3DF190.9269FBD9@rzf.fin-nrw.de>
hi,
i have a problem with active state perl 5.6.0, iis and DBI/DBD:ODBC.
after doing the database connection (retrieve data from an access
mdb-file) the perl process is hanging and will not be
stopped/killed/ended correctly under iis. does anyone have an idea from
which side (perl, dbi or IIS) the problem comes?
thanx
markus
------------------------------
Date: Mon, 18 Dec 2000 13:29:04 +0800
From: "John Lin" <johnlin@chttl.com.tw>
Subject: Re: RegEx: \s but not \n
Message-Id: <91k7f9$rdd@netnews.hinet.net>
> John Lin wrote:
> > When I want to match
> > \s but not \n
> > I write
> > [ \t\r\f]
"Martien Verbruggen" wrote
> Hmmm... One way of matching all whitespace except newline:
> /(?!\n)(\s)/
"Sean McAfee" wrote
> The usual way to match this is [^\S\n].
Wow, great!!!
May I ask a further question? I want to join lines as well as removing
the prefixing and trailing spaces. That is, for those strings
"abc\n def"
"abc \n def"
"abc \ndef"
"abc\ndef"
the results are all "abcdef". But not for "abc def" because it contains no
"\n".
My code is
s/[^\S\n]*\n[^\S\n]*//;
It works. But I think there is still a lot of space for improvement, right?
Thank you.
John Lin
------------------------------
Date: Mon, 18 Dec 2000 10:40:39 GMT
From: Mike Lin <mikelin6@home.com>
Subject: Re: Sendmail script problems
Message-Id: <3A3DEB39.AD9D487F@home.com>
Ok, I've finally figured out what the problem is. The problem is that
the close portion of the script doesn't work. What I can't figure out
is why. The syntax for the code is correct. Take a look at it and tell
me what you think. Better yet if someone could try running this script
and test it out I would really appreciate it because I'm starting to
think something's wrong with my web host and cgi scripts.
#!/usr/local/bin/perl
$email = 'mikelin6@home.com';
##############################
#email download code to email specified
#
print "Content-type: text/html\n\n";
print "before sendmail\n"; #used to check script
open (MAIL, "|/usr/sbin/sendmail -t") && print "Mail Opened:"; #checks
to see
if mail opens
print MAIL "To: $email\nFrom: mike\n";
print MAIL "Subject: download code\n";
print MAIL "the code is 1234\n\n";
close (MAIL) && print "Mail Closed"; #used to check if mail closes
print "after sendmail\n"; #checks end of script
Now after running this script I get as the output
"before sendmail Mail Opened:after sendmail"
Obviously the "Mail Closed" statement is missing because the mail fails
to
close. I tried changing all sorts of things around (spacing, and etc)
but it
still doesn't work. I am positive this is how you close a sendmail
script but
it still doesn't work.
Thanks
Mike Lin
Brian Pontz wrote:
> >print "Content-type: text/html\n\n";
>
> ^ Why this? ^ This is for printing HTML
>
> >open (MAIL, "|/usr/bin/sendmail -t") || &MailError;
>
> ^ Might be |/usr/sbin/sendmail -t ^ At least the servers I've worked
> on it is
>
> >print MAIL "To: $email\nFrom: Industrial Network Solutions\n";
> >print MAIL "Subject: Trial Version Industrial SNMP Suite\n";
> >print MAIL "Here is the code: 1234\n";
> >
> >close (MAIL);
> >
>
> Other than that it works ok.
>
> Brian Pontz
>
> comp.lang.perl.misc Searchable archive
> http://www.axehind.com/complangperl.html
>
> comp.lang.c Searchable archive
> http://www.axehind.com/complangc.html
------------------------------
Date: Mon, 18 Dec 2000 12:03:51 +0100
From: willem veenhoven <willem@veenhoven.com>
Subject: Re: Sendmail script problems
Message-Id: <3A3DEF17.B87834C4@veenhoven.com>
Mike Lin wrote:
>
> Ok, I've finally figured out what the problem is.
No, you obviously did not ...
> $email = 'mikelin6@home.com';
There must be something wrong with you, Mr. Lin. As many people
including myself already told you in the .perl group you have to escape
the '@' in the email. But you just do not listen to all the advice you
got, and now start to ask the same stupid questions in this group ..
willem
------------------------------
Date: 18 Dec 2000 13:22:15 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: Sendmail script problems
Message-Id: <977145042.28359@itz.pp.sci.fi>
In article <3A3DEF17.B87834C4@veenhoven.com>, willem veenhoven wrote:
>Mike Lin wrote:
>>
>> $email = 'mikelin6@home.com';
>
>There must be something wrong with you, Mr. Lin. As many people
>including myself already told you in the .perl group you have to escape
>the '@' in the email. But you just do not listen to all the advice you
>got, and now start to ask the same stupid questions in this group ..
Ahem. How would I put this politely..
Nah. The heck with it. You're wrong, you're giving wrong advice, and
you're committing the very same error you're mistakenly accusing the
original poster of. That's not only stupid, but also quite rude.
The original poster does not, I repeat, *does* *not* need to escape
the at sign, since it is in a _single_ quoted string. Anyone who knew
any Perl at all should know that. The code does have problems, rather
obviously given that this was the reason it was posted, but the string
you quoted doesn't contain any at all.
(Hint for the OP: The close is failing because sendmail failed. Your
message is missing a blank line between the header and the body. That
could well be the cause of the failure.)
--
Ilmari Karonen -- http://www.sci.fi/~iltzu/
"Get real! This is a discussion group, not a helpdesk. You post
something, we discuss its implications. If the discussion happens to
answer a question you've asked, that's incidental." -- nobull in clpm
------------------------------
Date: 18 Dec 2000 10:17:24 GMT
From: r2d2@acc.umu.se (Niklas Frykholm)
Subject: Re: Stripping out meta tags from web pages
Message-Id: <slrn93rp1k.p56.r2d2@vasa.acc.umu.se>
On Fri, 15 Dec 2000 13:09:19 -0000, Tony O Sullivan <tony@codeisland.net> wrote:
>I am trying to strip out the keywords, descriptions and authors from html
>documents
You may want to try my HTML::Transform package, found at
http://www.acc.umu.se/~r2d2/files/Perl/html_transform/index.html
Using it, you could write something like this:
$p = new HTML::Transform;
$p->set_handler("meta",
sub {
my $attr = $_[2];
if ($attr->{name} =~ /^keywords$/i) {
print "KEYWORDS: $attr->{content}\n";
}
});
$p->parse("file.html");
// Niklas
------------------------------
Date: Mon, 18 Dec 2000 11:27:17 GMT
From: "John Boy Walton" <johngros@Spam.bigpond.net.au>
Subject: Re: Upload Image don't refresh
Message-Id: <pwm%5.23422$xW4.180317@news-server.bigpond.net.au>
> if let user to re-submit the form and the saving file name is the same
> (say, hardcord the image name as tmp.gif), when use <img src=tmp.gif>
> to show the image, it always keep to show first one uploaded. I had
> tried to use http-expire for both HTML and CHI-header to force the page
> expire but still no effect. Any one had suggestion to solve this
> problem? (apert from use another cgi to read and write the content)
You could try pragma no cache on your page.
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 5139
**************************************