[22201] in Perl-Users-Digest
Perl-Users Digest, Issue: 4422 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jan 17 14:11:14 2003
Date: Fri, 17 Jan 2003 11:10:11 -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, 17 Jan 2003 Volume: 10 Number: 4422
Today's topics:
Re: Most efficient way to do this DBI thing? <bkennedy@hmsonline.com>
Re: most popular unix scripting language lvirden@yahoo.com
Re: Perl Module for "compressing" text (f u cn rd ths.. <ethan@draupnir.gso.saic.com>
Problems sending an image with perl (=?ISO-8859-1?Q?Adrian_Gardu=F1o?=)
Re: Problems sending an image with perl <perl-dvd@darklaser.com>
Re: Problems sending an image with perl <bongie@gmx.net>
Re: Recreating a MIME::Lite object (Ben Morrow)
Single Sign-On with XML and Perl <asasdf@arkansas.net>
Re: Single Sign-On with XML and Perl <koos_pol@NO.nl.JUNK.compuware.MAIL.com>
Re: Single Sign-On with XML and Perl (Tad McClellan)
Re: sysopen problem <bart.lateur@pandora.be>
XML::Parser::PerlSAX <slurper1234@hotmail.com>
Re: ~ Urgently require a Webpage Hit counter script !!? <koos_pol@NO.nl.JUNK.compuware.MAIL.com>
Re: ~ Urgently require a Webpage Hit counter script !!? (Tad McClellan)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 17 Jan 2003 12:50:02 -0500
From: "Ben Kennedy" <bkennedy@hmsonline.com>
Subject: Re: Most efficient way to do this DBI thing?
Message-Id: <OxSdnXuHVJXW37WjXTWcpg@giganews.com>
"Jeff Snoxell" <Jeff@aetherweb.co.uk> wrote in message
news:b089ou$q37$1@newsg2.svr.pol.co.uk...
>
> Surely there's got to be a nicer way of doing this that doesn't involve
all
> these variables?
>
You may want to look at the selectall_* and fetchall_* functions, see
perldoc DBI.
my $lol = $dbh->selectall_arrayref("SELECT ID, DATA FROM TAB");
You can now generally do whatever you want with a single 'map' call.
Another possibility is to take your existing code and stick it in a module -
the "ugly" factor can always be completely negated through modularization
and a well documented interface.
--Ben Kennedy
------------------------------
Date: 17 Jan 2003 18:00:59 GMT
From: lvirden@yahoo.com
Subject: Re: most popular unix scripting language
Message-Id: <b09gcr$i8f$3@srv38.cas.org>
According to Sara <genericax@hotmail.com>:
:claird@lairds.com (Cameron Laird) wrote in message
:news:<v2ekbhldaj4mf0@corp.supernews.com>...
:> In article <f51c02db.0301161617.3622cfaa@posting.google.com>,
:> dambalaMaster <dorli@hotmail.com> wrote:
:> >does anyone know which is the most popular unix scripting language?
:Accordind to DICE/monster, Perl IS the hands-down winner.
:> monster.com dice.com %
:>
:> SQL 5000 2486 24.06%
:>
:> ASP 2156 2480 14.90%
:>
:> Java 2664 1862 14.55%
:>
:> C++ 2046 1480 11.33%
:>
:> Visual Basic 2037 1095 10.07%
:>
:> Perl 925 548 4.73%
:>
:> Javascript 914 489 4.51%
:>
:> Cobol 595 532 3.62%
:>
:> SAS 805 269 3.45%
All you are identifying is the list of languages which appear on resumes.
In my experience, people put a lot of things on their resumes that do not
reflect reality. Not only that, no one has yet defined 'most popular' -
if someone has a million plus lines of applications in some particular
scripting languages, is that more popular than some other language which
has several hundred applications each of which are a few hundred lines long?
Or is the shorter more numerous applications more frequent?
Just because people use SQL a lot, does that mean that it is popular - or
just the primary language available to use? Perhaps the majority of people
hate it? Is it still popular if that were the case?
--
Tcl - The glue of a new generation. <URL: http://wiki.tcl.tk/ >
Even if explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.
<URL: mailto:lvirden@yahoo.com > <URL: http://www.purl.org/NET/lvirden/ >
------------------------------
Date: 17 Jan 2003 10:43:16 -0800
From: Ethan Brown <ethan@draupnir.gso.saic.com>
Subject: Re: Perl Module for "compressing" text (f u cn rd ths...)
Message-Id: <vrlm1jmxbv.fsf@draupnir.gso.saic.com>
>>>>> "Jay" == Jay Tilton <tiltonj@erols.com> writes:
Jay> Ethan Brown <ethan@draupnir.gso.saic.com> wrote:
Jay> : Does anyone know of a module to "compress" text, e.g.
Jay> : "If you can read this you can have a job as a perl programmer"
Jay> : =>
Jay> : "f u cn rd ths u cn hv a jb as a prl prgrmmr"
Jay> Have a look at Lingua::EN::Squeeze.
Perfect. Thank you very much!
--Ethan Brown
--In a band? Use http://www.WheresTheGig.com for free.
------------------------------
Date: 17 Jan 2003 08:23:58 -0800
From: mxnegocios@yahoo.com (=?ISO-8859-1?Q?Adrian_Gardu=F1o?=)
Subject: Problems sending an image with perl
Message-Id: <32be2e67.0301170823.25bfc186@posting.google.com>
Hi,
I'm trying to retrieve and image in a page using a CGI.
The page have this code:
<body>
<img name="perl01" src="/cgi-bin/test.pl" alt="">
</body>
and the script used is:
#!Perl.exe
print "Content-type: image/gif\n\n";
open(PIC, "apache_pb.gif");
print <PIC>;
close (PIC);
print "\n\n";
when I access the page, I get an image, but it sees bad.
I'm using an apache 2.0 server and perl form windows.
does anyone know what it's bad ?
Regards . . . .
------------------------------
Date: Fri, 17 Jan 2003 17:06:35 GMT
From: "David" <perl-dvd@darklaser.com>
Subject: Re: Problems sending an image with perl
Message-Id: <vKWV9.24$q81.7081@news-west.eli.net>
"Adrian Garduņo" <mxnegocios@yahoo.com> wrote in message
news:32be2e67.0301170823.25bfc186@posting.google.com...
> Hi,
> I'm trying to retrieve and image in a page using a CGI.
> The page have this code:
>
> <body>
> <img name="perl01" src="/cgi-bin/test.pl" alt="">
> </body>
>
> and the script used is:
>
> #!Perl.exe
> print "Content-type: image/gif\n\n";
> open(PIC, "apache_pb.gif");
> print <PIC>;
> close (PIC);
> print "\n\n";
>
> when I access the page, I get an image, but it sees bad.
> I'm using an apache 2.0 server and perl form windows.
>
> does anyone know what it's bad ?
> Regards . . . .
This code works perfectly for me:
##########################################
print("Content-type: Image/gif\n");
print("Pragma: no-cache\n");
print("Expires: Friday, 01-Aug-80 00:00:00 GMT\n\n");
local $/ = undef;
open(INFILE,'</path/to/image.gif');
my $img = <INFILE>;
close(INFILE);
binmode STDOUT;
print $img;
exit;
##########################################
Make special note of the binmode statement, that's important.
Regards,
David
------------------------------
Date: Fri, 17 Jan 2003 19:26:26 +0100
From: "Harald H.-J. Bongartz" <bongie@gmx.net>
Subject: Re: Problems sending an image with perl
Message-Id: <7503636.ZBe73L6k5k@nyoga.dubu.de>
David wrote:
> This code works perfectly for me:
>
> ##########################################
> print("Content-type: Image/gif\n");
> print("Pragma: no-cache\n");
> print("Expires: Friday, 01-Aug-80 00:00:00 GMT\n\n");
>
> local $/ = undef;
> open(INFILE,'</path/to/image.gif');
binmode INFILE;
> my $img = <INFILE>;
> close(INFILE);
> binmode STDOUT;
> print $img;
> exit;
> ##########################################
Ciao,
Harald
--
Harald H.-J. Bongartz <bongie@gmx.net>
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Interesting Error Messages #19:
Bad command or file name. Go stand in the corner.
------------------------------
Date: Fri, 17 Jan 2003 18:45:06 +0000 (UTC)
From: mauzo@mimosa.csv.warwick.ac.uk (Ben Morrow)
Subject: Re: Recreating a MIME::Lite object
Message-Id: <b09ivi$m5s$1@wisteria.csv.warwick.ac.uk>
Benjamin Goldberg <goldbb2@earthlink.net> wrote:
>Ben Morrow wrote:
>>
>> Michael Budash <mbudash@sonic.net> wrote:
>[snip]
>> >store $msg, 'file';
>> >my $msgcopy = retrieve('file');
>>
>> Have you tries this? My perl segfaults when I try to retrieve a
>> blessed ref, and certainly doesn't bless it back into the right
>> package.
>
>What version of perl is your perl, and what version of Storable is it
>running?
~% perl -v mauzo@mauzo
This is perl, v5.8.0 built for i686-linux-thread-multi
...
~% perl -MStorable -le'print $Storable::VERSION' mauzo@mauzo
2.04
It's the Storable.pm that came with the perl5.8.0 source tarball.
>Storable should be perfectly happy storing and retrieving blessed
>references, without segfaults.
~% cat testst mauzo@mauzo
#!/usr/local/bin/perl5.8.0
use Storable;
use Data::Dumper;
my $ref = \{};
bless $ref, "Package";
$\="\n";
print Dumper $ref;
store $ref, 'test';
my $nref = retrieve 'test';
print Dumper $nref;
~% ./testst mauzo@mauzo
$VAR1 = bless( do{\(my $o = {})}, 'Package' );
$VAR1 = bless( do{\(my $o = {})}, 'hlptx|******** ***********************' );
zsh: segmentation fault ./testst
The *s represent unprintable or high-bit-set characters, ending with
`A"A`E`I-D^O/O"U`a"a`e`i-d^o/o"u
(-D, -d are eths).
Is there any other knowledge would help work out what's wrong?
Ben
------------------------------
Date: Fri, 17 Jan 2003 10:29:29 -0600
From: "Joseph Shepapa" <asasdf@arkansas.net>
Subject: Single Sign-On with XML and Perl
Message-Id: <ZxSdnaJRpOJ8s7WjXTWcpg@arkansas.net>
Ladies and Gentlemen;
Most of us know that we can retrieve a cookie placed by a central
auth-domain using a redirect back to the auth-server.
My question to our group: Is it possible to use XML to query the
auth-server, and let the auth-server query it's cookie without a physical,
albeit brief, redirect?
If so, I'd appreciate any suggestions, feedback, or examples that anyone can
provide.
Thanks!
--
Joseph Sheppard
Network Operations Programmer
ANCI
------------------------------
Date: Fri, 17 Jan 2003 17:32:18 +0100
From: Koos Pol <koos_pol@NO.nl.JUNK.compuware.MAIL.com>
Subject: Re: Single Sign-On with XML and Perl
Message-Id: <newscache$ux9v8h$wfb$1@news.emea.compuware.com>
Joseph Shepapa wrote (Friday 17 January 2003 17:29):
> Ladies and Gentlemen;
>
> Most of us know that we can retrieve a cookie placed by a central
> auth-domain using a redirect back to the auth-server.
>
> My question to our group: Is it possible to use XML to query the
> auth-server, and let the auth-server query it's cookie without a physical,
> albeit brief, redirect?
>
> If so, I'd appreciate any suggestions, feedback, or examples that anyone
> can provide.
And what precisely is your Perl question? You are in the wrong group.
--
KP
------------------------------
Date: Fri, 17 Jan 2003 11:02:46 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Single Sign-On with XML and Perl
Message-Id: <slrnb2gdpm.4t4.tadmc@magna.augustmail.com>
Joseph Shepapa <asasdf@arkansas.net> wrote:
> Is it possible to use XML to query
No.
XML is _data_.
Data doesn't "do" anything. Data has things done _to it_.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 17 Jan 2003 18:05:35 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: sysopen problem
Message-Id: <efhg2vo0i4t8qc90emljolb2l9avbcn9rt@4ax.com>
Neil Trenholm wrote:
>use FCntl qw(:DEFAULT :flock);
Lower case "C".
--
Bart.
------------------------------
Date: Fri, 17 Jan 2003 16:18:44 GMT
From: slurper <slurper1234@hotmail.com>
Subject: XML::Parser::PerlSAX
Message-Id: <E1WV9.17762$ym5.2401@afrodite.telenet-ops.be>
i have a problem installing XML::Parser::PerlSAX from CPAN (linux RH7.3,
Perl 5.0.8)
when CPAN module does the 'make test', the t/stream test always fails
(t/stream...........FAILED test 11). how can i troubleshoot this??
it won't install
and other modules that depend on XML::Parser::PerlSAX neither.
tx
------------------------------
Date: Fri, 17 Jan 2003 17:26:18 +0100
From: Koos Pol <koos_pol@NO.nl.JUNK.compuware.MAIL.com>
Subject: Re: ~ Urgently require a Webpage Hit counter script !!??~
Message-Id: <newscache$un9v8h$wfb$1@news.emea.compuware.com>
inderjit S Gabrie wrote (Friday 17 January 2003 16:28):
> Hi all
>
>
> I am looking for a simple text webpage hit counter that would keep
> track of hits
> into a file or possible email them to me with e.g. date/time of hit,
> webpage
> accessed,users Ip no etc etc can this be done or does anyone have a
> script...thanks
> in advnace...indy
Have you ever considered reading the Perl FAQ? Or Google on the subject?
Ever? You really think you are the first with this question?
And if it is so very urgent, how much are willing to pay? I would be more
than happy to give you a quote.
--
KP
------------------------------
Date: Fri, 17 Jan 2003 11:58:30 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: ~ Urgently require a Webpage Hit counter script !!??~
Message-Id: <slrnb2gh26.4t4.tadmc@magna.augustmail.com>
inderjit S Gabrie <i.gabrie@mis.gla.ac.uk> wrote:
> Subject: ~ Urgently require a Webpage Hit counter script !!??~
^ ^^^^^^^^ ^^^^^^
Yet more Subject tricks. You should consider not hurting yourself
that way.
> I am looking for
You should use a "search engine" for searching.
This is a _discussion_ newsgroup. We discuss _writing_ Perl
code here.
> a simple text webpage hit counter
Despite all of that, looking for an existing counter is a
*much* better idea than attempting to write your own.
Start here:
http://nms-cgi.sourceforge.net/
And please read the Posting Guidelines that are posted here
weekly, before it is too late.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
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.
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 4422
***************************************