[26643] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 8750 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Dec 9 18:05:28 2005

Date: Fri, 9 Dec 2005 15:05:05 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 9 Dec 2005     Volume: 10 Number: 8750

Today's topics:
    Re: %USERACL Is Empty?! <wh2leung@student.cs.uwaterloo.ca>
    Re: %USERACL Is Empty?! xhoster@gmail.com
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Fri, 9 Dec 2005 15:13:52 -0500
From: William <wh2leung@student.cs.uwaterloo.ca>
Subject: Re: %USERACL Is Empty?!
Message-Id: <Pine.GSO.4.58.0512091449580.11141@cpu02.student.cs.uwaterloo.ca>

On Fri, 9 Dec 2005 xhoster@gmail.com wrote:

> William <wh2leung@student.cs.uwaterloo.ca> wrote:
> > basically %USERACL is a hash containing the key and values read from the
> > following file:
>
> No, it is not.  Nowhere in your program do you read from the following
> file and put it into that hash.
>
> > UserID=LoginID:Group:Name:Email:Password:IsAdmin:Status:Servers:Lists:Log
> > s:Macros:Eod:FileMgr:MacroList:PnL:EditPnL:BO
> > AADUBLINJORDAN=AADUBLINJORDAN:BO:AADUBLINJORDAN:AADUBLINJORDAN:XEV5iEflux
> > jWM:::::::::[]:[]:[]: CHANKN=CHANKN:SYS:Kenneth
> > Chan:kenneth.chan@abcCompany.com:XECiTZAqeyBjE:1:1::1:1:1:1:1:[]:[]:[]:
> >
> > Question #1) The following error was generated by "use warnings;"
> >
> > [mk_murex@mkmxg00 /mkapp/webapps/mxrt-cgi/upload_repo 12:45:03]$
> > ./test.pl
> > > output.txt
> > Can't locate warnings.pm in @INC (@INC contains:
> > /usr/perl5/5.00503/sun4-solaris /usr/perl5/5.00503
> > /usr/perl5/site_perl/5.005/sun4-solaris /usr/perl5/site_perl/5.005 .) at
> > ./test.pl line 4.
> > BEGIN failed--compilation aborted at ./test.pl line 4.
>
Xho wrote:
> You have an ancient version of perl.  It does not come with the warnings.pm
> module.  Either upgrade perl or don't "use warnings".  (Use the -w switch
> instead.)
>

I have removed "use warnings" and put
#!/usr/bin/perl -w

on line 1 of mxrt_auth.pl instead.

> > NOTE1: for line 10 of test.pl:
> >
> > mxrt_auth.pl::initAuthMrg is defined as follows:
> >
> > sub initAuthMgr {
> >     ($AUTHQ) = @_;
> >     %AUTH_INFO = $AUTHQ->cookie('MXRT_USERACL');
>
> Does $AUTHQ have a cookie named MXRT_USERACL?

KEY QUESTION:
How do I obtain a list of cookies for $AUTHQ?


>
> >     foreach (keys %AUTH_INFO) {
> >         print ($AUTH_INFO{$_})."<br>";
> >     }
> >     return  %AUTH_INFO;
> > }
> >
> > Question #2) nothing is printed by line 12-14 of test.pl.  (Even
> > without the line "use warnings;")
> >
> > Why???
>
> Probably because there is nothing to print.

I agree.  I just found out that %AUTH_INFO has 0 keys.

my check:

sub initAuthMgr {
    ($AUTHQ) = @_;
    %AUTH_INFO = $AUTHQ->cookie('MXRT_USERACL');
    my $num_keys = keys %AUTH_INFO;
    print $num_keys;        # problem found - %AUTH_INFO has 0 keys
    foreach (keys %AUTH_INFO) {
        print ($AUTH_INFO{$_})."<br>";
    }
    return %AUTH_INFO;
}

> > Expected output of the following script - test.pl:
> > IsAdmin=1
> > Status=1
> > Servers=1
> > ...
>
> I didn't expect that to be the outcome.


------------------------------

Date: 09 Dec 2005 20:53:28 GMT
From: xhoster@gmail.com
Subject: Re: %USERACL Is Empty?!
Message-Id: <20051209155328.142$k0@newsreader.com>

William <wh2leung@student.cs.uwaterloo.ca> wrote:
> >
> > Does $AUTHQ have a cookie named MXRT_USERACL?
>
> KEY QUESTION:
> How do I obtain a list of cookies for $AUTHQ?

By analogy with the param() method, I assumed that calling cookie() with
no parameters gives you a list of cookie names.  An experiment showed this
to be true, but it wasn't documented in the POD for CGI.

However, cookies have to be set by something.  Presumably, you have control
or at least knowledge of the thing that sets those cookies.  So the best
way to figure out what a cookie is called is probably to look in the code
that sets it, rather than by introspection of the submitted request.


Xho

-- 
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service                        $9.95/Month 30GB


------------------------------

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 8750
***************************************


home help back first fref pref prev next nref lref last post