[24777] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 6930 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Aug 29 21:06:31 2004

Date: Sun, 29 Aug 2004 18:05:08 -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           Sun, 29 Aug 2004     Volume: 10 Number: 6930

Today's topics:
        Apache Cookie Issue <marcelluswallace@hotpop.com>
    Re: Execute Windows program from Perl script (??) <noreply@gunnar.cc>
    Re: Execute Windows program from Perl script (??) <zebee@zip.com.au>
    Re: Execute Windows program from Perl script (??) (Tony McGuire)
    Re: how many days ago is 2003-07-20 ? <noreply@gunnar.cc>
    Re: how many days ago is 2003-07-20 ? (Anno Siegel)
    Re: Larry Wall & Cults <foo@bar.net>
    Re: Object Oriented programs, Perl and others <mb@uq.net.au.invalid>
    Re: Object Oriented programs, Perl and others <mb@uq.net.au.invalid>
    Re: OS/2 port of Perl 5.8 not adding CR to \n <nospam-abuse@ilyaz.org>
    Re: pass 2d array to C function (min)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sun, 29 Aug 2004 21:47:55 GMT
From: "Marcellus Wallace" <marcelluswallace@hotpop.com>
Subject: Apache Cookie Issue
Message-Id: <fasYc.204214$8_6.16366@attbi_s04>

i've been trying to fix this all day, and could use some help

my setup:

i have an apache server (1.3.29 on linux) on my home network.  I use this
server for development (perl).

i have a site that uses Apache::AuthCookie for authentication

i access this site through 192.168.0.56/nameofsite.com

submitting the login form (username/password) sets the cookie and I'm in,
always has worked until today.

all of a sudden I can't set cookies when accessing this server.  It still
worked using firefox so I figured it may be my IE, but I've tried it from IE
on 3 different machines on the network that haven't been touch in a while
and same result.  also have tried the live site (different server) with IE
and it works fine (same exact code, even brought that code down to my dev
machine to check, no go)

I tried setting IE to prompt for cookies and there is no prompt, it's as if
it's automatically blocking IE cookies.  I know if it's checking against the
database because if I put in the wrong password it tell me so.  So again,
it's for some reason auto rejecting IE cookies.


Any help would be appreciated and please reply to the group.

Thanks







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

Date: Sun, 29 Aug 2004 20:41:11 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Execute Windows program from Perl script (??)
Message-Id: <2pemavFk12isU1@uni-berlin.de>

Tony McGuire wrote:
> So I'm just going to use the perl script (or CGI script, whatever
> the @#$$ it is),

You seem not to be interested in understanding the distinction between
running a Perl program from the command line and running it as a CGI
process. You'll keep being unhappy with CGI - whichever programming
language was used for writing the program - until you acknowledge and
learn the differences between those ways of invoking a program.

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: Sun, 29 Aug 2004 20:42:47 GMT
From: Zebee Johnstone <zebee@zip.com.au>
Subject: Re: Execute Windows program from Perl script (??)
Message-Id: <slrncj4fjj.mvq.zebee@zeus.zipworld.com.au>

In comp.lang.perl.misc on 29 Aug 2004 10:58:52 -0700
Caj Zell <cajzell@hotmail.com> wrote:
> 
> I browse this ng quite often and from many of the threads I've seen, I
> have grown so conscious of what I would be asking (and thinking about
> whether it is stupid, or not) that I very seldom put a question here.
> These guys are probably right (at least to some extent), but it cannot
> be the meaning that a stupid perl newbie like myself feels so
> intimidated by the responses that he dare not pose a question.
> 

I think that attitude of many perlprogs is why learn.perl.org was
started.  The people there *want* folk to program in perl and are
willing to help them learn to do so.  

That said...  one useful thing a forum like this does is make you thnk
about what you ask, and that act of thinking can mean you get the
answer.

I've pondered a couple of questions, started writing them, realised I
needed more info or to test something, and found a workable solution.

It's made me work, not take the easy way out.

I suspect most folk starting out would be better off at learn.perl.org

Zebee


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

Date: 29 Aug 2004 17:58:05 -0700
From: tony@paradoxcommunity.com (Tony McGuire)
Subject: Re: Execute Windows program from Perl script (??)
Message-Id: <f896a829.0408291658.35045cbb@posting.google.com>

cajzell@hotmail.com (Caj Zell) wrote

Usenet is known for its high jerk-vs-helper ratio.

We still wade in, hoping to find a diamond amongst the coal.


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

Date: Sun, 29 Aug 2004 20:33:49 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: how many days ago is 2003-07-20 ?
Message-Id: <2pelt4FiqqmjU1@uni-berlin.de>

Anno Siegel wrote:
> Gunnar Hjalmarsson wrote:
>> Anno Siegel wrote:
>>> Gunnar Hjalmarsson wrote:
>>>> Anno Siegel wrote:
>>>>>
>>>> 
>>>>     sub daysago {
>>>>         shift =~ /^(\d{4})-(\d{2})-(\d{2})$/
>>>>           or die "Invalid date format";
>>>>         require Time::Local;
>>>>         import Time::Local 'timelocal';
>>>>         my $diff = timelocal(0,0,0,(localtime $^T)[3..5])
>>>>           - timelocal(0,0,0,$3,$2-1,$1-1900);
>>>>         $diff >= 0 or die "Future date not allowed";
>>>>         sprintf '%.0f', $diff / 86400
>>>>     }
>>>>
>>>>     print daysago('2003-07-20'), "\n";
>>>> 
>>>>> Note that in the presence of DST a day may have more or
>>>>> less than 24 hours.
>>>> 
>>>> Doesn't the above sub take care of that?
>>> 
>>> I don't know, but it is only obviously correct if the interval
>>> between the two times is a multiple of 24 hours.
>> 
>> Hey, how is your math? ;-)  We know it may differ 1/24 day, and
>> since that it far less than 1/2, to me it's pretty obvious that
>> sprintf() makes it return the correct number of days.
> 
> ...supposing that the rounded number is indeed what is wanted in
> this case.  It may differ from the number of complete calendar days
> between the dates.

I have absolutely no idea what you are refering to here, Anno. Did you
see that the code disregards the first three elements that localtime()
returns? Could you possibly give an example when the function would
return anything else but the number of complete calendar days since
the date that is passed to it?

> Then there's the problem of non-existent and ambiguous times that 
> comes with DST.

What's the nature of that problem?

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


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

Date: 29 Aug 2004 19:54:23 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: how many days ago is 2003-07-20 ?
Message-Id: <cgtc9f$10f$1@mamenchi.zrz.TU-Berlin.DE>

Gunnar Hjalmarsson  <noreply@gunnar.cc> wrote in comp.lang.perl.misc:
> Anno Siegel wrote:
> > Gunnar Hjalmarsson wrote:
> >> Anno Siegel wrote:
> >>> Gunnar Hjalmarsson wrote:
> >>>> Anno Siegel wrote:
> >>>>>
> >>>> 
> >>>>     sub daysago {
> >>>>         shift =~ /^(\d{4})-(\d{2})-(\d{2})$/
> >>>>           or die "Invalid date format";
> >>>>         require Time::Local;
> >>>>         import Time::Local 'timelocal';
> >>>>         my $diff = timelocal(0,0,0,(localtime $^T)[3..5])
> >>>>           - timelocal(0,0,0,$3,$2-1,$1-1900);
> >>>>         $diff >= 0 or die "Future date not allowed";
> >>>>         sprintf '%.0f', $diff / 86400
> >>>>     }
> >>>>
> >>>>     print daysago('2003-07-20'), "\n";
> >>>> 
> >>>>> Note that in the presence of DST a day may have more or
> >>>>> less than 24 hours.
> >>>> 
> >>>> Doesn't the above sub take care of that?
> >>> 
> >>> I don't know, but it is only obviously correct if the interval
> >>> between the two times is a multiple of 24 hours.
> >> 
> >> Hey, how is your math? ;-)  We know it may differ 1/24 day, and
> >> since that it far less than 1/2, to me it's pretty obvious that
> >> sprintf() makes it return the correct number of days.
> > 
> > ...supposing that the rounded number is indeed what is wanted in
> > this case.  It may differ from the number of complete calendar days
> > between the dates.
> 
> I have absolutely no idea what you are refering to here, Anno. Did you
> see that the code disregards the first three elements that localtime()
> returns? Could you possibly give an example when the function would
> return anything else but the number of complete calendar days since
> the date that is passed to it?

I don't remember saying it doesn't.  It would be your job to prove
that it does, and (a lot harder) to describe the conditions under
which it does.  Only the latter is relevant to my point.

My point is that the seemingly clear notion of the number of days
between two calendar dates must be re-defined in view of the fact
that two midnights aren't necessarily a multiple of 24 hours apart.
You assume that rounding is the answer, but other answers could be
given, which might differ by one under various circumstances.

At this point I might decide to use a module that (presumably)
has come up with a solution that is both consistent in itself
and with intuitive notions, and which is reasonably general
with respect to local DST variations.

> > Then there's the problem of non-existent and ambiguous times that 
> > comes with DST.
> 
> What's the nature of that problem?

Some valid time specifications don't correspond to a point in time
(when a calendar hour has been jumped over), and others correspond
to two (when a calendar hour has been repeated).  Granted, DST
regulations don't do that around midnight, but that is a restriction
in the validity of the algorithm, or it must be taken into account
anyway.

Anno


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

Date: Sun, 29 Aug 2004 17:02:23 -0700
From: Mac <foo@bar.net>
Subject: Re: Larry Wall & Cults
Message-Id: <pan.2004.08.30.00.02.19.911327@bar.net>

On Sun, 29 Aug 2004 06:58:30 +0000, Brian Inglis wrote:

> On Sat, 28 Aug 2004 20:59:08 -0700 in alt.folklore.computers, Mac
> <foo@bar.net> wrote:
> 
>>On Wed, 25 Aug 2004 14:56:06 -0700, Xah Lee wrote:
>>
>>> Larry Wall and Cults
>>> (Lazyness, Impatience and Hubris)
>>> 200012
> 
>>> Surely you have heard of Adolf Hitler
>>> and his atrocities of genocide? I must alert you, that a single person
>>> couldn't commit such a crime.
>>
>>Wow, Godwin's law invoked on the first post of the thread.
> 
> Not quite, no comparison was made; see: 
> http://groups.google.com/groups?as_umsgid=1991Oct22.140831.23313%40eff.org


Hmm. No explicit comparison was made, but since the post is a cautionary
tale (well, the post is a rambling mess, but I think it is trying to be a
cautionary tale) I think the comparison is understood.

But if the comparison must be explicit, as you seem to be saying, then I
have to concede the point.

Best regards,
Mac



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

Date: Mon, 30 Aug 2004 10:45:33 +1000
From: Matthew Braid <mb@uq.net.au.invalid>
Subject: Re: Object Oriented programs, Perl and others
Message-Id: <cgttbd$hof$1@bunyip.cc.uq.edu.au>

Uri Guttman wrote:

> wait for perl6. it will have all that you ask for and more. perl5 won't
> ever have it but you can use modules that do support some of those
> ideas. also get the book 'object oriented perl' by damian conway. it
> will teach you all you need to know about OO perl.
> 
> uri
> 

I'm kind of surprised perl6 will have all of that - I thought closing classes 
was against the whole perl 'thing' :)

I'm beginning to get a little worried about perl6 - from what I've seen on its 
development it seems to be more and more driven on "hey, wouldn't it be cool if 
we could do this" or "look, I've defined yet another way to do X" and less and 
less on "this is a concise, non-ambiguous way of doing X". Hopefully I've just 
been looking in the wrong place.

MB


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

Date: Mon, 30 Aug 2004 10:48:17 +1000
From: Matthew Braid <mb@uq.net.au.invalid>
Subject: Re: Object Oriented programs, Perl and others
Message-Id: <cgttgh$hof$2@bunyip.cc.uq.edu.au>

Anno Siegel wrote:

> Your terminology is slightly off.  It's classes that inherit from
> one another.  Saying that an object inherits something is common,
> but nothing but a manner of speech.  Saying that an object inherits
> from another object is wrong.

You're right - sorry, I was writing that a little too fast to double check my 
terminology.

> On a more general note, I believe it's futile to look for general
> solutions for Perl's defects it its support of OO techniques, such as
> failure to enforce privacy on classes and objects.  It has been noted
> that Perl 6 will be fully OO and it will certainly solve these issues.

I thought as much. As a side effect of all this thinking about it I've even 
started designing a language myself and it turns out its kinda fun. I didn't 
realise I was that much of a geek :) Of course, it'll never get off the ground 
but it passes the time.

> Singular solutions for one or more of these problems that are applicable
> in this or that situation are still of interest.  Damian's _Object
> Oriented Perl_ holds quite a few of those, and more are available
> among the Class::* modules.  The web site http://perldesignpatterns.com
> seems to be another relevant source, but I haven't seen enough of it
> to have an opinion.

I'll check into the Class::* modules - I've touched on them briefly in the past 
and some of them seemed pretty cool.

MB


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

Date: Sun, 29 Aug 2004 20:33:30 +0000 (UTC)
From:  Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: OS/2 port of Perl 5.8 not adding CR to \n
Message-Id: <cgteiq$21m4$1@agate.berkeley.edu>

[A complimentary Cc of this posting was NOT [manually] sent to
Shmuel (Seymour J.) Metz
<spamtrap@library.lspace.org.invalid>], who wrote in article <41320d13$3$fuzhry+tra$mr2ice@news.patriot.net>:
> I installed Perl 5.8 from
> <http://www.cpan.org/authors/id/I/IL/ILYAZ/os2/582+/> and was dismayed
> to see output lines on STDOUT terminated with just linefeed instead of
> CRLF.

"Dismayed"?!!!

Hint: a bug report should include: your code, what you expect to see
as the result, and what you actually see.

But trying to read your mind: are you using syswrite()?  With the new
IO model in place, syswrite() is automatically binmode().  This is
unfortunate, but sits quite deep in the innards of the (IMO, borken)
implementation of IO model.

Hope this helps,
Ilya


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

Date: 29 Aug 2004 12:27:45 -0700
From: minsanco@gmail.com (min)
Subject: Re: pass 2d array to C function
Message-Id: <6570baab.0408291127.27e866f6@posting.google.com>

I am using one that already exists.  The C function requires a void
**.  The array that will be passed in is of different datatypes
(double, string, etc).

Min

> 
> It depends.  Are you writing the C function, or merely using one that
> already exists?  If the later, what kind of 2D array does the C function
> expect to receive?
> 
> Xho


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

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


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