[25903] in Perl-Users-Digest
Perl-Users Digest, Issue: 8131 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 30 14:05:22 2005
Date: Mon, 30 May 2005 11: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 Mon, 30 May 2005 Volume: 10 Number: 8131
Today's topics:
Re: a simple question <matternc@comcast.net>
Re: a simple question <tadmc@augustmail.com>
Re: a simple question <tadmc@augustmail.com>
Re: a simple question <nobull@mail.com>
Re: CGI::Session with MySQL Driver <alexj@freesurf.ch>
Re: CGI::Session with MySQL Driver <1usa@llenroc.ude.invalid>
Re: CGI::Session with MySQL Driver <pilkowsk@informatik.uni-marburg.de>
Re: CGI::Session with MySQL Driver <alexj@freesurf.ch>
Re: CGI::Session with MySQL Driver <pilkowsk@informatik.uni-marburg.de>
Re: CGI::Session with MySQL Driver <tadmc@augustmail.com>
Re: http auth logindialog box <tadmc@augustmail.com>
Re: http auth logindialog box <hackeras@gmail.com>
Re: http auth logindialog box <1usa@llenroc.ude.invalid>
Re: http auth logindialog box <nobull@mail.com>
Re: http auth logindialog box <nobull@mail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 30 May 2005 10:46:55 -0400
From: Chris Mattern <matternc@comcast.net>
Subject: Re: a simple question
Message-Id: <9eCdnb7G4ID8ugbfRVn-gQ@comcast.com>
Raghavendra Mahuli wrote:
> Hi all,
> I have a simple question in perl... I have an array -
>
> @a = (10,20,30,40);
>
> Since '$' gives the scalar of a array
No, it doesn't. $a and @a are two different variables that have nothing
to do with each other.
> , i expect "print $a" to give the
> no. of elements in the array...
No, because $a has nothing to do with @a.
> But it dosent work.. However if i copy it to a scalar and then print it,
> it works.. Can u pls explain why it is so?
> Here is the program listing:
>
> @a = (10,20,30,40);
> $x= @a;
Evaluates @a in a scalar context and places the value in $x.
> print $a;
Prints a variable that has nothing to do with @a.
> print $x;
Prints the scalar context of @a that you used above.
What you need to do here is get the scalar context of @a in
the print statement. You don't need to do that when assigning
to $x because the fact that you are assigning to a scalar
forces scalar context. Try this:
print scalar(@a);
In fact, you could also say:
$x = scalar(@a);
but you don't need to because Perl recognizes that a conversion
to scalar must be done here.
>
> thanx in advance,
> regards,
> raghu
--
Christopher Mattern
"Which one you figure tracked us?"
"The ugly one, sir."
"...Could you be more specific?"
------------------------------
Date: Mon, 30 May 2005 10:01:15 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: a simple question
Message-Id: <slrnd9malr.j1c.tadmc@magna.augustmail.com>
Raghavendra Mahuli <raghavendra.ma@in.bosch.com> wrote:
> Subject: a simple question
Please put the subject of your article in the Subject of your article.
Have you seen the Posting Guidelines that are posted here frequently?
> i expect "print $a" to give the no.
> of elements in the array...
What part of perl's docs led you to believe that?
> But it dosent work.. However if i copy it to a scalar and then print it, it
> works.. Can u pls explain why it is so?
See the "Context" section in
perldoc perldata
> $x= @a;
Here the name of the array is in *scalar* context.
> print $a;
That variable is not related to @a in any way, despite their
similar-looking names.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 30 May 2005 11:03:19 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: a simple question
Message-Id: <slrnd9mea7.j6e.tadmc@magna.augustmail.com>
Brian McCauley <nobull@mail.com> wrote:
[snip]
> No, @a and $a are two completely separate variables.
>
> I have to confess this is rather messy in Perl5 -
Not if you think about it the way Randal presents it in "Learning Perl",
so let's review that for the lurkers.
As a general rule, when Perl has just one of something,
that's a _scalar_.
...
the "plural" in Perl is represented by lists and arrays.
Which I paraphrase into:
Dollar-sign means you want to access a single thing,
at-sign means you want to access (potentially) more
than one thing.
> apparently it'll all
> be different in Perl6.
apparently it'll all be a different mess in Perl6. :-)
> Confusingly $a[0] is the first element of @a
If you want to access a single (first) element, then it isn't really
very confusing, you use the sigil that means "a single thing".
> and has
> nothing to do with $a.
Now _that_ part can be confusing.
> $#a is the last subscript of @a.
And that flat out *is* confusing, but its the csh's fault, not perl's. :-)
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 30 May 2005 18:11:32 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: a simple question
Message-Id: <d7fhgl$vp1$1@slavica.ukpost.com>
Tad McClellan wrote:
> Brian McCauley <nobull@mail.com> wrote:
>
>>I have to confess this is rather messy in Perl5 -
>
> Not if you think about it the way Randal presents it in "Learning Perl",
I disagee. Randal does a good job of explaining and maybe even
partially justifying the mess but it's still a mess. :-)
> Which I paraphrase into:
>
> Dollar-sign means you want to access a single thing,
> at-sign means you want to access (potentially) more
> than one thing.
Yes that's a good summary but the number of elements in an array is a
single thing so it doesn't realy do much to explain the destinction
between scalar(@a) and $a which was the OP's problem.
------------------------------
Date: Mon, 30 May 2005 15:09:16 +0200
From: Alexandre Jaquet <alexj@freesurf.ch>
Subject: Re: CGI::Session with MySQL Driver
Message-Id: <429b107e$0$1147$5402220f@news.sunrise.ch>
Mark Clements a écrit :
> Alexandre Jaquet wrote:
>
>
>>Mark Clements a écrit :
>>
>>>Alexandre Jaquet wrote:
>>>
>>>
>>>
>>>>Mark Clements a écrit :
>>>>
>>>>
>>>>
>>>>>Show us your code using param.
>>>>>
>>>>>Does it work with the File driver?
>>>>>
>>>>>Mark
>>>>
>>>>sub login {
>>>> my $username = param('user_name');
>>>> my $userpassword = param('user_password');
>>>>
>>>> my ($user_name,$user_password)=sqlSelect("nom_utilisateur ,
>>>>mot_de_passe", "personne", "nom_utilisateur = '$username' AND
>>>>mot_de_passe='$userpassword'"); my $dir =
>>>>"C:/indigoperl/apache/htdocs/recordz/"; if ($user_name &&
>>>>$user_password) { $CGI::Session::MySQL::TABLE_NAME = 'session';
>>>> my $SESSION = new CGI::Session( "driver:MySQL", undef, { Handle =>
>>>>$dbh} ); @my_array = ("$username");
>>>> $SESSION->param("user_name", \@my_array);
>>>> open (FILE, "<$dir/myaccount.html") or die "cannot open file
>>>>$dir/myaccount.html"; print "Content-type: text/html\n\n";
>>>> $CGISESSID = $SESSION->id();
>>>> while (<FILE>) {
>>>> s/\$LABEL{'([\w]+)'}/$SERVER{$1}/g;
>>>> s/\$LANG/$lang/g;
>>>> s/\$ERROR{'([\w]+)'}//g;
>>>> s/\$VINYL{'news'}/$string/g;
>>>> s/\$SESSIONID/$CGISESSID/g;
>>>> s/\$VINYL{'search'}//g;
>>>> print $_;
>>>> }
>>>> close (FILE);
>>>>
>>>> }
>>>> else {
>>>>#}}
>>>
>>>
>>>You need to learn to partition your problem. There is a load of gumpf
>>>here that gets in the way of the issue that you are having and makes it
>>>more difficult for both you and us to find a solution. You've indicated
>>>this works with the File driver, but you haven't shown us the error
>>>message or unexpected behaviour you get with the code above.
>>>
>>>Remember to run with strict turned on - I don't think you have with the
>>>code above. Break down the code into the smallest number of lines that
>>>exhibit the behaviour you are trying to demonstrate (you have been
>>>asked to do this on other occasions). I'm not going to write the test
>>>script for you myself.
>>>
>>>Mark
>>>
>>>
>>>
>>
>>
>>Here a complete test script :
>>
>>#!perl -w
>>use CGI qw(:standard);
>>use Switch;
>>use CGI::Session qw/-ip-match/;
>>use vars qw($dbh $session);
>>use DBI;
>>use strict;
>>
>>my $query ;
>>
>>$dbh ||= sqlConnect("DBI:mysql:recordz:localhost", "alexj", "xxx");
>>
>>execute ();
>>
>>
>>sub execute {
>>$query = new CGI ;
>> my $action = $query->param('action');
>> if ($action) {
>> switch ($action) {
>> case "login" {
>> login();
>> };
>> case "test" {
>> };
>> }
>> }
>>}
>>
>>sub login {
>> $session = new CGI::Session( "driver:MySQL", undef, { Handle =>
>>$dbh} );
>> my $username = "alexj";
>> $session->param("user_name", $username);
>> my $id = $session->id;
>> print "Content-type: text/html\n\n";
>> print "ID : $id";
>>}
>>
>>sub sqlConnect {
>> my $dbname = shift || '';
>> my $dbusername = shift || '';
>> my $dbpassword = shift || '';
>>
>> $dbh = DBI->connect($dbname, $dbusername, $dbpassword);
>> if (!$dbh) {
>> }
>> kill 9, $$ unless $dbh;
>>}
>
>
> OK - this is better but you still don't quite get it. I'm not exactly sure what
> your problem is at the moment (you haven't stated it clearly, despite repeated
> prompting): is it that CGI::Session fails with an error message, or that you don't
> get anything in the database table? To save time, and my hair, we need to see
> something like:
>
> use strict;
> use warnings;
>
> use CGI::Session qw/-ip-match/;
> use DBI;
>
> my $dbname = "dbname";
> my $dbusername = "dbusername";
> my $dbpassword = "dbpassword";
>
> my $dbh = DBI->connect($dbname, $dbusername, $dbpassword)
> or die "could not open db connection - error = $DBI::errstr";
>
> my $session =
> CGI::Session->new( "driver:MySQL", undef, { Handle => $dbh} );
>
> $session->param( testkey => "testdata" );
>
> print "stored session with id " . $session->id();
>
> You can then check in the db table directly to see if the session has been stored.
> I will leave it as an exercise to you to come up with a minimal script to pull
> sessions out again.
>
> Once the above is working properly, you can experiment with more complex data
> structures and wiring it back into your cgi script.
>
>
>
>>sub sqlConnect {
>> my $dbname = shift || '';
>> my $dbusername = shift || '';
>> my $dbpassword = shift || '';
>>
>> $dbh = DBI->connect($dbname, $dbusername, $dbpassword);
>> if (!$dbh) {
>> }
>> kill 9, $$ unless $dbh;
>>}
>
>
> kill? bit harsh, plus you have no idea what the error is. You want
>
> die $DBI::errstr unless $dbh;
thanks, I think there is a problem under windows, $session->param(
user_name => "testdata" ); is not written for a session table
based on a db :
CREATE TABLE `sessions` (
`id` char(32) NOT NULL,
`a_session` text NOT NULL,
`user_name` varchar(100) NOT NULL,
UNIQUE KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
------------------------------
Date: Mon, 30 May 2005 13:17:02 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: CGI::Session with MySQL Driver
Message-Id: <Xns96665E3B0BEAFasu1cornelledu@127.0.0.1>
Alexandre Jaquet <alexj@freesurf.ch> wrote in
news:429b107e$0$1147$5402220f@news.sunrise.ch:
> thanks, I think there is a problem under windows, $session->param(
> user_name => "testdata" ); is not written for a session table
>
> based on a db :
>
> CREATE TABLE `sessions` (
> `id` char(32) NOT NULL,
> `a_session` text NOT NULL,
> `user_name` varchar(100) NOT NULL,
> UNIQUE KEY `id` (`id`)
> ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
The session data are stored in the a_session field by the CGI::Session
driver. You should use the param method of the CGI::Session object you
have created to access that information.
Trust me, this is in the documentation.
Now, another problem with your code was pointed out elsethread
(regarding the arguments to the CGI::Session constructor). You will need
to fix that before doing anything else.
READ THE DOCUMENTATION.
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)
comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: Mon, 30 May 2005 15:42:03 +0200
From: Fabian Pilkowski <pilkowsk@informatik.uni-marburg.de>
Subject: Re: CGI::Session with MySQL Driver
Message-Id: <3g0jf5F9jd80U1@individual.net>
* Alexandre Jaquet schrieb:
> Mark Clements a écrit :
[problems with CGI::Session]
>>
>> Remember to run with strict turned on - I don't think you have with the
>> code above. Break down the code into the smallest number of lines that
>> exhibit the behaviour you are trying to demonstrate (you have been
>> asked to do this on other occasions). I'm not going to write the test
>> script for you myself.
>
> Here a complete test script :
Ok, I have already suggested to use your script with my fixes as basis.
This is your script, but without my fixes!?
>
> #!perl -w
> use CGI qw(:standard);
> use Switch;
> use CGI::Session qw/-ip-match/;
> use vars qw($dbh $session);
Please, don't use "use vars". Declare your vars with my() instead.
> use DBI;
> use strict;
>
> my $query ;
Please, assign "new CGI" to this var.
>
> $dbh ||= sqlConnect("DBI:mysql:recordz:localhost", "alexj", "xxx");
Always, $dbh isn't defined here since its the first appearance of it.
my $dbh = sqlConnect("DBI:mysql:recordz:localhost", "alexj", "xxx");
>
> execute ();
>
> sub execute {
> $query = new CGI ;
Please, delete this line!
> my $action = $query->param('action');
> if ($action) {
> switch ($action) {
> case "login" {
> login();
> };
> case "test" {
> };
> }
> }
> }
>
> sub login {
> $session = new CGI::Session( "driver:MySQL", undef, {Handle => $dbh} );
> my $username = "alexj";
> $session->param("user_name", $username);
> my $id = $session->id;
> print "Content-type: text/html\n\n";
Please, send the HTTP header you really want instead of making your own.
Try out:
print $session->header();
> print "ID : $id";
> }
>
> sub sqlConnect {
> my $dbname = shift || '';
> my $dbusername = shift || '';
> my $dbpassword = shift || '';
>
> $dbh = DBI->connect($dbname, $dbusername, $dbpassword);
> if (!$dbh) {
> }
> kill 9, $$ unless $dbh;
> }
I thought, sqlConnect should return a valid databasehandle. This does
not. Try to remove the last three lines of this sub.
Additionally, I rewrite your testscript with all fixes I mentioned
above. It seems you won't put them in place if I just write it.
#!/usr/bin/perl -w
use strict;
use CGI;
use CGI::Carp qw( fatalsToBrowser );
use Switch;
use CGI::Session qw( -ip-match );
use DBI;
my $dbh = DBI->connect( "DBI:mysql:recordz:localhost", "alexj", "xxx" );
my $query = new CGI;
my $action = $query->param( 'action' );
if ( $action ) {
switch ( $action ) {
case "login" {
my $session = new CGI::Session( "driver:MySQL", undef, {Handle=>$dbh} );
$session->param( "user_name", "alexj" );
print $session->header();
print "SESSIONID: ", $session->id;
};
case "test" {
my $session = new CGI::Session( "driver:MySQL", $query, {Handle=>$dbh} );
print $session->header();
print "SESSIONID: ", $session->id;
print "USERNAME: ", $session->param( "user_name" );
};
}
}
else {
print CGI::header(), "no action param given";
}
__END__
Place this script on your webserver and try to run it. Once with param
"action=login" and afterwards with "action=test". For me, this works as
it should.
regards,
fabian
------------------------------
Date: Mon, 30 May 2005 15:46:07 +0200
From: Alexandre Jaquet <alexj@freesurf.ch>
Subject: Re: CGI::Session with MySQL Driver
Message-Id: <429b1921$0$1160$5402220f@news.sunrise.ch>
Fabian Pilkowski a écrit :
> * Alexandre Jaquet schrieb:
>
>>Mark Clements a écrit :
>
>
> [problems with CGI::Session]
>
>
>>>Remember to run with strict turned on - I don't think you have with the
>>>code above. Break down the code into the smallest number of lines that
>>>exhibit the behaviour you are trying to demonstrate (you have been
>>>asked to do this on other occasions). I'm not going to write the test
>>>script for you myself.
>>
>>Here a complete test script :
>
>
> Ok, I have already suggested to use your script with my fixes as basis.
> This is your script, but without my fixes!?
>
>
>>#!perl -w
>>use CGI qw(:standard);
>>use Switch;
>>use CGI::Session qw/-ip-match/;
>>use vars qw($dbh $session);
>
>
> Please, don't use "use vars". Declare your vars with my() instead.
>
>
>>use DBI;
>>use strict;
>>
>>my $query ;
>
>
> Please, assign "new CGI" to this var.
>
>
>>$dbh ||= sqlConnect("DBI:mysql:recordz:localhost", "alexj", "xxx");
>
>
> Always, $dbh isn't defined here since its the first appearance of it.
>
> my $dbh = sqlConnect("DBI:mysql:recordz:localhost", "alexj", "xxx");
>
>
>>execute ();
>>
>>sub execute {
>>$query = new CGI ;
>
>
> Please, delete this line!
>
>
>> my $action = $query->param('action');
>> if ($action) {
>> switch ($action) {
>> case "login" {
>> login();
>> };
>> case "test" {
>> };
>> }
>> }
>>}
>>
>>sub login {
>> $session = new CGI::Session( "driver:MySQL", undef, {Handle => $dbh} );
>> my $username = "alexj";
>> $session->param("user_name", $username);
>> my $id = $session->id;
>> print "Content-type: text/html\n\n";
>
>
> Please, send the HTTP header you really want instead of making your own.
> Try out:
>
> print $session->header();
>
>
>> print "ID : $id";
>>}
>>
>>sub sqlConnect {
>> my $dbname = shift || '';
>> my $dbusername = shift || '';
>> my $dbpassword = shift || '';
>>
>> $dbh = DBI->connect($dbname, $dbusername, $dbpassword);
>> if (!$dbh) {
>> }
>> kill 9, $$ unless $dbh;
>>}
>
>
> I thought, sqlConnect should return a valid databasehandle. This does
> not. Try to remove the last three lines of this sub.
>
> Additionally, I rewrite your testscript with all fixes I mentioned
> above. It seems you won't put them in place if I just write it.
>
>
> #!/usr/bin/perl -w
> use strict;
> use CGI;
> use CGI::Carp qw( fatalsToBrowser );
> use Switch;
> use CGI::Session qw( -ip-match );
> use DBI;
>
> my $dbh = DBI->connect( "DBI:mysql:recordz:localhost", "alexj", "xxx" );
> my $query = new CGI;
>
> my $action = $query->param( 'action' );
> if ( $action ) {
> switch ( $action ) {
> case "login" {
>
> my $session = new CGI::Session( "driver:MySQL", undef, {Handle=>$dbh} );
> $session->param( "user_name", "alexj" );
> print $session->header();
> print "SESSIONID: ", $session->id;
>
> };
> case "test" {
>
> my $session = new CGI::Session( "driver:MySQL", $query, {Handle=>$dbh} );
> print $session->header();
> print "SESSIONID: ", $session->id;
> print "USERNAME: ", $session->param( "user_name" );
>
> };
> }
> }
> else {
> print CGI::header(), "no action param given";
> }
> __END__
>
>
> Place this script on your webserver and try to run it. Once with param
> "action=login" and afterwards with "action=test". For me, this works as
> it should.
>
> regards,
> fabian
Great many thanks fabian :)
------------------------------
Date: Mon, 30 May 2005 16:09:50 +0200
From: Fabian Pilkowski <pilkowsk@informatik.uni-marburg.de>
Subject: Re: CGI::Session with MySQL Driver
Message-Id: <3g0l30F9vua4U1@individual.net>
* Alexandre Jaquet schrieb:
> Fabian Pilkowski a écrit :
>> * Alexandre Jaquet schrieb:
>>>
>>> my $SESSION = new CGI::Session( "driver:MySQL", undef, {Handle => $dbh} );
>>> $SESSION->param("user_name", \@my_array);
>>
>> It seems to be all right.
>>
>> How do you verify that this value is not saved in your session? Do you
>> look into the database by hand, don't you?
>>
>> I assume your problem is to get back this session instead of creating a
>> new one each time your script is called. Could this be?
>
> hi fabian, yes I look it by doing a sqlquery to verify, but the field
> user_name is alway empty
Ok, as Sinan has already written, this is your real problem. The field
user_name you have in your MySQL table will never be filled. It'll be
empty forever (and that's ok).
Please look into the field "a_session" where a dump of your session is
stored (in Data::Dumper-style as default, but you know: this is already
mentioned in the docs).
>
> first I want to make my datas persistent into the db then I will check
> out if exising session can be reopended
Please, read the docs first to learn where you have to look for your
values instead of looking anywhere. Your bad assumption is, you need
extra fields in your table -- which isn't true. Well, I know you have
read this often in this thread, but:
Read the documentaion first.
Btw, you never said that you want to store your values in separate
fields in your MySQL table. Nobody could know about this, because it's
not the usual way in combination with CGI::Session.
regards,
fabian
------------------------------
Date: Mon, 30 May 2005 10:26:21 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: CGI::Session with MySQL Driver
Message-Id: <slrnd9mc4t.j1c.tadmc@magna.augustmail.com>
Fabian Pilkowski <pilkowsk@informatik.uni-marburg.de> wrote:
> * Alexandre Jaquet schrieb:
>> use vars qw($dbh $session);
>
> Please, don't use "use vars". Declare your vars with my() instead.
Let's make that more accurate:
Please, don't use package variables when lexical variables will do.
Declare your vars with my() instead.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 30 May 2005 09:37:04 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: http auth logindialog box
Message-Id: <slrnd9m98f.j1c.tadmc@magna.augustmail.com>
Nikos <hackeras@gmail.com> wrote:
> Tad McClellan wrote:
> ....{snip]
>
> Well have you encounter something relevant
Relevant to what?
Please quote some context in followups like everybody else does.
And don't put in a attribution unless you are actually going
to quote something that goes with the attribution.
> in the past?
Maybe you meant relevant to getting auth for your CGI program?
Well, yes I have encountered something relevant, how the heck did
you think that I knew to point you toward looking at configuring
the web server?
Because it has happened to me before, and that is how I solved it.
> Perhaps if you did, could you paste some code
I could, but I won't.
I plan to studiously avoid helping you until your behavior improves.
You build your reputation, and then you live with the reputation
that you have built.
> to see how am i supposed
> to do what i want
Unlike you, I do *not* want to piss off everybody here by making
off-topic postings, so I wouldn't be explaining web server
configuration stuff in the Perl newsgroup anyway.
> cause i am completely clueless.
No you're not, I gave you one little clue and one big clue in
the part that you snipped above!
You are not merely "clueless", you are "clue resistant" to a most
astonishing degree.
The little clue was that you are looking for the answer in the wrong
place. In other words, you are looking for the keys only where the
streetlight shines.
Look for the answer in a newsgroup about the subject that you
need help with, such as:
comp.infosystems.www.servers.mac
comp.infosystems.www.servers.misc
comp.infosystems.www.servers.ms-windows
comp.infosystems.www.servers.unix
The big clue was that you don't have the Big Picture of the domain
that you are attempting to program in.
You will waste a whole lot of time if you simply press on in ignorance
rather than stop and go find out how this stuff operates.
> I did it onw in PHP and was an easy atsk to do but in Perl although i
> googled didnt come up with something.
Were you googling in the right place to look or in the wrong place to look?
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 30 May 2005 20:23:55 +0300
From: Nikos <hackeras@gmail.com>
Subject: Re: http auth logindialog box
Message-Id: <d7fi7i$22h$1@nic.grnet.gr>
Tad McClellan wrote:
> Nikos <hackeras@gmail.com> wrote:
>
>>Tad McClellan wrote:
>>....{snip]
>>
>>Well have you encounter something relevant
>
>
>
> Relevant to what?
>
> Please quote some context in followups like everybody else does.
>
> And don't put in a attribution unless you are actually going
> to quote something that goes with the attribution.
>
>
>
>>in the past?
>
>
>
> Maybe you meant relevant to getting auth for your CGI program?
>
> Well, yes I have encountered something relevant, how the heck did
> you think that I knew to point you toward looking at configuring
> the web server?
>
> Because it has happened to me before, and that is how I solved it.
>
>
>
>>Perhaps if you did, could you paste some code
>
>
>
> I could, but I won't.
>
> I plan to studiously avoid helping you until your behavior improves.
>
> You build your reputation, and then you live with the reputation
> that you have built.
>
>
>
>>to see how am i supposed
>>to do what i want
>
>
>
> Unlike you, I do *not* want to piss off everybody here by making
> off-topic postings, so I wouldn't be explaining web server
> configuration stuff in the Perl newsgroup anyway.
>
>
>
>>cause i am completely clueless.
>
>
>
> No you're not, I gave you one little clue and one big clue in
> the part that you snipped above!
>
> You are not merely "clueless", you are "clue resistant" to a most
> astonishing degree.
>
> The little clue was that you are looking for the answer in the wrong
> place. In other words, you are looking for the keys only where the
> streetlight shines.
>
> Look for the answer in a newsgroup about the subject that you
> need help with, such as:
>
> comp.infosystems.www.servers.mac
> comp.infosystems.www.servers.misc
> comp.infosystems.www.servers.ms-windows
> comp.infosystems.www.servers.unix
>
> The big clue was that you don't have the Big Picture of the domain
> that you are attempting to program in.
>
> You will waste a whole lot of time if you simply press on in ignorance
> rather than stop and go find out how this stuff operates.
>
>
>
>>I did it onw in PHP and was an easy atsk to do but in Perl although i
>>googled didnt come up with something.
>
>
>
> Were you googling in the right place to look or in the wrong place to look?
>
>
look man i have to get this going.
I have no problem reading something but i dont know what.
maybe the apache web server need some configuration but i understand
that not the proper place to ask that.
BUT, also some perl code is included and thats a perl questions and i
really could use a lot of help on that.
It looks simple but its a synthetic problem.
Iam on XP btw.
--
What is now proved was once only imagined!
------------------------------
Date: Mon, 30 May 2005 17:37:16 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: http auth logindialog box
Message-Id: <Xns96668A59C454Easu1cornelledu@127.0.0.1>
Nikos <hackeras@gmail.com> wrote in news:d7fi7i$22h$1@nic.grnet.gr:
> look man i have to get this going.
Your problem.
> It looks simple but its a synthetic problem.
Do you know the meanings of the words you use?
http://www.google.com/search?q=define%3A+synthetic
On the other hand, maybe it is appropriate. There was no problem, and you
created one.
You have just entered my "someone else's problem" field.
Tad has already pointed you in the right direction.
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(reverse each component and remove .invalid for email address)
comp.lang.perl.misc guidelines on the WWW:
http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
------------------------------
Date: Mon, 30 May 2005 18:49:15 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: http auth logindialog box
Message-Id: <d7fjms$686$2@slavica.ukpost.com>
A. Sinan Unur wrote:
> Nikos <hackeras@gmail.com> wrote in news:d7fi7i$22h$1@nic.grnet.gr:
>
>>It looks simple but its a synthetic problem.
>
> Do you know the meanings of the words you use?
I thought he was saying it was homework. :-)
------------------------------
Date: Mon, 30 May 2005 19:02:08 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: http auth logindialog box
Message-Id: <d7fkf3$69t$1@slavica.ukpost.com>
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.
I think you are very very confused about the relationship between HTTP
clients, HTTP servers and your Perl script.
By what mechanism is your Perl script being invoked? What is it
intended to do?
> my $browser = LWP::UserAgent->new;
LWP is a (non-interactive) web client written in Perl. Do you want your
script to act _as_ an HTTP client?
> I dont know why, but a box an http auth box never appears so i can test
> this by entering nikos and nikos.
What are you expecting to lauch this dialogue box? Usually it would be
launched by an interactive web browser but there's no such web broswer
in the situation you describe.
------------------------------
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 8131
***************************************