[23210] in Perl-Users-Digest
Perl-Users Digest, Issue: 5431 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 3 03:05:55 2003
Date: Wed, 3 Sep 2003 00:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 3 Sep 2003 Volume: 10 Number: 5431
Today's topics:
Re: checking whether user browser has cookies turned on <dorward@yahoo.com>
Re: checking whether user browser has cookies turned on <flavell@mail.cern.ch>
Re: checking whether user browser has cookies turned on (Tad McClellan)
circular use bug? <jt_60004@yahoo.com>
Re: circular use bug? (Sam Holden)
Re: circular use bug? <bwalton@rochester.rr.com>
Re: Comments in templates for pack() <minceme@start.no>
Perl Palm::PDB modules Error: Bad AppInfo offset: (psyshrike)
Re: Problem with Date::Manip, taint mode, and CGI::Carp <noreply@gunnar.cc>
Re: Problem with Date::Manip, taint mode, and CGI::Carp (James Willmore)
Re: Reading a scalar line by line <dillon@SpamMinuSaccessdenied.darktech.org>
Re: Reading a scalar line by line <dillon@SpamMinuSaccessdenied.darktech.org>
Re: Reading a scalar line by line (Sam Holden)
Re: Reading a scalar line by line <dillon@SpamMinuSaccessdenied.darktech.org>
View NG with Net::NNTP (Mike)
Re: View NG with Net::NNTP <jwillmore@cyberia.com>
Re: View NG with Net::NNTP (Tad McClellan)
Re: What ever happened to comp.lang.perl ? <tcurrey@no.no.no.i.said.no>
Re: What ever happened to comp.lang.perl ? <tcurrey@no.no.no.i.said.no>
Re: What ever happened to comp.lang.perl ? (Tad McClellan)
Re: What ever happened to comp.lang.perl ? (Tad McClellan)
Win32::File::GetAttributes() faster than -f and -d <cs@edu.edu>
Re: <bwalton@rochester.rr.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 02 Sep 2003 23:17:22 +0100
From: David Dorward <dorward@yahoo.com>
Subject: Re: checking whether user browser has cookies turned on?
Message-Id: <bj34ms$4vm$2$830fa79f@news.demon.co.uk>
Mina Naguib wrote:
>> Specifically my application will try to retrieve a session
>> key from the user's browser.
> 3. In the CGI, check to see if test cookie was received or not. Output
> another redirect to your site's main page (via HTTP Location: header) on
> success,
and switch to using another method for session tracking (e.g. query string)
on a failure.
> or an error message/apology/instructions on failure.
^W^W^W^W^W^W^W^W
--
David Dorward http://dorward.me.uk/
------------------------------
Date: Wed, 3 Sep 2003 01:09:55 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: checking whether user browser has cookies turned on?
Message-Id: <Pine.LNX.4.53.0309030049200.30053@lxplus084.cern.ch>
On Tue, Sep 2, Kenjis Kaan inscribed on the eternal scroll:
> I am developing a web application that make use of the user
> browser's cookies mechanism.
Then you're in the wrong place here: the closest match would probably
be comp.infosystems.www.authoring.cgi
Once you'd worked out the strategy for what you want to do, then if
you had problems with programming it in Perl then it would be the
right time to come back here with those Perl problems.
> Specifically my application will try to retrieve a session
> key from the user's browser.
Wrong mental model. You don't "retrieve" cookies "from the user's
browser". If you send them one (or more): they might consent to send
them back, along with their subsequent requests. You get to read them
if they're there. Your server doesn't get to go raiding their cookie
store, in other words: the browser model is client-driven, and it
works better (for you as for them) to keep that in mind.
> However I have a problem. My program
> doesn't know how to handle the case when the user's browser has the
> cookies mechanism turned OFF!
Take a look in the configuration options of any decent modern browser,
such as Mozilla. The user can consent to accept cookies selectively
according to the domain, they can ask to be prompted and accept or
reject eack cookie as it arrives; they can enable and disable the
sending of cookies at any moment.
If you assume, as so many beginners do, that you can just send them a
test cookie and see whether it comes back again on the next request,
and then assume that any other cookie will behave like that throughout
the whole activity, then it's likely that you'll get into quite a
mess.
> This is because I don't know how to find out from perl code whether
> the user's browser has cookies turned off or on??
You can't know that. So don't ask that question. Send them an
appropriate cookie (if you feel you must...*). If that cookie
subsequently arrives with a request, then it arrived and you may use
it; if it doesn't then you need to do something else. Just why it
didn't arrive is none of your business, in detail: they might have
refused it when it arrived; they might have set their browser to
reject all cookies that come from .com domains; they might have
accepted it when it came, and later decided to turn cookies off. And
so on. So stop worrying about whether (and how) they've got cookies
configured, and focus on whether cookies arrive with a particular
request.
> I am using CGI.pm
A good choice, indeed: but it only gives you convenient access to
whatever the underlying mechanisms are capable of. Which is what
counts for the purpose of your current question IMHO.
good luck
(* you'll be aware that some users treat cookies as a privacy issue;
also, the unnecessary use of cookies inhibits cacheability and thus
makes for a less-responsive web experience).
------------------------------
Date: Wed, 3 Sep 2003 00:52:27 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: checking whether user browser has cookies turned on?
Message-Id: <slrnblb0cr.30j.tadmc@magna.augustmail.com>
Mina Naguib <spam@thecouch.homeip.net> wrote:
> Kenjis Kaan wrote:
>> My program
>> doesn't know how to handle the case when the user's browser has the
>> cookies mechanism turned OFF!
> First hit to the site:
> 1. Send test cookie
> 2. Send page that re-directs (via meta-refresh and/or javascript) to a cookie-checker CGI
> 3. In the CGI, check to see if test cookie was received or not. Output another redirect to your
> site's main page (via HTTP Location: header) on success, or an error message/apology/instructions on
> failure.
Note the language-agnostic answer.
The question had nothing to do with Perl.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 02 Sep 2003 23:46:16 GMT
From: Jim Thomason <jt_60004@yahoo.com>
Subject: circular use bug?
Message-Id: <jt_60004-814CE2.18461502092003@netnews.attbi.com>
I'm strongly leaning towards declaring this a bug and being done with
it, but I wanted to ask here to see if anyone can explain it. I have 2
packages, which use each other.
======
package a
======
package a;
use strict;
use warnings;
use b;
sub foo_a {print "a in foo\n"};
1;
======
package b
======
package b;
use lib '.';
use a qw(from b);
sub foo_b {print "b in foo\n"};
1;
===
All well and good. a uses b. b uses a.
So, here's my connundrum:
[kalel:~] jim% perl -c a.pm
Subroutine foo_a redefined at a.pm line 13.
a.pm syntax OK
But:
[kalel:~] jim% perl -Ma -e '1'
[kalel:~] jim%
Further testing has demonstrated that in all cases I can throw at it, if
I -c a module with a circular use, I get a warning about a redefined
subroutine. However, if I use the module as part of a script, I get no
warning.
Additionally, one thing that I've isolated is that if I use a script,
then %INC is populated immediately. Here:
=====
new package a
=====
package a;
BEGIN {print "BEGINNING IMPORT OF a\n"};
BEGIN {print map {"a> $_ => $INC{$_}\n"} keys %INC};
use strict;
use warnings;
use lib '.';
use b;
sub foo_a {print "a in foo\n"};
1;
#!/usr/bin/perl
use strict;
use warnings;
BEGIN {print map {"w> $_ => $INC{$_}\n"} keys %INC};
use a;
[kalel:~] jim% ./test.pl
w> Exporter.pm => /System/Library/Perl/Exporter.pm
w> Carp.pm => /System/Library/Perl/Carp.pm
w> strict.pm => /System/Library/Perl/strict.pm
w> warnings.pm => /System/Library/Perl/warnings.pm
BEGINNING IMPORT OF a
a> Exporter.pm => /System/Library/Perl/Exporter.pm
a> Carp.pm => /System/Library/Perl/Carp.pm
a> strict.pm => /System/Library/Perl/strict.pm
a> warnings.pm => /System/Library/Perl/warnings.pm
a> a.pm => a.pm
Note that %INC comes in with values.
However,
[kalel:~] jim% perl -c a.pm
BEGINNING IMPORT OF a
BEGINNING IMPORT OF a
a> Exporter.pm => /System/Library/Perl/Exporter.pm
a> Carp.pm => /System/Library/Perl/Carp.pm
a> b.pm => b.pm
a> strict.pm => /System/Library/Perl/strict.pm
a> Config.pm => /System/Library/Perl/darwin/Config.pm
a> warnings.pm => /System/Library/Perl/warnings.pm
a> a.pm => a.pm
a> lib.pm => /System/Library/Perl/lib.pm
Subroutine foo_a redefined at a.pm line 14.
a.pm syntax OK
The first time that a.pm is imported, %INC is unpopulated in any form.
Only once b.pm uses a, does %INC get populated.
Incidentally, best as I can tell, a is used, then b is used, which uses
a. This subsequent use of a compiles the subroutine. b then finishes
compiling and the stack reverts back to compiling a, which re-compiles
the same subroutine. moving the 'use b' line in a to the end of the file
only succeeds in changing the order in which the subroutine is
re-defined (i.e., it's first compiled as part of 'a', then 'b' uses 'a'
and re-compiles it)
Now, to me, this is all rather buggy behavior. Especially considering
the fact that it warns me with -c a.pm but not with my test script (or
-Ma -e '1'
So, is there a clear explanation of this phenomenon? Or should I just
declare it a bug and be done with it?
FWIW, I see the same problem under 5.6.0 on OS X (10.2.6) and 5.8.0
under linux (dunno the distro)
Thanks,
-Jim......
------------------------------
Date: 3 Sep 2003 00:26:49 GMT
From: sholden@flexal.cs.usyd.edu.au (Sam Holden)
Subject: Re: circular use bug?
Message-Id: <slrnblada9.4nb.sholden@flexal.cs.usyd.edu.au>
On Tue, 02 Sep 2003 23:46:16 GMT, Jim Thomason <jt_60004@yahoo.com> wrote:
[ snip code which is essentially:
a.pm:
package a;
use b;
#...stuff...
b.pm:
package b;
use a;
#...stuff...
]
> So, here's my connundrum:
>
> [kalel:~] jim% perl -c a.pm
> Subroutine foo_a redefined at a.pm line 13.
> a.pm syntax OK
>
> But:
>
> [kalel:~] jim% perl -Ma -e '1'
> [kalel:~] jim%
[snippage]
>
> Now, to me, this is all rather buggy behavior. Especially considering
> the fact that it warns me with -c a.pm but not with my test script (or
> -Ma -e '1'
>
> So, is there a clear explanation of this phenomenon? Or should I just
> declare it a bug and be done with it?
When you do "perl -c a.pm" you are telling perl to run (well check in this
case) the script a.pm. Perl does that. b.pm gets loaded by the "use b",
then a.pm gets loaded by the "use a". a.pm the "module" and a.pm the
"script", even though they are the same file, are not related to perl.
When you do "perl -Ma -e '1'" a.pm and b.pm both get loaded as modules,
and hence there is no problem.
Perl does not populate %INC with the scipt it is told to run.
The solution is "don't do that". Don't run the a.pm module as a script. If
it doubles as a script then create another file containing "use a;" and use
that as the script.
You will get the same problem without the circular inclusion with:
$ cat c.pm
package c;
sub foo_c { }
1;
$ perl -w -Mc c.pm
Subroutine foo_c redefined at c.pm line 2.
--
Sam Holden
------------------------------
Date: Wed, 03 Sep 2003 01:32:33 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: circular use bug?
Message-Id: <3F554482.5050003@rochester.rr.com>
Jim Thomason wrote:
> I'm strongly leaning towards declaring this a bug and being done with
> it, but I wanted to ask here to see if anyone can explain it. I have 2
> packages, which use each other.
>
> ======
> package a
> ======
>
> package a;
>
> use strict;
> use warnings;
> use b;
>
> sub foo_a {print "a in foo\n"};
>
>
> 1;
>
>
> ======
> package b
> ======
>
> package b;
>
> use lib '.';
> use a qw(from b);
>
> sub foo_b {print "b in foo\n"};
>
> 1;
>
> ===
>
>
> All well and good. a uses b. b uses a.
>
> So, here's my connundrum:
>
> [kalel:~] jim% perl -c a.pm
> Subroutine foo_a redefined at a.pm line 13.
Your a.pm as shown doesn't have a line 13. ??? You're not putting the
thing you intend as module b into file a.pm also, are you? Oh, now that
I tried it, I see that you did. Modules (as requested in use()
statements) must reside in their own module_name.pm file, because that's
how use() looks for them. The "circular use" should not be an issue as
long as "use a;" isn't executed in a.pm during a "use a;" (or equivalent
like your perl -c a.pm above) that is already in progress (which happens
if you put module b, containing a use a;, in a.pm).
Also, see below for some commentary on the cross-platform consequences
of your unfortunate choice of "b" for a module name.
...
> -Jim......
>
If you were running this on Windoze (yeah, I know, you weren't, but
portability of example programs should be a goal), note that there is
already a package B defined in the standard distribution. Windoze files
are not case-sensitive, so Perl (via Windoze) finds the B module and
uses it when you thought you were asking for your b module. So you
don't pick up the module you thought you were, plus after loading B,
Perl then looks for b and finds nothing, so does nothing. Try renaming
your b.pm to bb.pm and making the package therein be package bb; etc.
That's another variant of the problem that plagues Windoze users when
they use Strict; instead of use strict;, or blow the case of any other
module name.
--
Bob Walton
------------------------------
Date: Tue, 2 Sep 2003 22:52:23 +0000 (UTC)
From: Vlad Tepes <minceme@start.no>
Subject: Re: Comments in templates for pack()
Message-Id: <bj36v7$8ep$1@troll.powertech.no>
Louis Erickson <wwonko@rdwarf.com> wrote:
> Vlad Tepes <minceme@start.no> wrote:
>
>: So it's the pack()-function that interprets the hash-character as
>: start-of-comment, and not the tokenizer.
>
> No, not at all. If you say:
( snip )
> If your # sign was outside the string, then it would be correctly
> viewed as a comment.
pack()'s templates can also include comments.
Otherwise this snippet:
my @data = qw( foo foooo fooobar );
my $packed = pack "A3 # A3 means three ascii chars
A5 # A5 five
A7 # A7 seven ", @data;
print join "\n", unpack "A3A5A7", $packed;
... wouldn't produce this output:
foo
foooo
fooobar
Except from a possible confusion of the terms "tokenizer" and "parser",
I have no trouble with this anymore. In fact, the whole problem was me
posting at a time when I should have been sleeping ...
Regards,
--
Vlad
------------------------------
Date: 2 Sep 2003 17:39:59 -0700
From: shrike@cyberspace.org (psyshrike)
Subject: Perl Palm::PDB modules Error: Bad AppInfo offset:
Message-Id: <79485f9d.0309021639.1d390f4f@posting.google.com>
Hey,
I have installed all of the Palm::Whatever modules. This error creeps
up for every PDB I am running pdbdump against, regardless of what
helper module I use:
Bad AppInfo offset: expected 0x000000218 but I'm at 522
I am using windows XP, and Activestates Perl 5.6.1
I found where in the PDB module this error is originated. But I am
guessing at the cause, and I'd rather not have to reverse engineer
this whole module to get a clue what is going on.
Could somebody shine a light on this for me?
-Thanks in advance
-Matt
-Crosswire Industries Inc.
------------------------------
Date: Wed, 03 Sep 2003 01:01:08 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Problem with Date::Manip, taint mode, and CGI::Carp.
Message-Id: <bj37ik$eproc$1@ID-184292.news.uni-berlin.de>
Louis Erickson wrote:
> Apparently CGI::Carp('fatalsToBrowser') breaks Date::Manip's check
> to see if we're in Taint mode.
>
> If I have a script:
>
> #!/usr/bin/perl -T
> use strict;
> use warnings;
>
> # Uncomment this to break the script.
> #use CGI::Carp('fatalsToBrowser');
>
> BEGIN {
> $ENV{PATH}='/bin:/usr/bin';
> require Date::Manip;
> Date::Manip->import();
> Date::Manip::Date_Init("Internal=1");
> }
>
> __END__
The above works fine for me with Perl 5.8.0 on W98, also when I use
'fatalsToBrowser'. Maybe it's a version inconsistency thing.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: 2 Sep 2003 19:02:19 -0700
From: jwillmore@cyberia.com (James Willmore)
Subject: Re: Problem with Date::Manip, taint mode, and CGI::Carp.
Message-Id: <e0160815.0309021802.6038a824@posting.google.com>
Louis Erickson <wwonko@rdwarf.com> wrote in message news:<biuk8d$89q$1@holly.rdwarf.com>...
>
> #!/usr/bin/perl -T
> use strict;
> use warnings;
>
> # Uncomment this to break the script.
> #use CGI::Carp('fatalsToBrowser');
>
> BEGIN {
> $ENV{PATH}='/bin:/usr/bin';
> require Date::Manip;
> Date::Manip->import();
> Date::Manip::Date_Init("Internal=1");
> }
>
> __END__
>
> Anyone have any idea why, or what's to be done about this? I can copy and
> paste the line in Date::Manip that breaks in to my own script, and it works
> fine; it's only a problem in Date::Manip.
Just a stab in the dark here, but have you moved the 'use CGI::Carp
...' line _below_ the BEGIN block of your script? I'm thinking that,
because you're setting your PATH in the BEGIN block, the CGI::Carp
module is being flagged as 'tainted'.
Again - just a stab in the dark.
HTH
Jim
------------------------------
Date: Wed, 03 Sep 2003 12:25:07 +0800
From: AcCeSsDeNiEd <dillon@SpamMinuSaccessdenied.darktech.org>
Subject: Re: Reading a scalar line by line
Message-Id: <njqalv4s7btot2fnv7ffn5pn0t3u5dhtjh@4ax.com>
On Tue, 02 Sep 2003 18:44:47 +0200, Tore Aursand <tore@aursand.no> wrote:
> while ( split(/\n/, $string) ) {
> print $_;
> }
That didn't work. Looks like it was going into a continuous loop.
>Why do you keep separate lines in a scalar anyway? I find it handier to
>keep them in a list.
Scalar was provided by a module.
To e-mail, remove the obvious
------------------------------
Date: Wed, 03 Sep 2003 12:37:07 +0800
From: AcCeSsDeNiEd <dillon@SpamMinuSaccessdenied.darktech.org>
Subject: Re: Reading a scalar line by line
Message-Id: <nlralvkjm5126kovum9qsn0s6jln4lphj8@4ax.com>
On Tue, 02 Sep 2003 17:43:06 GMT, Brian Harnish <bharnish@technologist.com> wrote:
>I believe you are looking for something like this "print $_ for(<>)" for
>strings instead of files.
>
>print $_ for(split(/\n/, $string));
>or
>for(split(/\n/, $string)){
> print $_;
>}
Yes! Thanks that did the trick
>Or, by "something like" do you mean non-working code? Because _$ doesn't
>exist.
Yes that was non-working code.
Ehh....but I made a typo with '_$'.
Sorry, been away from perl pretty long.
>Obvious to who? Is removing just "SpamMinus" supposed to be obvious? or
>just "Spam"?
The first one's right.
Sorry I don't state exactly what 'obvious' means because a few 'email harvesters' are known to read
the body of the message, and look for stuffs like 'remove....' and you know the rest of the story.
And why not? We could easily design one in Perl :)
To e-mail, remove the obvious
------------------------------
Date: 3 Sep 2003 04:37:00 GMT
From: sholden@flexal.cs.usyd.edu.au (Sam Holden)
Subject: Re: Reading a scalar line by line
Message-Id: <slrnblarvc.8b0.sholden@flexal.cs.usyd.edu.au>
On Wed, 03 Sep 2003 12:25:07 +0800,
AcCeSsDeNiEd <dillon@SpamMinuSaccessdenied.darktech.org> wrote:
> On Tue, 02 Sep 2003 18:44:47 +0200, Tore Aursand <tore@aursand.no> wrote:
>
>> while ( split(/\n/, $string) ) {
>> print $_;
>> }
>
> That didn't work. Looks like it was going into a continuous loop.
Replace while with for.
And maybe print $_ with print $_,"\n"...
--
Sam Holden
------------------------------
Date: Wed, 03 Sep 2003 12:39:03 +0800
From: AcCeSsDeNiEd <dillon@SpamMinuSaccessdenied.darktech.org>
Subject: Re: Reading a scalar line by line
Message-Id: <ovralv4ojp959fuepgdg944hju7s6duo5f@4ax.com>
On Tue, 2 Sep 2003 10:44:45 -0700, "David Oswald" <print split
/!/"d!a!v!i!d!o!@!p!a!c!i!f!i!e!r!.!c!o!m!\n"> wrote:
>First, there is no such thing as _$. You must mean $_. Now to answer your
>question:
Sorry, it's just that I've been away from perl for sometime
Got enough perl books.
>Do this:
>
>foreach ( split /\n/, $string ) {
> print;
>}
Yes that works too. Thanks.
To e-mail, remove the obvious
------------------------------
Date: 2 Sep 2003 21:39:39 -0700
From: csdude@hotmail.com (Mike)
Subject: View NG with Net::NNTP
Message-Id: <46cdc619.0309022039.723ec45a@posting.google.com>
I tried posting a few minutes ago via Google, and got an ISE, so
please forgive me if I'm repeating.
I have a client that would really benefit from allowing his visitors
to read a specific newsgroup on his site. I've been looking through
some modules, and even though a lot of the standard modules mention
this, I haven't been able to find any actual references so I think I
might be misunderstanding the wording in the modules.
Specifically, I want to be able to show the most recent, say, 20
article headers from a specific newsgroup, then when the visitor
selects an article then they can read the body. Then, I want to give
the visitor an option to post to that NG.
So far, I've researched LWP::UserAgent and Net::NNTP. Both seem like
they're talking about viewing and posting, but all of the references
I'm finding are about posting. Can either of these let me view the
articles themselves? I don't think I'll have a problem with posting,
just viewing.
TIA,
Mike
------------------------------
Date: Wed, 03 Sep 2003 05:28:14 GMT
From: James Willmore <jwillmore@cyberia.com>
Subject: Re: View NG with Net::NNTP
Message-Id: <20030903012807.6881bc4d.jwillmore@cyberia.com>
On 2 Sep 2003 21:39:39 -0700
csdude@hotmail.com (Mike) wrote:
> So far, I've researched LWP::UserAgent and Net::NNTP. Both seem like
> they're talking about viewing and posting, but all of the references
> I'm finding are about posting. Can either of these let me view the
> articles themselves? I don't think I'll have a problem with posting,
> just viewing.
This is just a sample (I cut up a script I just recently started
working on, so _don't_ consider it production quaility).
==untested==
#!/usr/bin/perl -w
use strict;
use Net::NNTP;
my($SERVER, $nntp, $articles, $first, $last, $ng_name);
$SERVER = 'localhost';
$nntp = Net::NNTP->new($SERVER, Debug=>0)
or die "Can't connect to server $SERVER: $!\n";
($articles,$first,$last,$ng_name) =
$nntp->group('comp.lang.perl.misc');
printf("%s: %5d articles (%-5d to
%-5d)\n",$ng_name,$articles,$first,$last);
while(my $fh = $nntp->articlefh){
while(<$fh>){
print;
}
$nntp->next;
}
$nntp->quit;
==untested==
This will print each message in the newsgrop indicated. It takes some
re-reading of the Net::NNTP documentation to get a full understanding
of it.
HTH
--
Jim
---
Copyright notice: all code written by the author in this post is
released under the GPL. http://www.gnu.org/licenses/gpl.txt
for more information.
---
a real quote ...
Linus Torvalids: "They are somking crack ...."
(http://www.eweek.com/article2/0,3959,1227150,00.asp)
---
a fortune quote ...
Iron Law of Distribution: Them that has, gets.
------------------------------
Date: Wed, 3 Sep 2003 01:12:57 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: View NG with Net::NNTP
Message-Id: <slrnblb1j9.30j.tadmc@magna.augustmail.com>
Mike <csdude@hotmail.com> wrote:
> I have a client that would really benefit from allowing his visitors
> to read a specific newsgroup on his site.
> Specifically, I want to be able to show the most recent, say, 20
> article headers from a specific newsgroup, then when the visitor
> selects an article then they can read the body. Then, I want to give
> the visitor an option to post to that NG.
Net::NNTP can be used to do that.
> So far, I've researched LWP::UserAgent and Net::NNTP.
Eh?
Those are two totally different beasties, they don't even
use the same protocol.
UserAgent is for automating web forms (so it uses HTTP).
> Can either of these let me view the
> articles themselves?
Yes, Net::NNTP::article() can retrieve the headers and body
of a newsgroup article.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 2 Sep 2003 20:39:25 -0700
From: "Trent Curry" <tcurrey@no.no.no.i.said.no>
Subject: Re: What ever happened to comp.lang.perl ?
Message-Id: <bj3o1e$go6$1@news.astound.net>
"Tad McClellan" <tadmc@augustmail.com> wrote in message
news:slrnbkkfo5.gh8.tadmc@magna.augustmail.com...
> Islaw <islaw@adexec.com> wrote:
>
>
> > Some things never change...
>
>
> It would be nice if they would jsut change sometimes.
Well, for anything to change it'll take an effort from a great many people
in the group.
------------------------------
Date: Tue, 2 Sep 2003 20:58:28 -0700
From: "Trent Curry" <tcurrey@no.no.no.i.said.no>
Subject: Re: What ever happened to comp.lang.perl ?
Message-Id: <bj3p55$hfp$1@news.astound.net>
"Alan J. Flavell" <flavell@mail.cern.ch> wrote in message
news:Pine.LNX.4.53.0308231631110.5173@lxplus087.cern.ch...
> On Fri, Aug 22, Matt Garrish inscribed on the eternal scroll:
> wanna-be-teachers would hold court on the beginners group, while most
> but beginners would ask their questions on the non-beginner group
> anyway, because they'd know that's where the experts hang out.
Well why is it that this group is mentioned in the top Perl books, like the
camel/llama books, books that you'd expect a beginner to pick up. This is
just one of the way such beginner have been lured here over the years. Then
everyone wonders why they come here. They have often been ridiculed becasue
they did not check the FAQs or go to news.newuser, when it should be
plainally obvious that beginners would probably not even know of the news.*
groups, unless they were from they grew up a decade earlier and had unix
surroundings in their upringing.
The fact is, if you were just getting into computers around the mid 90's,
chances are they wouldnt know much of usenet or the "old way"s that have
been around, yet they were expected to know all the rules. I know some jsut
wanted "a quick and dirty" script, and some had better reasons then others,
but when in the end it all resulted in a flame war, it realy served no one,
and in fact hurt this group, as well as others out there (it doesn't just
apply to this group, saddly.)
> [1] my admiration goes out to those who hang out on
> news.newusers.questions to do just that (hi Jon); it's not
> a task that I could cope with, to be fran^W candid.
>
> Speaking now for myself, I'm no expert here: there's a few areas where
> I think I know what I'm talking about, but for the most part I come
> here as much to learn from those who know better, and to pay some of
> that back by sharing the bits I do know. And that's what Usenet is
> all about, IMHO.
>
> > is it perhaps time to do something?
>
> Some of the problems are ongoing, and have been a feature of Usenet
> ever since September (YKWIM, see Abigail's standard dateline). Some
> of the proposed solutions are IMHO considerably worse than the
> disease. I say let's just try to get along on the basis of fair
> shares, and try not to waste too much effort on those who insist on
> spoiling the party.
While most of this is true, the last bit I must comment on: you assume that
everytime some "came into" the "party", that it was their intention to spoil
it? I think part of the problem has ben the constant assuming that someone
was lazy, or didnt do any outside research, or didnt look at the FAQ. Many
people seem to beleive that the FAQ and Perldoc are the be all, end all, and
that every single person who reads them will understand them, or how to use
them (in the case of Perldoc), no matter how good a doc each may be (which
they are.)
As I seen posted many times in the days of yore, sometimes it's better to
simply ignore or go on to the next thread if that particular if you find one
to be so distateful and just no worth it.
> all the best
One can only hope.
------------------------------
Date: Wed, 3 Sep 2003 00:47:04 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: What ever happened to comp.lang.perl ?
Message-Id: <slrnblb02o.30j.tadmc@magna.augustmail.com>
Trent Curry, Islaw, krakle, MJ Owens, Cpt Fredo, Manny Wilco, Robin Givens
and a cast of thousands wrote:
> been around, yet they were expected to know all the rules. I know some jsut
^^^^
^^^^
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 3 Sep 2003 01:29:19 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: What ever happened to comp.lang.perl ?
Message-Id: <slrnblb2hv.333.tadmc@magna.augustmail.com>
Trent Curry <tcurrey@no.no.no.i.said.no> Islaw <islaw@adexec.com> wrote:
> "Tad McClellan" <tadmc@augustmail.com> wrote in message
> news:slrnbkkfo5.gh8.tadmc@magna.augustmail.com...
>> Islaw <islaw@adexec.com> wrote:
>>
>>
>> > Some things never change...
>>
>>
>> It would be nice if they would jsut change sometimes.
^^^^
^^^^
I say, I say, I say, that was a joke son!
> Well, for anything to change it'll take an effort from a great many people
> in the group.
Yeah, they'd all have to check the FAQs before posting and ask a
question that was about Perl.
Never happen.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 02 Sep 2003 20:29:59 -0700
From: Chief Squawtendrawpet <cs@edu.edu>
Subject: Win32::File::GetAttributes() faster than -f and -d
Message-Id: <3F556037.30218FC3@edu.edu>
I find that Win32::File::GetAttributes() is faster than Perl's
built-in -d and -f file test operators, which seems counter-intuitive
to me. Did I go astray somewhere in my testing (shown below for -f)?
Is there any reason not to switch to GetAttributes() when speed is an
issue? Perhaps this is well-known, but I didn't find much in a Google
search.
Chief S.
$^W = 1;
use strict;
use Win32::File qw(GetAttributes DIRECTORY);
use Benchmark;
my ($x, @f);
$x = 0;
@f = qw(
C:\WINDOWS
C:\WINDOWS\WIN.INI
C:\WINDOWS\TEMP
C:\WINDOWS\not_a_file.txt
);
timethese( 10000, {
GetAtt => sub {
for (@f){
GetAttributes($_, $x);
$x = ($x > 0 and !($x & DIRECTORY)) ? 1 : 0;
}
},
fileTest => sub {
for (@f){
$x = -f $_ ? 1 : 0;
}
},
} );
Benchmark: timing 10000 iterations of GetAtt, fileTest...
GetAtt: 16 wallclock secs (16.04 usr + 0.00 sys = 16.04 CPU)
fileTest: 25 wallclock secs (24.39 usr + 0.00 sys = 24.39 CPU)
------------------------------
Date: Sat, 19 Jul 2003 01:59:56 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re:
Message-Id: <3F18A600.3040306@rochester.rr.com>
Ron wrote:
> Tried this code get a server 500 error.
>
> Anyone know what's wrong with it?
>
> if $DayName eq "Select a Day" or $RouteName eq "Select A Route") {
(---^
> dienice("Please use the back button on your browser to fill out the Day
> & Route fields.");
> }
...
> Ron
...
--
Bob Walton
------------------------------
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 5431
***************************************