[23078] in Perl-Users-Digest
Perl-Users Digest, Issue: 5299 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jul 31 14:05:41 2003
Date: Thu, 31 Jul 2003 11:05:12 -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 Thu, 31 Jul 2003 Volume: 10 Number: 5299
Today's topics:
Re: <input type='image'> ... IE fails to pass value w (John Everett)
Re: <input type='image'> ... IE fails to pass value w <nobull@mail.com>
[OT] Re: Announcing issue 2 of The Agile Developer's Li <glex_nospam@qwest.net>
Re: Announcing issue 2 of The Agile Developer's Life fr <borcis@users.ch>
Re: Anyone build the Berkeley DBXML library for AS and <dave@sleepycat.com>
Re: error validation question (Peter Stokes)
Re: error validation question <grazz@pobox.com>
Re: error validation question (Tad McClellan)
Re: how to know the week of today? <emschwar@ldl.fc.hp.com>
Re: LWP::Simple and authentication (reggie)
Re: LWP::Simple and authentication (reggie)
Re: LWP::Simple and authentication <cpryce@pryce.nospam.net>
Re: Perl Objects <grazz@pobox.com>
Perl Project Logic Question <tylercruz@hotmail.com>
Re: regular expression question <fty@utk.edu>
Re: semaphore example needed (Greg Bacon)
Re: semaphore example needed <perseus_medusa@hotmail.com>
Re: Sorting question <tzz@lifelogs.com>
splicing two arrays <mpapec@yahoo.com>
Re: Transmutation of objects?? <nobull@mail.com>
Re: Web development and Perl 6 <g4rry_sh0rt@zw4llet.com>
Re: Web development and Perl 6 <uri@stemsystems.com>
Re: Web development and Perl 6 (Tad McClellan)
Re: Web page with frames... <dhbrown@hobbes.dhbrown.net>
Re: Web page with frames... <dhbrown@hobbes.dhbrown.net>
Re: Web page with frames... <emschwar@ldl.fc.hp.com>
Re: Web page with frames... <todd@tdegruyl.com>
Why, oh why have I read "Perl 6 essentials"??? (Simon)
Re: <bwalton@rochester.rr.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 31 Jul 2003 09:03:37 -0700
From: john_k_everett@hotmail.com (John Everett)
Subject: Re: <input type='image'> ... IE fails to pass value while Mozilla and Netsacpe works
Message-Id: <e3da9316.0307310803.6248db41@posting.google.com>
Newsgroup...
Thanks for the insight and the abuse.
Made me feel all warm and fuzzy inside.
This news group is full of Perl CGI questions.
Seemed like a wise place to post.
Suppose not.
I strongly suggust that this group becomes a
moderated group before someone has a heart attack ;-)
-John
------------------------------
Date: 31 Jul 2003 17:56:00 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: <input type='image'> ... IE fails to pass value while Mozilla and Netsacpe works
Message-Id: <u9ispifxen.fsf@wcl-l.bham.ac.uk>
john_k_everett@hotmail.com (John Everett) writes:
> This news group is full of Perl CGI questions.
This is true. And so long as they really are _Perl_ CGI questions
(and not FAQs and not SAQs and not trivially answered in the manual)
they are accepted.
If they are actually language independant CGI questions that happen to
be expressed in Perl then you'll find they are met with varying
degrees of annoyance depending on how obvious it is that they are
language independant.
Language independant CGI questions that make no mention of Perl are
almost always met with distain.
> Seemed like a wise place to post.
Why would that be? Even if you'd falsely concluded that non-Perl CGI
questions were on-topic here, your question not only had nothing to do
with Perl, it also had nothing to do with CGI. Your question was
purely one about HTML and web browsers.
> Suppose not.
>
> I strongly suggust that this group becomes a
> moderated group before someone has a heart attack ;-)
No, people should take responsibility for their own actions.
People should lurk for a while to figure out what is and what is not
considered acceptable. Note: the fact that some topic is often posted
about here does not mean you can infer it's on-topic. Before you
could infer that you'd have to check that it doesn't always draw a
chorus of diapproval.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Thu, 31 Jul 2003 10:16:34 -0500
From: "J. Gleixner" <glex_nospam@qwest.net>
Subject: [OT] Re: Announcing issue 2 of The Agile Developer's Life free eZine
Message-Id: <coaWa.13$BF3.18999@news.uswest.net>
DevCoach wrote:
> I have just published the second issue of The Agile Developer's Life
> (formerly called The Agile Life), a free eZine devoted to the human
> side of software development. This issue contains an article on
> creativity and software development.
To gain or retain any credibility, you should hire someone to do your
Web Development or at least try your Web site before posting to multiple
groups.
------------------------------
Date: Thu, 31 Jul 2003 17:31:36 +0200
From: Borcis <borcis@users.ch>
Subject: Re: Announcing issue 2 of The Agile Developer's Life free eZine
Message-Id: <3F293658.3030609@users.ch>
DevCoach wrote:
> I have just published the second issue of The Agile Developer's Life
> (formerly called The Agile Life)
How much of Rumsfeld's special vocab does it port to computer programming ?
------------------------------
Date: Thu, 31 Jul 2003 15:19:29 GMT
From: "David Segleau" <dave@sleepycat.com>
Subject: Re: Anyone build the Berkeley DBXML library for AS and Windows?
Message-Id: <5saWa.19546$Oz4.6877@rwcrnsc54>
You can use the free GCC compiler available from Cygwin.
Dave
"Bob" <bobx@linuxmail.org> wrote in message
news:1001ff04.0307290651.a57c8b4@posting.google.com...
> I am on Windows and do not have a compiler. Had anyone compiled the
> Berkeley DBXML library for Windows? I would like to try out DBXML.
>
> Bob
------------------------------
Date: 31 Jul 2003 08:13:03 -0700
From: peterstokes@operamail.com (Peter Stokes)
Subject: Re: error validation question
Message-Id: <10876b94.0307310713.ec21d1a@posting.google.com>
julia4_me@yahoo.com (Julia Briggs) wrote in message news:<c48f65ef.0307310002.7bdc598e@posting.google.com>...
> What is the cleanest and easiest way to produce on screen (no-popup)
> error validations for forms?
>
Ignore the sarcasm from others, Julia - they know not what they do. I
think I know what you're getting at - have a look at formmail.pl in
Matt's Script Archive - http://www.scriptarchive.com/ - it includes a
sub-routine for checking required fields and returning relevant error
messages. If I understand your request this is the sort of thing that
should fit the bill.
------------------------------
Date: Thu, 31 Jul 2003 16:07:59 GMT
From: Steve Grazzini <grazz@pobox.com>
Subject: Re: error validation question
Message-Id: <z9bWa.6842$7h6.6099@nwrdny03.gnilink.net>
Peter Stokes <peterstokes@operamail.com> wrote:
> julia4_me@yahoo.com (Julia Briggs) wrote:
>> What is the cleanest and easiest way to produce on screen
>> (no-popup) error validations for forms?
>
> Ignore the sarcasm from others, Julia - they know not what
> they do. I think I know what you're getting at - have a look
> at formmail.pl in Matt's Script Archive
Priceless!
UNDERLINING THE IRONY: The _others_ know not what they do, but
helpful _you_ step in to point her toward Matt Wright's Scripts.
Julia: your question is not about Perl but about an application
area -- which makes this the wrong place to ask it.
http://xrl.us/clpmisc [ Posting Guidelines ]
I'd suggest a CGI group or perhaps beginners-cgi@perl.org.
--
Steve
------------------------------
Date: Thu, 31 Jul 2003 12:01:16 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: error validation question
Message-Id: <slrnbiiiqs.1mr.tadmc@magna.augustmail.com>
Peter Stokes <peterstokes@operamail.com> wrote:
> julia4_me@yahoo.com (Julia Briggs) wrote in message news:<c48f65ef.0307310002.7bdc598e@posting.google.com>...
>> What is the cleanest and easiest way to produce on screen (no-popup)
>> error validations for forms?
> they know not what they do. I
I can tell who knows what they're doing and who doesn't.[1]
Can you?
> think I know what you're getting at - have a look at formmail.pl in
> Matt's Script Archive
"While the free code found at my web site has not evolved much
in recent years, the general programming practices and
standards of CGI programs have... bring the quality of code
for these types of programs up to date and eliminate some
of the bad programming practices and bugs found in the existing
Matt's Script Archive code... The code you find at Matt's Script
Archive is not representative of how even I would code these days."[2]
-- Matt Wright
If you recommend Matt's scripts, then it is clear to everyone in
the know, that you are out of the know.
How embarrassing for you...
[1] I've observed this newsgroup pretty much daily for 8 or 9 years.
[2] http://nms-cgi.sourceforge.net/
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 31 Jul 2003 11:32:36 -0600
From: Eric Schwartz <emschwar@ldl.fc.hp.com>
Subject: Re: how to know the week of today?
Message-Id: <etor846a9fv.fsf@wormtongue.emschwar>
Gunnar Hjalmarsson <noreply@gunnar.cc> writes:
> DOV LEVENGLICK wrote:
>> C&J wrote:
>>>Is there any way to know what is the current week?
>>>January 1 is the first week.
>> $thisday = (Sun,Mon,Tue,Wed,Thu,Fri,Sat)[(localtime)[6]];
>
> Err.. How is that solution related to OP's question?
Not at all, AFAICT, but the solution is in localtime():
$weeknum = int((localtime)[7] / 7);
-=Eric
--
Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is NOTHING like Shakespeare.
-- Blair Houghton.
------------------------------
Date: 31 Jul 2003 09:10:19 -0700
From: reggie@reggieband.com (reggie)
Subject: Re: LWP::Simple and authentication
Message-Id: <5117aba8.0307310810.7620b6a0@posting.google.com>
"Gregory Toomey" wrote
> > when I do:
> >
> > use LWP::Simple;
> > use LWP::UserAgent;
> > use HTTP::Request;
> > use HTTP::Request::Common;
> #!/usr/bin/perl
> use LWP::Simple;
>
> my $screen_scraper=get("http://username:password\@site.com/restofurl");
> # @ has been escaped
>
> You can type URLS of the form http://username:password@site.com/restofurl
> straight into your browser to avoid getting the popup for basic
> authentication.
This does work in the browser, however it does not work within the
script. I saw and tried your previous post and assumed it did not
apply to my situation.
Is is possible the server would also do authentication against other
headers being sent by traditional browsers?
reggie.
------------------------------
Date: 31 Jul 2003 09:31:17 -0700
From: reggie@reggieband.com (reggie)
Subject: Re: LWP::Simple and authentication
Message-Id: <5117aba8.0307310831.20045eec@posting.google.com>
"J. Gleixner" wrote
> > Client-Warning: Unsupported authentication scheme 'ntlm'
> >
> > Error: Access is Denied.
> >
> > I am confused.
> > Any suggestions?
>
> First, since you're code is correct, try to find if the solution has
> already been created. Doing a Google search on "ntlm authentication
> lwp", should lead you to the solution.
I have done that.
http://groups.google.com/groups?&q=ntlm+authentication+lwp
The most pertinent questions are not answered, others say it isn't
possible, and only one or two point towards:
LWP::Authen::Ntlm;
A search on cpan:
http://search.cpan.org/search?query=ntlm&mode=all
Shows several solutions,
and LWP::Authen::Ntlm documentation
http://search.cpan.org/author/GAAS/libwww-perl-5.69/lib/LWP/Authen/Ntlm.pm
is as close as I can get to an answer.
Still - I would have thought this is a common scenario that someone
would be able to provide a suggestion above and beyond 'rtfm'.
reggie.
------------------------------
Date: Thu, 31 Jul 2003 12:21:58 -0500
From: cp <cpryce@pryce.nospam.net>
Subject: Re: LWP::Simple and authentication
Message-Id: <310720031221589490%cpryce@pryce.nospam.net>
In article <5117aba8.0307310831.20045eec@posting.google.com>, reggie
<reggie@reggieband.com> wrote:
> and LWP::Authen::Ntlm documentation
> http://search.cpan.org/author/GAAS/libwww-perl-5.69/lib/LWP/Authen/Ntlm.pm
> is as close as I can get to an answer.
The link referenced IS the answer.
>
> Still - I would have thought this is a common scenario that someone
> would be able to provide a suggestion above and beyond 'rtfm'.
If the answer can be found by R'ing The FM, then you will be encouraged
to RTFM.
In this case, the docs will tell you that you can't use LWP::Simple
with ntlm wuthentication.
Make sure that your installation of libwww-perl (LWP) is up-to-date.
LWP::Authen::Ntlm should install with the most current version. Then
try this code (which is almost exactly like the code in the docs):
use LWP::UserAgent;
my $ua = LWP::UserAgent->new(
agent=>'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)',
keep_alive=>'1'
);
my $host = 'server:port';
my $user = 'myDomain\\myUserName';
my $pass = 'password';
# note the empty '' is required.
$ua->credentials($host, '', $user, $pass);
my $req = new HTTP::Request GET => "http://winHost/path/to/file";
my $res = $ua->request( $req );
if ( $res->is_success() ) {
# Success !
}
else {
# Failure
}
perlodc LWP::UserAgent and perldoc lwpcook will give you some pointers
on what to do with the response object.
--
cp
------------------------------
Date: Thu, 31 Jul 2003 15:28:37 GMT
From: Steve Grazzini <grazz@pobox.com>
Subject: Re: Perl Objects
Message-Id: <FAaWa.6360$7h6.1962@nwrdny03.gnilink.net>
Paul <elegans@lycos.com> wrote:
> I implemented your first solution (using closures). This seems
> to be working quite well. To break the circular reference I
> simply added a DESTROY method that undefined the handlers (I
> think/hope this was enough).
Actually, this will still leak:
> sub DESTROY {
> my $self = shift;
> $self->{handlers} = undef;
> }
since DESTROY won't be called while the circular reference
exists. That might not matter in a short-running script, but
if you need the object to be destroyed earlier, use a weak
reference as Bart suggested.
use Scalar::Util qw(weaken);
sub new {
my $class = shift;
my $self = {};
# add closures referring to $self
my $ref = $self;
weaken $self;
bless $ref, $class;
}
--
Steve
------------------------------
Date: Thu, 31 Jul 2003 16:54:22 GMT
From: "Tyler Cruz" <tylercruz@hotmail.com>
Subject: Perl Project Logic Question
Message-Id: <2RbWa.569437$3C2.14646011@news3.calgary.shaw.ca>
Hi,
I'm contemplating improving my "Name That Flick" feature, and was wondering
if this is the right logic for what I should be doing.
Name That Flick (http://www.movie-vault.com/namethatflick/) shows a shot
(JPG) from a movie, and visitors are to guess what it is, and check back in
one week for the answer.
I have a members database for my site in mySQL, which contains columns for
firstname, lastname, password, moviequotescore, namethatflick score and a
few others. In order to answer/guess the film, they would need to enter it
in a box. If they get it correct, namthatflick gets incremented by 1.
Now, a little problem. I will be updating the film once a week, so once they
get it, I have to temporarily suspend them from guessing again, or they can
just rack up free points. Thus, I was thinking of adding a new colomn in my
table in MySQL for 'namethatflickcorrect' and it woudl have a Y or N. Y if
they answered it correctly, and N if not. And the form would not let them
guess again if they have a Y.
I keep the movie name and name for the image filename in flatfile databases.
Then when the administrator (me) adds a new movie, it would reset all the
members' namethatflickcorrect' to N. (loading/bandwidth issues?). I'm not
sure if I will archive the old Name that Flick answers/photos, as I think it
may be too much programming (not worth it/overcomplicated)
Anyhow, please let me know if my logic is correct, thanks.
Tyler Cruz
movie-vault.com
------------------------------
Date: Thu, 31 Jul 2003 13:14:50 -0400
From: Jay Flaherty <fty@utk.edu>
Subject: Re: regular expression question
Message-Id: <3f29502b_4@news.utk.edu>
Janek Schleicher wrote:
> perl -e '$_ = "foobarbarbar"; /((.*)\2+)$/; print length($1)/length($2)'
perl -e '$_ = "foobarbarbarbar"; /((.*)\2+)$/; print length($1)/length($2)'
returns 2 (barbar x 2)
So it seems to work with odd number of concats only.
Jay
------------------------------
Date: Thu, 31 Jul 2003 15:10:53 -0000
From: gbacon@hiwaay.net (Greg Bacon)
Subject: Re: semaphore example needed
Message-Id: <viicbtmai5c9ff@corp.supernews.com>
In article <3f290da9$1@newsgate.hknet.com>,
j <perseus_medusa@hotmail.com> wrote:
: I tried to use IPC::Semaphore but tried for a long time without
: success.
:
: What I want to do is like this :
: I want to limit a perl script to be run by 10 users concurrently only.
: I want to create 10 semaphore and each user before runing the script,
: check if any one of the semaphore available. If not then it die. If
: there is available, it takes one. After the script ended, they release
: the semaphore.
How does this suit you?
% cat try
#! /usr/local/bin/perl
use warnings;
use strict;
use IPC::SysV qw/ S_IRWXU IPC_CREAT IPC_EXCL IPC_NOWAIT SEM_UNDO /;
use IPC::Semaphore;
sub create_or_get_sem {
my $key = shift;
my $max = shift;
my $sem;
# first we try to create it
$sem = IPC::Semaphore->new($key, 1, 0666 | IPC_CREAT | IPC_EXCL);
if ($sem) {
$sem->setall($max);
}
else {
$sem = IPC::Semaphore->new($key, 1, 0666 | IPC_CREAT);
die "$0: semget: $!" unless $sem;
}
$sem;
}
sub take {
my $sem = shift;
$sem->op(0, -1, SEM_UNDO | IPC_NOWAIT);
}
## main
my $key = 1234; # maybe generate with IPC::SysV::ftok
my $max = 3;
my $sem = create_or_get_sem $key, $max;
die "$0: too many processes; exiting" unless take $sem;
print "$0 [$$]: sleeping...\n";
sleep 10;
print "$0 [$$]: exiting...\n";
% ./try & ; ./try & ; ./try & ; ./try & ; ./try
[1] 998895
[2] 995414
[3] 954410
[4] 982517
./try [998895]: sleeping...
./try [995414]: sleeping...
./try [982517]: sleeping...
./try [1005583]: too many processes; exiting at ./try line 40.
./try [954410]: too many processes; exiting at ./try line 40.
[3] Exit 35 ./try
% ./try [998895]: exiting...
./try [995414]: exiting...
./try [982517]: exiting...
[4] Done ./try
[2] - Done ./try
[1] + Done ./try
%
Hope this helps,
Greg
--
Free government is founded in jealousy, and not in confidence. It is
jealousy and not confidence which prescribes limited constitutions, to
bind down those whom we are obliged to trust with power . . .
-- Thomas Jefferson
------------------------------
Date: Thu, 31 Jul 2003 23:53:59 +0800
From: "j" <perseus_medusa@hotmail.com>
Subject: Re: semaphore example needed
Message-Id: <3f293a14$1@newsgate.hknet.com>
Thanks for your example but I don't quite understand some points :
1) If more than 1 person is trying to change the semaphore, are they
contending for the same lock to update the semaphore? If yes, will this
become the bottleneck of the script ? Or is there anyway like preparing $max
number of locks which client can wait for either one to reduce contention?
2) It just exit and then it can release the lock ? Or is there ways I could
release the lock in the middle ?
Thanks .
Perseus
"Greg Bacon" <gbacon@hiwaay.net> wrote in message
news:viicbtmai5c9ff@corp.supernews.com...
> In article <3f290da9$1@newsgate.hknet.com>,
> j <perseus_medusa@hotmail.com> wrote:
>
> : I tried to use IPC::Semaphore but tried for a long time without
> : success.
> :
> : What I want to do is like this :
> : I want to limit a perl script to be run by 10 users concurrently only.
> : I want to create 10 semaphore and each user before runing the script,
> : check if any one of the semaphore available. If not then it die. If
> : there is available, it takes one. After the script ended, they release
> : the semaphore.
>
> How does this suit you?
>
> % cat try
> #! /usr/local/bin/perl
>
> use warnings;
> use strict;
>
> use IPC::SysV qw/ S_IRWXU IPC_CREAT IPC_EXCL IPC_NOWAIT SEM_UNDO /;
> use IPC::Semaphore;
>
> sub create_or_get_sem {
> my $key = shift;
> my $max = shift;
>
> my $sem;
>
> # first we try to create it
> $sem = IPC::Semaphore->new($key, 1, 0666 | IPC_CREAT | IPC_EXCL);
> if ($sem) {
> $sem->setall($max);
> }
> else {
> $sem = IPC::Semaphore->new($key, 1, 0666 | IPC_CREAT);
>
> die "$0: semget: $!" unless $sem;
> }
>
> $sem;
> }
>
> sub take {
> my $sem = shift;
> $sem->op(0, -1, SEM_UNDO | IPC_NOWAIT);
> }
>
> ## main
> my $key = 1234; # maybe generate with IPC::SysV::ftok
> my $max = 3;
>
> my $sem = create_or_get_sem $key, $max;
>
> die "$0: too many processes; exiting" unless take $sem;
>
> print "$0 [$$]: sleeping...\n";
> sleep 10;
> print "$0 [$$]: exiting...\n";
> % ./try & ; ./try & ; ./try & ; ./try & ; ./try
> [1] 998895
> [2] 995414
> [3] 954410
> [4] 982517
> ./try [998895]: sleeping...
> ./try [995414]: sleeping...
> ./try [982517]: sleeping...
> ./try [1005583]: too many processes; exiting at ./try line 40.
> ./try [954410]: too many processes; exiting at ./try line 40.
> [3] Exit 35 ./try
> % ./try [998895]: exiting...
> ./try [995414]: exiting...
> ./try [982517]: exiting...
>
> [4] Done ./try
> [2] - Done ./try
> [1] + Done ./try
> %
>
> Hope this helps,
> Greg
> --
> Free government is founded in jealousy, and not in confidence. It is
> jealousy and not confidence which prescribes limited constitutions, to
> bind down those whom we are obliged to trust with power . . .
> -- Thomas Jefferson
------------------------------
Date: Thu, 31 Jul 2003 13:29:02 -0400
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: Sorting question
Message-Id: <4n4r12fvvl.fsf@lockgroove.bwh.harvard.edu>
On Thu, 31 Jul 2003, nomail@hursley.ibm.com wrote:
> I have a set of names, each of which has an associated size value. I
> want to list these names in size order.
Read the documentation for the sort() function ("perldoc -f sort").
my @by_size = sort { get_size($a) <=> get_size($b) } @names;
You just need to write get_size(). Switch $a and $b to reverse the
order.
Ted
------------------------------
Date: Thu, 31 Jul 2003 19:25:00 +0200
From: Matija Papec <mpapec@yahoo.com>
Subject: splicing two arrays
Message-Id: <ntgiivk5e809danfdfuba5khga29aptu11@4ax.com>
Here is the problem which IMHO isn't trivialy(in one line) solvable in
perl5; I have two arrays of same length and want to remove elements from
them depending on %h(all values are just for illustration, there is no
relation between them),
my @arr1 = 30..60;
my @arr2 = 10..40;
my %h = (
33 => 'value',
43 => 'value',
45 => 'value',
51 => 'value',
53 => 'value',
);
Now, simple grep does a right thing,
@arr1 = grep exists $h{$_}, @arr1;
but it leaves me with @arr2 where corresponding elements to @arr1 should
also be removed(when removing n-th from @arr1, remove n-th from @arr2 too).
I ended up with simultaneous array rotation and I'm curios now if there is a
better way? :)
--
Matija
------------------------------
Date: 31 Jul 2003 17:40:26 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: Transmutation of objects??
Message-Id: <u9n0eufy4l.fsf@wcl-l.bham.ac.uk>
J Krugman <jill_krugman@yahoo.com> writes:
> I'm trying to sort out a bug in my code, and I've come across a
> strange, and definitely unwanted, "transmutation" of an object's
> class.
No you haven't.
A thingy in Perl can be associated with two classes. The one into to
which it is blessed, and the one into which it is tied. The class
into which a thingy is blessed effects the sematantics of things done
with references to the thingy. The class into which it is tied effect
the semantics of things done to the thingy itself.
> IO::Handle::fileno(/usr/lib/perl/5.6.1/IO/Handle.pm:130):
> 130: fileno($_[0]);
>
> ### we print $_[0] to see what it is
> DB<15> p $_[0]
> My_Connection=GLOB(0x867223c)
You should also print out tied(*{$_[0]})
You'd see
IO::Socket::SSL::SSL_HANDLE=SCALAR(0x84def38)
> ### OK, it is what we expect
> ### we step into the fileno($_[0]) call
> DB<16> s
Since $_[0] contains a reference to a tied GLOB
fileno($_[0])
is actually interpreted as
tied(*{$_[0]})->FILENO
> IO::Socket::SSL::SSL_HANDLE::FILENO(/usr/lib/perl5/IO/Socket/SSL.pm:496):
>
> How can this be??? What is going on here?
A tied GLOB is being used so that you can treat an SSL connection as
it it were as native socket.
> More importantly, how can I prevent it from happening?
Don't use SSL.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Thu, 31 Jul 2003 17:25:46 +0000
From: Garry Short <g4rry_sh0rt@zw4llet.com>
Subject: Re: Web development and Perl 6
Message-Id: <bgbg47$jso$1$8300dec7@news.demon.co.uk>
Uri Guttman wrote:
<SNIP>
>. you haven't been reading the apocalypses and
> exigeses i gather. try them out before you start another misguided rant
> about perl6.
>
> uri
>
Hi Uri,
do you know if these are all downloadable from somewhere at the moment? I
read the early ones but am working away from home during the week at the
moment, so can't read them online. I'd love to be able to download them and
read them offline in the evenings ...
Cheers,
Garry
(not the OP)
------------------------------
Date: Thu, 31 Jul 2003 16:40:02 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Web development and Perl 6
Message-Id: <x7y8yezm3h.fsf@mail.sysarch.com>
>>>>> "GS" == Garry Short <g4rry_sh0rt@zw4llet.com> writes:
GS> do you know if these are all downloadable from somewhere at the
GS> moment? I read the early ones but am working away from home during
GS> the week at the moment, so can't read them online. I'd love to be
GS> able to download them and read them offline in the evenings ...
perl.com or dev.perl.org should have them all. search them or google to
find them. note that there are also synopses for the earlier ones as
well. all are worth reading but they will take time. also the new book
essesntial perl6 is out and covers much of the same material.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: Thu, 31 Jul 2003 11:47:58 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Web development and Perl 6
Message-Id: <slrnbiii1u.1mr.tadmc@magna.augustmail.com>
Garry Heaton <none@none.com> wrote:
> IMHO if Perl 6 doesn't come with some kind of SDK for web developoment, ie.
> at least a templating system, then it will become increasingly marginalised
> in the web development world due to the proliferation of PHP within modestly
> priced hosting deals.
Most people in the Perl community would count that as a good thing,
so it is unlikely that there will be volunteers for such development.
Unless _you_ get some together...
> It's not enough to say mod_perl/Embperl/Mason or whatever for the simple
> reason that many new web developers and teachers use cheap hosting deals
> which invariably come fully configured with PHP/MySQL and nothing more than
> standard Perl/CGI.pm.
They get what they pay for.
PHP can have the shoe-string types, Perl can do fine without them.
> Perl is in too many bits and pieces, at least where web development is
> concerned. DBI, DBD::mysql, mod_perl, Mason/Embperl. That's a non-starter
> with most hosting deals so you're average web developer turns to PHP which
> usually comes fully optimised without the need for additional modules. I'm
> talking about basic bread and butter database website work here, not LWP jobs.
If PHP is a better choice than Perl for what you need to do, then
use PHP instead of Perl. Choose the right tool for the job.
Perl and PHP can both live happy and fulfilling lives, it isn't either-or.
> If we don't seize the chance to bundle
> a proper web development SDK with Perl 6
Perl 6 development is done by volunteers.
Become a volunteer to do that development if you want that development done.
> PHP will just become the de facto
> server-side scripting language for web development.
What would be wrong with that?
Perl is useful in a boatload of other places, Perl 6 can be
used in all of those spaces.
And we'll all live happily everafter.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Thu, 31 Jul 2003 16:48:39 GMT
From: Dave Brown <dhbrown@hobbes.dhbrown.net>
Subject: Re: Web page with frames...
Message-Id: <slrnbiii66.1q3.dhbrown@hobbes.dhbrown.net>
In article <n82Wa.16872$yv1.7931@nwrddc02.gnilink.net>, Jürgen Exner wrote:
> Dave Brown wrote:
>> [...] web page [...] frames[...] form [...] submit [...]
>> right frame [...] left frame [...] CGI [...] html [...]
>> page [...] button [...]
>
> None of that has anything to do with Perl whatsoever.
> Do you have any Perl-related question, too?
Caught by the topic police. (It has to do with CGI programming
which I happen to be doing in perl.) Perhaps you could recommend
a relevant newsgroup for CGI programming?
BTW, the target tag worked, though I couldn't find it in my old
O'Reilly HTML book.
But whereas the data entered remains in the left frame, the form
doesn't "save" it. So I can't simply change one value and "submit".
Do I need to use a cookie?
--
Dave Brown Austin, TX
------------------------------
Date: Thu, 31 Jul 2003 16:53:17 GMT
From: Dave Brown <dhbrown@hobbes.dhbrown.net>
Subject: Re: Web page with frames...
Message-Id: <slrnbiiies.1q3.dhbrown@hobbes.dhbrown.net>
In article <Bj1Wa.15919$cF.7149@rwcrnsc53>, Mark wrote:
>
><original message snipped for brevity>
>
>> I've got the code written for the left frame. I've got code written to
>> do the calculations. Here's the question: when I submit the form, which
>> kicks off the CGI script to do the calculations, what do I do (I presume)
>> in the CGI script to get it to send the result to the frame on the right?
>> --
>> Dave Brown Austin, TX
>
> According to the O'Reilly's HTML- the definitive guide (the Koala book), the
> form tag has a target attribute. Simply add 'target=<right frame>' to the
> form tag to notify the browser that form results should be displayed on the
> right.
>
> You might also consider dropping the whole framing concept and simply return
> the completed form as part of the CGI output- this would increase
> compatibility and eliminate issues with synchronizing frames and 'back'
> button presses.
>
> I'm not saying that separate <form> and <output> data is necessarily bad,
> but IMHO managing some data on the client side and some server side is more
> difficult than evaluating (and responding to) all the data as a fresh
> transaction.
I tried the "target" tag, and it worked. As I posted in other followup,
the data is lost. So I've been coming to the same conclusion as you
recommend... regenerate the form as part of the CGI output.
Or I'm thinking of storing the data in a cookie... (As you can tell, I'm a
novice at CGI programming.)
--
Dave Brown Austin, TX
------------------------------
Date: Thu, 31 Jul 2003 11:39:55 -0600
From: Eric Schwartz <emschwar@ldl.fc.hp.com>
Subject: Re: Web page with frames...
Message-Id: <eton0eua93o.fsf@wormtongue.emschwar>
Dave Brown <dhbrown@hobbes.dhbrown.net> writes:
> Caught by the topic police. (It has to do with CGI programming
> which I happen to be doing in perl.)
Yes, people do a lot of things with Perl; that doesn't make questions
about them Perl questions. I'm writing a library-cataloguing system
in Perl right now; does that make comp.lang.perl.misc a good place to
ask if I should use Library of Congress or Dewey-Decimal indexing?
(In the short term, probably LoC, only because I can easily query
their database using Net::Z3950, but I'd like to offer both.)
> Perhaps you could recommend
> a relevant newsgroup for CGI programming?
comp.infosystems.www.authoring.cgi
> BTW, the target tag worked, though I couldn't find it in my old
> O'Reilly HTML book.
That's why you should always look at authoritative sources before
posting to newsgroups. Books are useful for quick references, but are
too often incomplete or out-of-date. Perl has online documentation
available by 'perldoc'; the W3C has online HTML references available.
> But whereas the data entered remains in the left frame, the form
> doesn't "save" it. So I can't simply change one value and "submit".
> Do I need to use a cookie?
I'm sorry, I have no idea what you're trying to say here. You'd best
ask again on ciwac; they may have a better chance at interpreting your
meaning.
-=Eric
--
Come to think of it, there are already a million monkeys on a million
typewriters, and Usenet is NOTHING like Shakespeare.
-- Blair Houghton.
------------------------------
Date: Thu, 31 Jul 2003 17:42:26 GMT
From: "Todd de Gruyl" <todd@tdegruyl.com>
Subject: Re: Web page with frames...
Message-Id: <pan.2003.07.31.17.42.14.721052@tdegruyl.com>
On Thu, 31 Jul 2003 16:48:39 +0000, Dave Brown wrote:
> Caught by the topic police. (It has to do with CGI programming
> which I happen to be doing in perl.) Perhaps you could recommend
> a relevant newsgroup for CGI programming?
perhaps:
comp.infosystems.www.authoring.cgi or
comp.infosystems.www.authoring.html or
comp.infosystems.www.authoring.site-design or even possibly
comp.lang.javascript
unless, of course, there is some perl code we can all look at (and help
with).
--
Todd de Gruyl
------------------------------
Date: 31 Jul 2003 08:42:56 -0700
From: simonf@simonf.com (Simon)
Subject: Why, oh why have I read "Perl 6 essentials"???
Message-Id: <3226c4d3.0307310742.3607cf0@posting.google.com>
This book is evil, especially the part about junctions. I am *dying* to use them!!!
:((((
Simon Ilyushchenko
------------------------------
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 5299
***************************************