[25905] in Perl-Users-Digest
Perl-Users Digest, Issue: 8133 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue May 31 03:05:30 2005
Date: Tue, 31 May 2005 00:05:06 -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 Tue, 31 May 2005 Volume: 10 Number: 8133
Today's topics:
Re: http auth logindialog box <no@email.com>
Re: newbie Perl question <lawshouse.public@btconnect.com>
Re: numbers and strings and regex? (Anno Siegel)
Re: perl style: can I combine two steps into one? (aka ? the Platypus)
Re: Setting cookie values - repeat necessary? <rbutcher.nospam@hotmail.com>
Re: Setting cookie values - repeat necessary? <spamtrap@dot-app.org>
Re: Setting cookie values - repeat necessary? <rbutcher.nospam@hotmail.com>
Re: Setting cookie values - repeat necessary? <tadmc@augustmail.com>
Re: Setting cookie values - repeat necessary? <djames@thehub.com.au>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 30 May 2005 20:04:12 +0100
From: Brian Wakem <no@email.com>
Subject: Re: http auth logindialog box
Message-Id: <3g16dcFa2ddpU1@individual.net>
Nikos wrote:
> Hello inside my games.pl script i want an http auth box to popup and ask
> for login credentials.
> Only if its correct then games.pl will load else an eroor message popup.
>
> So i made this after searching on the net and modifying some code:
>
> #==========================CHECKING USERS
> CREDENTIALS===========================
> my $browser = LWP::UserAgent->new;
>
> $browser->credentials(
> 'www.nikolas.tk:80',
> 'Personal Folder',
> 'nikos' => 'nikos'
> );
>
> my $url = 'http://www.nikolas.tk/cgi-bin/games.pl';
> my $response = $browser->get($url);
>
>
> die "Error: ", $response->header('Nikos Personal Folder') || 'Error
> accessing',
> "\n ", $response->status_line, "\n at $url\n Aborting"
> unless $response->is_success;
>
> I dont know why, but a box an http auth box never appears so i can test
> this by entering nikos and nikos.
>
> Whats am i doing wrong?
>
>
You are clearly very confused and your problem is nothing to do with Perl.
I suggest you go to google and look up htaccess and htpasswd. Also read
http://httpd.apache.org/docs-2.0/howto/htaccess.html, but do not ask
question about it here - it is OT.
--
Brian Wakem
------------------------------
Date: Mon, 30 May 2005 22:00:28 +0100
From: Henry Law <lawshouse.public@btconnect.com>
Subject: Re: newbie Perl question
Message-Id: <ofvm91hofus0835cere37c175ovcb02mh4@4ax.com>
On Sun, 29 May 2005 15:38:39 -0700, Westcoast Sheri
<westshestcostsheastsheri@westshestcostsheastsher.com> wrote:
>Something tells me it took you a very long time to post that nugget of
>wisdom....
Ms Westcoast, let me explain how it is in this group. Some of the
best Perl people in the world hang out here; they can give really good
advice - not only on Perl but also on how to help yourself frame
questions and find answers.
You may not like the things that some of them say, but as they say in
English English "like it or lump it". You may have got some annoyance
off your chest, but you've done it at your own expense: you have
ensured that the real mavens don't ever see your posts, and of course
they won't help with your questions. I don't think that was too
clever. Now you have to hope that the rest of us who haven't (yet)
put you in the kill file can help.
--
Henry Law <>< Manchester, England
------------------------------
Date: 30 May 2005 20:51:43 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: numbers and strings and regex?
Message-Id: <d7fucv$skr$1@mamenchi.zrz.TU-Berlin.DE>
Geoff Cox <geoff.cox@notquitecorrectfreeuk.com> wrote in comp.lang.perl.misc:
> On 30 May 2005 16:43:25 GMT, anno4000@lublin.zrz.tu-berlin.de (Anno
> Siegel) wrote:
>
> >Geoff Cox <geoff.cox@notquitecorrectfreeuk.com> wrote in comp.lang.perl.misc:
>
> >Your pattern requests files that have an extension ".jmx". Your examples
> >have an extension ".doc" or none. Also, \d{1} is the same as \d.
>
> my mistake they should be the same, ie .jmx
>
> I have changed to \d instead of \d{1} but still something wrong with
> the code
>
> if ($name =~ /.*?(\d{2})-((\d)(\d))\.jmx/i) {
>
> my $both = $2;
> my $first = $3;
> my $second = $4;
>
> if ($4 <= 9)
> { $exnum = $4;
Where is $exnum declared? This doesn't compile under strict. Please make
your code strict-clean.
> }
> else {my $exnum = $both;
Whatever the first $exnum was, this one (declared with "my") is something
else. The assignment here will have no effect outside the else-block,
and it has none inside. You might as well drop the else-block. Apparently
not what you intended.
> }
>
> the $exnum value for when the second pair of digits in 01-11 is
> greater than 09 ...?
Which $exnum are we speaking of?
Since your code does things you didn't intend it does a poor job of
communicating what you did intend. Write a complete, self-contained
program that shows some output. Then explain how the output is not
what you expect.
I had to rework your code into something runnable anyway, so I'm appending
it (as a signature) to show what I mean. Add a suitable declaration to
$exnum. If it still doesn't do what you think it should do, point to where
its output is different from what you think it should be.
Anno
--
#!/usr/local/bin/perl
use strict; use warnings; $| = 1;
my @strings = qw(
blue-green-01-01.jmx
blue-green-01-09.jmx
blue-green-01-11.jmx
blue-green-01-32.jmx
);
for my $name ( @strings ) {
if ($name =~ /.*?(\d{2})-((\d)(\d))\.jmx/i) {
my $both = $2;
my $first = $3;
my $second = $4;
our $exnum;
if ($4 <= 9) {
$exnum = $4;
} else {
my $exnum = $both;
}
print "$name -> first: $first, second: $second, both: $both, " .
"exnum: $exnum\n";
}
}
__END__
------------------------------
Date: Mon, 30 May 2005 21:16:48 GMT
From: "David Formosa (aka ? the Platypus)" <dformosa@dformosa.zeta.org.au>
Subject: Re: perl style: can I combine two steps into one?
Message-Id: <slrnd9n00v.4ns.dformosa@dformosa.zeta.org.au>
On 5 Feb 2005 20:38:10 GMT, Anno Siegel
<anno4000@lublin.zrz.tu-berlin.de> wrote:
[...]
> I lump together closing brackets of all kind, unless I want one to stand
> out. You don't want to miss an opening bracket, but the closing ones only
> confirm what you know. A lump of them can be parsed as "this closes
> everything" (up to a point that can be indicated through indentation).
Likewise, and like you I've had Lisp esposure.
--
Please excuse my spelling as I suffer from agraphia. See
http://dformosa.zeta.org.au/~dformosa/Spelling.html to find out more.
Free the Memes.
------------------------------
Date: Mon, 30 May 2005 23:23:19 GMT
From: "Robert" <rbutcher.nospam@hotmail.com>
Subject: Re: Setting cookie values - repeat necessary?
Message-Id: <HfNme.1519564$Xk.952613@pd7tw3no>
"Tad McClellan" <tadmc@augustmail.com> wrote in message
news:slrnd9mfb4.jap.tadmc@magna.augustmail.com...
> Randy <rbutcher.nospam@hotmail.com> wrote:
>
> > #use warnings; // blocked out, un-useful in CGI environment
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
>
> What is it that led you to that conclusion?
Like I said, this is not a locally run Perl script, I is run on a commercial
web server in CGI invironemnt. Even if use warnings did generate an error or
warning in the log, I have no access to that information. I therefor opted
to not use it.
R
------------------------------
Date: Mon, 30 May 2005 20:48:52 -0400
From: Sherm Pendley <spamtrap@dot-app.org>
Subject: Re: Setting cookie values - repeat necessary?
Message-Id: <J8SdnUR5AY_oKQbfRVn-hA@adelphia.com>
Robert wrote:
> Like I said, this is not a locally run Perl script, I is run on a commercial
> web server in CGI invironemnt. Even if use warnings did generate an error or
> warning in the log, I have no access to that information. I therefor opted
> to not use it.
Even so - this is a script you're obviously still working on. Even if
you comment out "use warnings;" in the finished script that you upload
to the production server, you should still leave it enabled while the
script is in development.
sherm--
--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org
------------------------------
Date: Tue, 31 May 2005 01:47:44 GMT
From: "Robert" <rbutcher.nospam@hotmail.com>
Subject: Re: Setting cookie values - repeat necessary?
Message-Id: <4nPme.1521881$8l.598983@pd7tw1no>
"Sherm Pendley" <spamtrap@dot-app.org> wrote in message
news:J8SdnUR5AY_oKQbfRVn-hA@adelphia.com...
> Robert wrote:
>
> > Like I said, this is not a locally run Perl script, I is run on a
commercial
> > web server in CGI invironemnt. Even if use warnings did generate an
error or
> > warning in the log, I have no access to that information. I therefor
opted
> > to not use it.
>
> Even so - this is a script you're obviously still working on. Even if
> you comment out "use warnings;" in the finished script that you upload
> to the production server, you should still leave it enabled while the
> script is in development.
Good point, might assist in debugging during development.
R
------------------------------
Date: Mon, 30 May 2005 21:13:27 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Setting cookie values - repeat necessary?
Message-Id: <slrnd9ni27.kah.tadmc@magna.augustmail.com>
Robert <rbutcher.nospam@hotmail.com> wrote:
> "Tad McClellan" <tadmc@augustmail.com> wrote in message
> news:slrnd9mfb4.jap.tadmc@magna.augustmail.com...
>> Randy <rbutcher.nospam@hotmail.com> wrote:
>>
>> > #use warnings; // blocked out, un-useful in CGI environment
>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>
>>
>> What is it that led you to that conclusion?
> warning in the log, I have no access to that information.
Oh, I see. Then it should have been
blocked out, un-useful in a crippled CGI environment
:-)
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 31 May 2005 03:16:15 GMT
From: Damian James <djames@thehub.com.au>
Subject: Re: Setting cookie values - repeat necessary?
Message-Id: <slrnd9nlnq.fpi.djames@stumble.qimr.edu.au>
On Mon, 30 May 2005 21:13:27 -0500, Tad McClellan said:
> Robert <rbutcher.nospam@hotmail.com> wrote:
>> "Tad McClellan" <tadmc@augustmail.com> wrote in message
>> news:slrnd9mfb4.jap.tadmc@magna.augustmail.com...
>>> Randy <rbutcher.nospam@hotmail.com> wrote:
>>>
>>> > #use warnings; // blocked out, un-useful in CGI environment
>>> What is it that led you to that conclusion?
>> warning in the log, I have no access to that information.
> Oh, I see. Then it should have been
> blocked out, un-useful in a crippled CGI environment
>:-)
My favorite oroborusism:
open STDERR, ">>somefile" or die "Can't redirect stderr: $!\n";
;)
--damian
------------------------------
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.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 8133
***************************************