[13437] in Perl-Users-Digest
Perl-Users Digest, Issue: 847 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Sep 19 10:07:37 1999
Date: Sun, 19 Sep 1999 07:05:10 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <937749909-v9-i847@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 19 Sep 1999 Volume: 9 Number: 847
Today's topics:
#exec cgi <hult.holmstrom@swipnet.se>
Re: #exec cgi (Abigail)
Re: #exec cgi <news@cccltd.com>
Re: An Array of Collumns <madebeer@igc.apc.org>
Re: Carrige Returns UNWANTED>. HELP ME <duthler@tebenet.nl>
Re: CGI script for remote server <gellyfish@gellyfish.com>
Re: Converting time() to real date <gellyfish@gellyfish.com>
do you have a free resume & job posting script ? <cosmonet@vsnl.com>
Re: Error in "Learning Perl, 2nd Edition" or Error in P (Bart Lateur)
Re: Error in "Learning Perl, 2nd Edition" or Error in P <flavell@mail.cern.ch>
free perl script for web mall <cosmonet@vsnl.com>
Re: How do I print Array of hash? (Bart Lateur)
Re: How to test for file Perl <resource@ERASEjps.net>
Re: How to test for file Perl <resource@ERASEjps.net>
Re: List files in a dir (Bart Lateur)
Re: Locking a tied database with DB_File <gellyfish@gellyfish.com>
Re: Perl Challenge makau@multimania.com
Re: Perl Module for MS Access? <gellyfish@gellyfish.com>
Re: Some e-mails get sent, some don't (Bart Lateur)
Re: Some e-mails get sent, some don't (Bill Moseley)
Re: UNCRAP project proposal (Bart Lateur)
Re: UNCRAP project proposal (Bart Lateur)
Re: Using a period as a delimiter in the split() functi <gellyfish@gellyfish.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 19 Sep 1999 12:07:06 +0200
From: "Magnus Hult" <hult.holmstrom@swipnet.se>
Subject: #exec cgi
Message-Id: <rC2F3.4067$yU2.8061@nntpserver.swip.net>
Hello,
First of all, I know this is way off-topic, but I really need to get this to
work (and quite soon too).
I'm trying to include a cgi program from an shtml page. My problem is, I
need to send a query string too. But
<!--#exec cgi="script.cgi?query"-->
isn't working, I get an "[an error occured while processing this directive]"
error.
If I try
<!--#exec cmd="script.cgi?query"-->
The directive is replaced with nothing at all.
Are there any way I can achieve what I'm trying to?
Thanks,
Magnus Hult
hult.holmstrom@swipnet.se
------------------------------
Date: 19 Sep 1999 05:21:19 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: #exec cgi
Message-Id: <slrn7u9edr.2ml.abigail@alexandra.delanet.com>
Magnus Hult (hult.holmstrom@swipnet.se) wrote on MMCCX September MCMXCIII
in <URL:news:rC2F3.4067$yU2.8061@nntpserver.swip.net>:
''
'' First of all, I know this is way off-topic, but I really need to get this to
'' work (and quite soon too).
So, you think that posting an off-topic posting gets you a fast answer?
How foolish.
'' I'm trying to include a cgi program from an shtml page. My problem is, I
'' need to send a query string too. But
'' <!--#exec cgi="script.cgi?query"-->
'' isn't working, I get an "[an error occured while processing this directive]"
'' error.
That means you have a bug.
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
.qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
.qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Sun, 19 Sep 1999 09:46:02 -0400
From: "CCC_Ltd" <news@cccltd.com>
Subject: Re: #exec cgi
Message-Id: <jP5F3.19879$N77.1576655@typ11.nn.bcandid.com>
> I'm trying to include a cgi program from an shtml page. My problem is, I
> need to send a query string too. But
> <!--#exec cgi="script.cgi?query"-->
> isn't working, I get an "[an error occured while processing this
directive]"
> error.
> If I try
> <!--#exec cmd="script.cgi?query"-->
> The directive is replaced with nothing at all.
>
> Are there any way I can achieve what I'm trying to?
>
> Thanks,
> Magnus Hult
> hult.holmstrom@swipnet.se
>
>
To use a query string on the ssi you have to include the
query string in the URL when you call the .shtml file.
example: http://mydomain/myshtml.shtml?querystring
Also... get rid of the ?query in the ssi statement.
one other note... it should be <!--#exec cgi="script.cgi"-->
not <!--#exec cmd....
------------------------------
Date: Sun, 19 Sep 1999 02:17:00 -0700 (PDT)
From: Michael de Beer <madebeer@igc.apc.org>
Subject: Re: An Array of Collumns
Message-Id: <APC&1'0'50775db4'440@igc.apc.org>
To look at the data in the other direction, you might
like this perl script better.
HTH,
-Mike
#!/usr/bin/perl -w
use strict;
my $i = my $number_of_expected_answers = 5; # for error checking
my @testans; # global list of lists
while(<DATA>) {
chomp;
next unless /\d{$i}/;
my (@p_answers) = split (//); # use my or we'll overwrite data
# see perldoc -f map
# this loops from 0 to 4 , pushing the right item of p_answers onto
# the corresponding list in the @testanss list of lists.
map { push @{$testans[$_]}, $p_answers[$_] } (0 .. @p_answers - 1 );
}
#example of how to 'get at' data
print "the answers to question 3, for example: "; #should be 3343
print @{$testans[2]};
print "\n";
exit;
__DATA__
12345
21345
12435
12354
------------------------------
Date: Sun, 19 Sep 1999 15:27:18 +0200
From: "jan smit" <duthler@tebenet.nl>
Subject: Re: Carrige Returns UNWANTED>. HELP ME
Message-Id: <7s2oat$i74$1@zonnetje.nl.uu.net>
THNX im gonna try in in a sec after rolling this joint =]]]
Bart Lateur heeft geschreven in bericht <37ea66e1.9609732@news.skynet.be>...
>jan smit wrote:
>
>>im trying to write a script that can download rawdata from the internet ..
>>but at the end of each string i have a carrige return (0x0d,0x0a)
>>and i can use chomp to remove it .. but all i hafta remove = the 0x0d ..
>>well i removed them both with chomp and tried to add just the char 0x0a ..
>>but everytime i look at the file (with a hex editor) where i have put the
>>0x0a i always get an 0x0d also .. and i dont want them.. who can help
me???
>
>binmode() is your friend. I bet your on a Wintel machine. When reading
>from text files, "\015\012" is converted to "\012", and vice versa on
>printing it. binmode() prevents this conversion.
>
>Oh, and try this too:
>
> tr/\015//d;
>
>--
> Bart.
------------------------------
Date: 19 Sep 1999 11:14:52 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: CGI script for remote server
Message-Id: <7s2gjc$18d$1@gellyfish.btinternet.com>
On Sun, 19 Sep 1999 14:29:34 +0800 byuan wrote:
> Dear Sir:
>
> How to build a remote server?
>
Well you get your flexible friend and you take it for a walk down to
PC World (or wherever) and you buy the biggest most nasty looking computer
that they have because eny fule kno that a server has got to have a big case,
If by this time you havent reached your credit limit you
will probably buy as many 18GB disks as will fit in the case and a shed
load of 128Mb SDRAM. If they will give you a discount for not having a
microsoft OS installed take it as you will only be throwing that bit away
anyway.
When you have got this bit home you should remove the case of the computer,
(remember to take it out of the packaging first though ), I would recommend
using the correct size of cross-head screwdriver for this as although it
looks like you can undo the screws with that little one you got in a plastic
wallet out of a christmas cracker that has been sitting in the back of the
cutlery drawer neglected for two years but might come in useful sometimes
you do not want to use this as it will almost certainly result in a lot
of profanity when it comes to putting back in again: I would recommend a
short chubby handled engineering screwdriver from DK or the like, the good
Stanley ones with the blue handles are excellent for woodworking screws
but they arent precise enough for my taste when it comes to things like this.
Anyhow you've got the case off and hopefully saved the screws as you will
need them later, also it is hoped that you havent cracked the plastic bit
on the front that you had to lever off with a kitchen knife after you broke
the christmas cracker screwdriver which is a shame as you will be needing
that later as well as I will explain in due course. Inside the case you
will see a whole bunch of wires and stuff going hither and thither and if
you bought a particularly cheap one for some reason it will have more
wires than a more expensive one which is silly really but I'll let Carol
Vorderman explain that one later
(Continued page 94.)
> I want remote users to use my Fortran/C application in the web server,
> they can submit
> the input file by my homepage, and my CGI script
> receive this input file, execute the Fortran application program, and
> then output the result
> to the users.
>
Didnt you ask this earlier ?
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: 19 Sep 1999 11:44:52 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Converting time() to real date
Message-Id: <7s2ibk$193$1@gellyfish.btinternet.com>
On 18 Sep 1999 14:37:22 -0500 Abigail wrote:
> Craig Vincent (2bunnyhop@home.com) wrote on MMCCIX September MCMXCIII in
> <URL:news:EXNE3.42790$kL1.516589@news2.rdc1.on.home.com>:
> () I'm sure this is an incredibly easy function to do...but how do you convert
> () the return of a time() function to be the actual corresponding date/time?
>
>
> Make a large lookup table.
>
But the lookup table isnt that hard to make:
for(0 .. 2147483648)
{
my @stuff = localtime($_);
push @date_lookup, \@stuff;
}
print $date_lookup[time()]->[3,4,5];
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sun, 19 Sep 1999 17:30:32 +0530
From: "Brijyot singh sawhney" <cosmonet@vsnl.com>
Subject: do you have a free resume & job posting script ?
Message-Id: <7s3ndl$gaq$1@news.vsnl.net.in>
does any one know where i can get a free resume & job posting script
i need it urgently and i will be really greatful if any one can help me get
it
brijyot
brijyot@yahoo.com
------------------------------
Date: Sun, 19 Sep 1999 12:46:02 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Error in "Learning Perl, 2nd Edition" or Error in Perl port specific to Windows or ?
Message-Id: <37e5da9e.370029@news.skynet.be>
Larry Rosler wrote:
>That is likely to be a robust assumption, because the only characters
>that sort below 'space' are control characters.
"Space" does not come before "space", so it's not *that* robust. See
"Bonzo" vs. "Bonzo was here".
And you're assuming Ascii. I don't know where, for example, "space" is
in the EBCDIC table. It might be just anywhere.
--
Bart.
------------------------------
Date: Sun, 19 Sep 1999 15:31:59 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Error in "Learning Perl, 2nd Edition" or Error in Perl port specific to Windows or ?
Message-Id: <Pine.HPP.3.95a.990919151935.4640F-100000@hpplus03.cern.ch>
On Sun, 19 Sep 1999, Bart Lateur wrote:
> And you're assuming Ascii.
Well, it was assuming that "space" comes before (below) all the printing
characters. We'll see in a moment that "assuming ASCII" is to miss a
point.
> I don't know where, for example, "space" is in the EBCDIC table.
Some of us do ;-)
There's a very useful paper by A.Pirard from 1992,
ftp://ftp.ulg.ac.be/pub/docs/iso8859/iso8859.networking
that discusses effective ways of mapping between iso-8859-1
and other codings such as Mac and EBCDIC.
> It might be just anywhere.
Oh no, it's at 0x40, and it only has control characters below it, so
the procedure would work just as effectively with EBCDIC as with the
conventional way of storing ASCII.
Note, however, that IBM mainframes had a habit of storing ASCII
in reverse bit ordering. The simple sorting procedure wouldn't work
with _that_. (I kid you not. It was because of the way their serial
line interfaces worked).
------------------------------
Date: Sun, 19 Sep 1999 17:33:27 +0530
From: "Brijyot singh sawhney" <cosmonet@vsnl.com>
Subject: free perl script for web mall
Message-Id: <7s3nj4$gfm$1@news.vsnl.net.in>
This is a multi-part message in MIME format.
------=_NextPart_000_0015_01BF02C5.1530DD40
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
------=_NextPart_000_0015_01BF02C5.1530DD40
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>
<META content=3Dtext/html;charset=3Diso-8859-1=20
http-equiv=3DContent-Type><TITLE>money</TITLE><BASE=20
href=3D"file://D:\My Documents\cosmonet\">
<SCRIPT language=3DJavaScript>
<!--
function MM_goToURL() { //v2.0
for (var i=3D0; i< (MM_goToURL.arguments.length - 1); i+=3D2) //with =
arg pairs
=
eval(MM_goToURL.arguments[i]+".location=3D'"+MM_goToURL.arguments[i+1]+"'=
");
document.MM_returnValue =3D false;
}
//-->
</SCRIPT>
<META=20
content=3D"money, make money, click through, click, banners, banner =
revenue, banner exchange, banners"=20
name=3Dkeywords>
<META content=3D'"MSHTML 4.72.3509.100"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff=20
onload=3D"MM_goToURL('parent','http://oz.valueclick.com/redirect?host=3Dh=
0104176&banner=3Da0012941&c=3D00');return document.MM_returnValue">
<DIV> </DIV></BODY></HTML>
------=_NextPart_000_0015_01BF02C5.1530DD40--
------------------------------
Date: Sun, 19 Sep 1999 11:15:41 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: How do I print Array of hash?
Message-Id: <37e5bf06.509978@news.skynet.be>
nation wrote:
>I'm new to Perl and am completely confused on how to print the records
>in this type of variable. I need to print the records in a
>subroutine. Any help would be very appreciated
Oh no, a fun project! :-)
One could use one of the standard modules (included or on CPAN), but
here's some code of my own devising, mainly for demonstration
(educational) purposes.
It's also easy to adjust to your particular needs, and simple to use:
just print the damn thing; but: it requires blessing of all anonymous
hashes and arrays as a "Stringify" object. Therefore, ref() will no
longer work as before. Oh well, you can use the supplied method ref()
instead, or copy an existing structure into a new "Stringify" object,
and print that.
Note that the STRUCTURE of the resulting object is identical, so apart
from ref(), you can just use this object with your unmodified code.
This code is ONE FILE. You can put the partt from "package Stringify;"
on, into a separatae file "Stringify.pm", and "use STringify" in you
script. Don't forget to append "1;" or similar to the end of the module.
Have fun.
#!/usr/local/bin/perl -w
$test = new Stringify ['a', 'backslash:', "\\",
[ 'this','is', 'a', { hash => 'yes', array => 'no'}],
'I\'m here!'];
print "I've got: $test\n";
print "\$test is a @{[$test->ref]}\n";
package Stringify;
use overload '""' => \&stringify;
sub assimilate {
# very Borg like... ;-)
# deep copy, and bless every unblessed reference recursively
return map {
my $ref = ref;
unless(length $ref) { # not a reference
$_;
} elsif ($ref eq 'ARRAY') {
my @array = assimilate(@$_); bless \@array;
} elsif ($ref eq 'HASH') {
my %hash; @hash{keys %$_} = assimilate(values %$_);
bless \%hash;
} else { # object, pass as is
$_;
}
} @_;
}
sub new {
my @result = &assimilate; #call in list context
return wantarray?@result: $result[-1];
}
sub quoted {
local $_ = shift;
#backslashes in front of backslashes and of single quotes
s/([\\\'])/\\$1/g;
return "'$_'";
}
sub stringify {
local $" = ", ";
my($self) = @_;
if($self->isa('ARRAY')) {
# ARRAY
my @data = map { ref($_)?$_:quoted($_) } @$self;
# de-bless, and process
return "\[@data\]";
} else {
# HASH
my @data = map { (/\W/?quoted($_):$_) ." => ".
(ref $self->{$_}?$self->{$_}:quoted($self->{$_})) }
sort keys %$self;
return "\{@data\}";
}
}
sub ref ($) {
# call as $obj->ref or as Stringify::ref($obj);
my($self) = @_;
foreach('ARRAY','HASH') {
return $_ if $self->isa($_);
}
return CORE::ref($self);
}
1;
__END__
Result (in one long line):
I've got: ['a', 'backslash:', '\\', ['this', 'is', 'a', {array => 'no',
hash => 'yes'}], 'I\'m here!']
$test is a ARRAY
--
Bart.
------------------------------
Date: Sat, 18 Sep 1999 21:22:27 +0000
From: Warren Bell <resource@ERASEjps.net>
Subject: Re: How to test for file Perl
Message-Id: <37E40293.A6C887BD@ERASEjps.net>
In article <x79065imep.fsf@home.sysarch.com>,
Uri writes:
>>tom, he doesn't even know how to do a simple file test, how would he
>>even understand waht a race condition means, let alone what to do about
>>it.
>For all we know, this guy has been designing hardware or writing MS-DOS programs in assembler for ten years.
Actually I'm the lead programmer on most of thier projects...but I don't
know how to test for a file in Perl. Silly me. :)
> --
> <kragen@pobox.com> Kragen Sitaker ><http://www.pobox.com/~kragen/>
> Fri Sep 17 1999
> 52 days until the Internet stock bubble bursts on >Monday, 1999-11-08.
> <URL:http://www.pobox.com/~kragen/bubble.html>
------------------------------
Date: Sat, 18 Sep 1999 21:36:39 +0000
From: Warren Bell <resource@ERASEjps.net>
Subject: Re: How to test for file Perl
Message-Id: <37E405E7.C49A602C@ERASEjps.net>
>>>>> "WB" == Warren Bell <resource@ERASEjps.net> writes:
WB> Tom Christiansen wrote:
>> I hope you understand that you've probably just left yourself
>> open to a race condition.
WB> First, What's a race condition? And second, That wasn't actual code
I WB> was using, just an example of what
I need it to do. I might as well WB> used:
well, i was right. he doesn't know waht a race condition is, so tom's
telling him about it is not useful.
quick question: what is the context of this program? will it be running
more than one copy at a time (like cgi programs
can do)? or is it just a simple file munging program you use by itself?
uri
uri,
I have a script that restarts my PPP connection. I have various fake CGI
scripts and fake services in inetd that trigger this script when they
detect a port scan or CGI tampering. This restarts PPP so I connect with
a different IP. (the trouble makers then can't find me) But port scans
trigger a few of these scripts at once so I'm trying to have the PPP
script create a lockfile. Then, the perl scripts check for this
lockfile first. If its there, they exit. If it's not, they run the PPP
script.
My cheap way to take advantage of a dynamic IP for security. It's a
home machine so..
------------------------------
Date: Sun, 19 Sep 1999 11:15:25 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: List files in a dir
Message-Id: <37e4bd79.112761@news.skynet.be>
Pierre-Luc Soucy wrote:
>Anybody could tell me how to list the files in a dir and print the
>result in an HTML format with PERL?
Never mind those regulars. Lots of brilliant people there, but they
entertain themselves by giving trivial, working but uninteresting
solutions. Here's a code snippet that basically does what you want.
I hope. :-)
#! perl -w
use Cwd; $dir = cwd; # example: current dir
opendir(DIR, $dir);
my @list = sort readdir(DIR);
closedir(DIR);
my %escape = ('<' => '<', '"' => '"');
foreach($dir,@list) {
s/([<\"])/$escape{$1}/g;
}
$" = "\n"; #separate lines
print <<"END_OF_HTML";
<HTML>
<HEAD>
<TITLE>Directory Listing of $dir</TITLE>
</HEAD><BODY>
<H1>Directory Listing of $dir</H1>
<UL>
@{[map { qq[<LI><A HREF=\"$_\">$_</A>] } @list ]}
</UL>
</BODY></HTML>
END_OF_HTML
# Done.
If you want a more sofisticated output (icons depending on dirplain
file, modification date etc.), check out file operators /-[A-Za-z]/ (see
"perldoc -f -X") and stat(). Either chdir to that directory, or use the
full file path, or it won't work.
--
Bart.
------------------------------
Date: 19 Sep 1999 10:11:50 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Locking a tied database with DB_File
Message-Id: <7s2ct6$183$1@gellyfish.btinternet.com>
On Sun, 19 Sep 1999 03:18:04 -0500 Scott Beck wrote:
> Jonathan Stowe <gellyfish@gellyfish.com> wrote in message
> news:7s22vm$ve$1@gellyfish.btinternet.com...
>> On Sat, 18 Sep 1999 16:35:45 -0500 Scott Beck wrote:
>> >
>> > &lock_db("$db");
>>
>> You dont want to do that
>>
>> Or this :
>>
>> > &unlock_db("$db");
>>
>
> This is probably too abvious to you but what difference does it make?
> I mean double quotes interpolates as it would with no
> quotes.
> Is is more efficient without them?
> If so why?
>
No it doesnt work *with* them - the variable $db contains a reference to
a DB_File object and the quotes will 'stringify' the reference wherein it
will cease to be a reference. See the following based on your code:
#!/usr/bin/perl -w
use DB_File;
use Fcntl qw(:flock);
$db = tie @db, "DB_File", $file_location, O_RDWR|O_CREAT, 0666, $DB_RECNO
or die "Cannot open file '$file_location': $!\n";
&lock_db("$db");
&lock_db($db);
untie "$db";
sub lock_db
{
my $blah = shift;
print ref ($blah);
}
You will see that the first call of lock_db doesnt print anything whereas
the second correctly prints 'DB_File'.
HTH
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sun, 19 Sep 1999 13:13:21 GMT
From: makau@multimania.com
Subject: Re: Perl Challenge
Message-Id: <7s2nhd$m3s$1@nnrp1.deja.com>
> I doubt that you have any idea about the level of perl knowledge
> in this newsgroup .. I'm certainly no guru ..
> but I worked out what it did AND how it did it very easily in
> - at a guess - 15 seconds .. the knowledgable people of the group
> would take roughly 10% longer than the time it takes them to read it
Damn, seems I am far newbier than I ever thought :-)
Or maybe this newgroup should have been named
"comp.lang.experts.perl.misc" (in which case a
"comp.lang.newbies.perl.misc" would have been welcome).
And to think I would had the idea of submitting this code to a perl
obfuscated contest... Don't laugh!
> btw - the following does the same thing - only three times quicker
>
> $text =~ s/['"]/\\$&/g;
Yes, I know. The other version aimed at complicating this.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 19 Sep 1999 10:30:06 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Perl Module for MS Access?
Message-Id: <7s2dve$186$1@gellyfish.btinternet.com>
In comp.lang.perl.misc Gregger <aircooled@netlinq.net> wrote:
> Okay, now that this can-o-worms is open....
>
Bollocks!!! I didnt see the crosspost first time
> i need to get a web form to post a couple of fields to a file (csv,
> whatever), and considered Access briefly; reconsidered, but am still without
> a solution. Web forms are not a big deal, i know...however, i am being
> hindered thusly:
> 1. "mailto:" is NOT an option.
> 2. getting our IT dept. to allow us cgi/perl permissions is not likely.
> 3. getting our IT dept. to set up a DSN on a server (to use ASP-->Access)
> is laughably impossible.
> 4. I still need to get it done.
>
Given the first three I would suggest that bribing the IT dept with beer
and loads of it is possibly your only option - that or make it known to
the PHB who has tasked you thus that the only barrier to achieving your
goal is the IT department: of course whilst it might get *this* job done
it will almost make them rather hostile to any further requests - I would
recommend the beer most deinitely.
A further alternative is to set up your own web-server and side step IT
altogether.
Anyway what was your Perl question ?
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
Date: Sun, 19 Sep 1999 11:20:10 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Some e-mails get sent, some don't
Message-Id: <37e9c65e.2389512@news.skynet.be>
Randal L. Schwartz wrote:
>Greg> if(!open(M,"|mail $addr"){
>
>Danger, Will Robinson!
>
>What happens on the day that someone comes along with an email
>address of:
>
> 'merlyn@stonehenge.com </etc/passwd'
>
>Egah! I just got your password file.
[Other similar examples snipped]
Can'ts you quote a command line parameter? Like:
if(!open(M,"|mail '$addr'"){
although I guess you must escape single quotes (does that work? I have
too little experience with those shells...)
$addr =~ s/'/\\'/g;
--
Bart.
------------------------------
Date: Sun, 19 Sep 1999 06:17:25 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: Some e-mails get sent, some don't
Message-Id: <MPG.124e823cf9a6afcf989756@nntp1.ba.best.com>
Bart Lateur (bart.lateur@skynet.be) seems to say...
> Randal L. Schwartz wrote:
>
> >Greg> if(!open(M,"|mail $addr"){
> >
> >Danger, Will Robinson!
> Can'ts you quote a command line parameter? Like:
>
> $addr =~ s/'/\\'/g;
> if(!open(M,"|mail '$addr'"){
I wonder that too. But I also wonder if someone could use LWP and
create a POST that includes, say ^U to empty the line buffer. Is that a
possibility?
--
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.
------------------------------
Date: Sun, 19 Sep 1999 11:15:15 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: UNCRAP project proposal
Message-Id: <37e8c564.2139987@news.skynet.be>
Abigail wrote:
>Oh gosh, I could never do the second part. I just fail to understand
>why people prefer endless method calls over
> print <<END_OF_HTML;
> ...
> END_OF_HTML
>and just typing out what you want. CGI.pm's set of methods that output
>html tags seems to me as useful as an English.pm module with a method
>for every word, and using that instead of writing plain text. It's all
>too much 'oh-golly-this-looks-like-I-am-doing-OOP' just for the sake of
>looking like you're doing OOP.
So true. Especially if somebody else (a designer) created the example
HTML page, and you need to recreate it, but with different data. Then,
this approach is nonsense (and also pretty slow). And if you can get a
bootkick from a script like this...:
#!/usr/local/bin/perl -w
@ARGV or @ARGV = $0; #demo
undef $/;
while(<>) {
print STDERR "File: $ARGV\n";
open STDOUT,">$ARGV.pl"; # assuming "long file names" are OK
s/\012{0,2}\015|\012/\n/g; #convert usual line-ends to newline
# "\012\012\015" is for (probably incorrectly uploaded) HTML files
s/\n$//; # chomp() won't work, because $/ is undef
s/([\$\@\\])/\\$1/g; # quote specials
s/^#/\\#/gm; # now end-of-text marker is unique, and stands out
print <<"__EOT__";
print <<"##EOT##";
$_
##EOT##
__EOT__
}
__END__
--
Bart.
------------------------------
Date: Sun, 19 Sep 1999 12:43:02 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: UNCRAP project proposal
Message-Id: <37e4da21.245404@news.skynet.be>
Bart Lateur wrote:
Argh! Somebody kick me. I reversed the order of CR and LF. CR comes
first.
> s/\012{0,2}\015|\012/\n/g; #convert usual line-ends to newline
This is better:
s/\015\015?\012?|\012/\n/g;
> # "\012\012\015" is for (probably incorrectly uploaded) HTML files
That's "\015\015\012".
--
Bart.
------------------------------
Date: 19 Sep 1999 11:26:30 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Using a period as a delimiter in the split() function
Message-Id: <7s2h96$18g$1@gellyfish.btinternet.com>
On Sat, 18 Sep 1999 15:31:12 -0700 Larry Rosler wrote:
>
> You are pointing out a flaw in the evolution of this function: the
> interpretation of what is syntactically a string to have the semantics
> of a regex. The frequency of programmer error (often for '|') would
> indicate the appropriateness of some corrective action.
>
The '|' was certainly the first one that bit me but that was not to do
with a misunderstanding of the pattern nature of the first argument but
ignorance of the metacharacter nature of '|' but then there wasnt a 'perlre'
manpage in them days ...
/J\
--
Jonathan Stowe <jns@gellyfish.com>
<http://www.gellyfish.com>
Hastings: <URL:http://dmoz.org/Regional/UK/England/East_Sussex/Hastings>
------------------------------
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 847
*************************************