[10495] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4087 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Oct 27 19:05:52 1998

Date: Tue, 27 Oct 98 16:00:22 -0800
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, 27 Oct 1998     Volume: 8 Number: 4087

Today's topics:
        -w warnings with use lib pragma edwardquentinbridges@my-dejanews.com
        ASP for unix servers <mde@casema.net>
        Checking for uppercase <borchert@mountain-inter.net>
    Re: Checking for uppercase <arnej@fc.hp.com>
    Re: Checking for uppercase (Martien Verbruggen)
    Re: command line problem <rootbeer@teleport.com>
    Re: Forcing perl to garbage collect (Ilya Zakharevich)
        getopts question <ChintanA@worldnetcorp.com>
    Re: getopts question (Martien Verbruggen)
        IPC::Shareable problems (Bruce J. Keeler)
        non-looping range match <ianchurc@ozemail.com.au>
    Re: Not to start a language war but.. <jdporter@min.net>
    Re: Perl & Y2K - booby trap code <tchrist@mox.perl.com>
    Re: Perl & Y2K - booby trap code <uri@fastengines.com>
    Re: Perl & Y2K - booby trap code (Matt Knecht)
    Re: Perl & Y2K - booby trap code <tchrist@mox.perl.com>
    Re: Perl & Y2K - booby trap code <uri@fastengines.com>
    Re: Perl Error message <rootbeer@teleport.com>
    Re: Perl Error message <barnett@houston.Geco-Prakla.slb.com>
        Perl XS using C++ classes <jamie@howgarth.demon.co.uk>
    Re: persistent variables ? <rootbeer@teleport.com>
    Re: persistent variables ? <Paul.Coleman@CoSeCo.com>
    Re: persistent variables ? (Ben Coleman)
    Re: persistent variables ? <dgris@rand.dimensional.com>
    Re: persistent variables ? <Paul.Coleman@CoSeCo.com>
    Re: persistent variables ? <Paul.Coleman@CoSeCo.com>
    Re: persistent variables ? (Alastair)
    Re: psychology of language choice (was Re: language war <garry@sage.att.com>
    Re: psychology of language choice (was Re: language war <garry@sage.att.com>
    Re: Repost from Data (Martien Verbruggen)
    Re: Sending mail using perl (Martien Verbruggen)
    Re: Size of JPEG and GIF (Martien Verbruggen)
        use lib generates warnings with -w edwardquentinbridges@my-dejanews.com
    Re: Web Client Automation debel@my-dejanews.com
        Word Wrap <george@tapestry.net>
    Re: Word Wrap (Martien Verbruggen)
        Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)

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

Date: Tue, 27 Oct 1998 22:00:51 GMT
From: edwardquentinbridges@my-dejanews.com
Subject: -w warnings with use lib pragma
Message-Id: <715fqk$n0a$1@nnrp1.dejanews.com>

when i compile a CGI script with the -w switch, i get the following
warning about the lib.pm pragma (which i'm using for the script).

Warning message:
%> perl -cw Poll.cgi
Use of uninitialized value at /opt/lib/perl5/lib.pm line 17.
Poll.cgi syntax OK

any ideas why this would be happening with a standard module?

cc'ing your replies to my email address (edb@interport.net)
would be appreciated.

thanks
--e--

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 27 Oct 1998 23:28:58 +0100
From: "Marco de Moulin" <mde@casema.net>
Subject: ASP for unix servers
Message-Id: <715hfc$j5g$1@sun4000.casema.net>

Hello,

I am looking for a program that works as easy and comfortable like ASP
(active server pages from MS). At the moment I do not have a SQL server
installed. The server where the files are located is a Unix machine. A GPL
licence would be even better :-)

Thank you for your attention.

Marco de Moulin




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

Date: Tue, 27 Oct 1998 13:43:29 -0800
From: John Borchert <borchert@mountain-inter.net>
Subject: Checking for uppercase
Message-Id: <36363E81.1857FFA1@mountain-inter.net>

How can I properly check for uppercase.  I am looking for the equivalent
of something like:
  if upper($4) ne "_TOP"

My line of perl code is as follows:
  push(@goodLinks, $cBaseURL . $2) if $4 ne "_TOP" && $4 ne "_top";

Should I use a regex for this?
--
---------------------------------------------------------
John Borchert
borchert@mountain-inter.net
---------------------------------------------------------




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

Date: Tue, 27 Oct 1998 15:39:18 -0700
From: Arne Jamtgaard <arnej@fc.hp.com>
Subject: Re: Checking for uppercase
Message-Id: <36364B96.1BF1@fc.hp.com>

John Borchert wrote:

> How can I properly check for uppercase.  I am looking for the
> equivalent of something like:
>   if upper($4) ne "_TOP"

That sounds like:

    if ("\U$4" ne "_TOP")

to me.  The \U in the double quotes forces the $4 into upper case, 
which looks like what you want.

Arne "Risking embarassment twice in one day" Jamtgaard


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

Date: Tue, 27 Oct 1998 23:13:02 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Checking for uppercase
Message-Id: <2ssZ1.59$085.139889@nsw.nnrp.telstra.net>

In article <36363E81.1857FFA1@mountain-inter.net>,
	John Borchert <borchert@mountain-inter.net> writes:
> How can I properly check for uppercase.  I am looking for the equivalent
> of something like:
>   if upper($4) ne "_TOP"

# perldoc -f uc
# perldoc perlfunc

Martien
-- 
Martien Verbruggen                      |
Webmaster www.tradingpost.com.au        | "In a world without fences,
Commercial Dynamics Pty. Ltd.           |  who needs Gates?"
NSW, Australia                          |


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

Date: Tue, 27 Oct 1998 22:08:12 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: command line problem
Message-Id: <Pine.GSO.4.02A.9810271407320.3421-100000@user2.teleport.com>

On Tue, 27 Oct 1998, Marcus J. Foody wrote:

> My problem is how do I call up my bcp statement within my perl script?

Probably the same way you'd call any other program from Perl. See the
perlipc manpage for more details. Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: 27 Oct 1998 22:02:49 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Forcing perl to garbage collect
Message-Id: <715fu9$dae$1@mathserv.mps.ohio-state.edu>

[A complimentary Cc of this posting was sent to 
<droby@copyright.com>],
who wrote in article <715bvq$hhc$1@nnrp1.dejanews.com>:
> > > I was curious too, so I tried it.  No go.  In fact, it shows up twice with
> or
> > > without the clearing attempt.  If you substitute $i = 'abc123' for $i = `cat
> > > z.in`, it reduces to one, so I guess one of them is a temporary copy created
> > > by the ``.
> >
> > Correct.  Temporaries are not touched (until reused, or interpreter
> > dies).  But even if reused or forgotten, the string buffer is just
> > free()ed or realloc()ed, which does not guarantie anything.
> >
> > > It might be that the s/./\0/g clears it but creates another
> > > temporary copy in the process.
> >
> > No, it should not.  An optimization should be triggered, and no new
> > memory is going to be allocated.
> >
> 
> Well then.  Something's holding onto the value.  At least in Perl5.00401.

Yes.  But you correctly (IMO) determined who: the temporary of ``.

Ilya


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

Date: Tue, 27 Oct 1998 16:02:31 -0600
From: Chintan Adhyapak <ChintanA@worldnetcorp.com>
Subject: getopts question
Message-Id: <363642F7.A1AFE2AC@worldnetcorp.com>

Hi, I am using getopts to read command line args. The camel book says,
"getopts halts argument processing upon reading an argument without a
leading '-'. This is not considered an error. So a user might invoke 
your program with invalid arguments without your being notified of the 
fact. However, you can always check to see whether @ARGV has been 
completely emptied or not - that is, whether all arguments have been 
processed."
How do I verify that? Thanks,

Chintan


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

Date: Tue, 27 Oct 1998 23:11:41 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: getopts question
Message-Id: <NqsZ1.58$085.139889@nsw.nnrp.telstra.net>

In article <363642F7.A1AFE2AC@worldnetcorp.com>,
	Chintan Adhyapak <ChintanA@worldnetcorp.com> writes:

> fact. However, you can always check to see whether @ARGV has been 
> completely emptied or not - that is, whether all arguments have been 
> processed."
> How do I verify that? Thanks,

Check $#ARGV or @ARGV in a scalar context.

# perldoc perldata

Martien
-- 
Martien Verbruggen                      |
Webmaster www.tradingpost.com.au        | "In a world without fences,
Commercial Dynamics Pty. Ltd.           |  who needs Gates?"
NSW, Australia                          |


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

Date: 27 Oct 1998 14:25:57 -0800
From: bkeelerx@iwa.dp.intel.com (Bruce J. Keeler)
Subject: IPC::Shareable problems
Message-Id: <ecl67d5tzey.fsf@ws011.dp.intel.com>


I have had no luck with IPC::Shareable.  None.

It won't pass its regression tests.  It always gets stuck on the last test,
number 14.  It either hangs forever, or issues a message along the lines:

    IPC::Shareable::FETCH: semctl returned false: 
         Invalid argument at test.pl line 231

I've tried several combinations of Perl 5.004, 5.004_04 5.005_02 on
SunOS 4, HP-UX 10.20, Red Hat Linux 5.1 (kernel 2.0.34).

I've tried versions 0.28, 0.29 and 0.30 of IPC::Shareable.

I've only tried Storable 0.6@3, as that's all that's on CPAN.

I've written to Ben Sugars, and gotten no response.

I've searched Dejanews.  Nada.

I am I the only one experiencing these problems?  Have I gone crazy?

Please help!

Thanks,
Bruce


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

Date: Wed, 28 Oct 1998 10:53:31 +1100
From: Ian Church <ianchurc@ozemail.com.au>
Subject: non-looping range match
Message-Id: <36365CFB.93373F18@ozemail.com.au>



Hi,

    how do I extract a range of lines in a file up to the first
occurance of a pattern

    eg if my file contains:

            abc
            def
            ghi
            jkl
            mno
            ghi

using something like:

    perl -ne 'print if /abc/ .. /ghi/'

    I want:

        abc
        def
        ghi

The range operators loop and hence I get the whole file as a match.

any ideas???

    Ian Church



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

Date: Tue, 27 Oct 1998 18:35:31 -0500
From: John Porter <jdporter@min.net>
Subject: Re: Not to start a language war but..
Message-Id: <363658C2.C0B3D777@min.net>

Thanks, Dave, for some interesting, balanced commentary.


Dave Kirby wrote:
> 
> ...creating a class in perl is frankly a pain in the ass...

Mind if I ask what it is specifically about class creation in Perl
that you find to be painful?

AFAICT, there is nothing to creating a class in Perl, aside from the 
already mundane act of creating a namespace.

All of the "effort" (or pain, if you find it painful) is in the
creation of objects, and the description of the inheritance tree.
And even these are so straight-forward, I have trouble seeing where
someone might have painful difficulty in doing them.
Can you illuminate?

Thanks,
John Porter

-- 
Please Don't "Courtesy CC" me.
I read this newsgroup fanatically.  You know that!
("Emailed only" is fine, though.)


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

Date: 27 Oct 1998 22:31:20 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Perl & Y2K - booby trap code
Message-Id: <715hjo$hm1$1@csnews.cs.colorado.edu>

In comp.lang.perl.misc, Uri Guttman <uri@fastengines.com> writes:
:  TM>     ( $year, $month )= LocalTime( $time, [qw(year month)] );
:i think it is a fine idea and your api looks fine too. though you could
:skip the anon array and just pass the name tokens directly.

We don't have enough ways yet???

How about:

    use POSIX qw(strftime);
    ($year, $month)  = split(' ', strftime("%Y %m", localtime($whenver)));

or

    use POSIX qw(strftime);
    @tm = localtime($whenever);
    $year  = strftime "%Y", @tm;
    $month = strftime "%m", @tm;

or

    use Time::localtime;
    $now = localtime($whenever);
    ($year, $month) = ( $now->year(), $now->mon() );

or

    use Time::localtime;
    $now = localtime($whenever);
    ($year, $month) = map { $now->$_() } qw(year mon);

or

    use Time::localtime;
    $now = localtime($whenever);
    ($year, $month) = ($Time::localtime::tm_year, $Time::localtime::tm_mon);

or

    use Time::localtime;
    $now = localtime($whenever);
    ($year, $month) = map { ${"Time::localtime::tm_$_"} } qw(year mon);

or

    use Time::localtime qw(:DEFAULT :FIELDS);
    $now = localtime($whenever);
    ($year, $month) = ($tm_year, $tm_mon);

or

    use Time::localtime;
    use UnderMethods;		# naughty tchrist toy
    for (localtime()) {
	$month = mon();		# implicitly use $_ for object
	$year  = year();	# implicitly use $_ for object
    }

Of course, these all require 

    $month++;
    $year += 1_900;

for printing, but not for

    $mname = (qw(jan feb mar apr may jun jul aug sep oct nov dec))[$mon];

I imagine there are many 1.5-megabyte Date:::Whatever modules on CPAN
that will fit the bill, too, but I have not been convinced that we should
have yet another module.

--tom
-- 
Let's give out a bootable, stand-alone version of GNU emacs, then come 
back in 9 months and find whoever's using it -- and kill them.  
		    --Keith Bostic


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

Date: 27 Oct 1998 17:50:19 -0500
From: Uri Guttman <uri@fastengines.com>
Subject: Re: Perl & Y2K - booby trap code
Message-Id: <saraf2h8vro.fsf@camel.fastserv.com>

>>>>> "TC" == Tom Christiansen <tchrist@mox.perl.com> writes:

  TC> In comp.lang.perl.misc, Uri Guttman <uri@fastengines.com> writes:
  TC> : TM> ( $year, $month )= LocalTime( $time, [qw(year month)] ); :i
  TC> think it is a fine idea and your api looks fine too. though you
  TC> could :skip the anon array and just pass the name tokens directly.

  TC> We don't have enough ways yet???

<snip many ways to get month and year>

  TC> Of course, these all require

  TC>     $month++; $year += 1_900;

this is the main point of the proposed new module, to have those quirks
hidden for newbies and other who desire it. 

and strftime is the best way but rarely mentioned. everyone seems to use
localtime. 

  TC> I imagine there are many 1.5-megabyte Date:::Whatever modules on
  TC> CPAN that will fit the bill, too, but I have not been convinced
  TC> that we should have yet another module.

you don't have to use it. i probably won't either. but for those who
want it and will write it, why not? i don't (and i KNOW you don't) use
win32 (blecchh!) modules but they are there for the POB's. so what is
wrong with a date module that has a cleaner api than localtime and fixes
the offset issues that this thread is about. then when y2k crap come up
again, just point to the new module and go back to sleep.

uri


-- 
Uri Guttman                  Fast Engines --  The Leader in Fast CGI Technology
uri@fastengines.com                                  http://www.fastengines.com


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

Date: Tue, 27 Oct 1998 23:10:55 GMT
From: hex@voicenet.com (Matt Knecht)
Subject: Re: Perl & Y2K - booby trap code
Message-Id: <3qsZ1.5$1g4.2336561@news2.voicenet.com>

Uri Guttman <uri@fastengines.com> wrote:
>
>and strftime is the best way but rarely mentioned. everyone seems to use
>localtime. 
>

Why is strftime better than localtime?

Note: I'm not flaming ... I really want to know!

-- 
Matt Knecht - <hex@voicenet.com>


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

Date: 27 Oct 1998 23:28:07 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Perl & Y2K - booby trap code
Message-Id: <715ku7$ma5$1@csnews.cs.colorado.edu>

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc, 
    Uri Guttman <uri@fastengines.com> writes:
:wrong with a date module that has a cleaner api than localtime and fixes
:the offset issues that this thread is about. then when y2k crap come up
:again, just point to the new module and go back to sleep.

*NO*  

You'll make them think there's something wrong with perl.  The problem
lies not with perl, my dear Uri, but with the users themselves.  

--tom
-- 
	    Rounded, wounded, grieve and sieve,
	    Friend and fiend, alive and live.


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

Date: 27 Oct 1998 18:58:07 -0500
From: Uri Guttman <uri@fastengines.com>
Subject: Re: Perl & Y2K - booby trap code
Message-Id: <sar4ssp8smo.fsf@camel.fastserv.com>

>>>>> "TC" == Tom Christiansen <tchrist@mox.perl.com> writes:

[no cc was sent to tom as he will probably filter it anyway. he does
from my home address since it is under mediaone.net]

  TC>  [courtesy cc of this posting sent to cited author via email] In
  TC> comp.lang.perl.misc, Uri Guttman <uri@fastengines.com> writes:
  TC> :wrong with a date module that has a cleaner api than localtime
  TC> and fixes :the offset issues that this thread is about. then when
  TC> y2k crap come up :again, just point to the new module and go back
  TC> to sleep.

  TC> *NO*

  TC> You'll make them think there's something wrong with perl.  The
  TC> problem lies not with perl, my dear Uri, but with the users
                                  ^^^^^^^^^^^
at least i seem to be back in some good graces with you :-)

  TC> themselves.

no there is nothing wrong with perl and i don't want to make that
impression. there are many modules and pragmas that do things in a more
robust or flexible manner than perl's builtin stuff. look at IO:: (your
favorite modules :-) for example. you don't need it but it can make life
easier (if a little slower to load).

i am saying the same thing for the proposed module. don't use it if you
don't need it. perl does dates just fine as is. but if you want some
hand holding regarding 1900 + $year and zero based months, you can use
this potential module. same as with IO::.

and can you actually stop someone from writing it and putting it onto
CPAN? there are plenty of low usage modules there now, what is one more?


uri

-- 
Uri Guttman                  Fast Engines --  The Leader in Fast CGI Technology
uri@fastengines.com                                  http://www.fastengines.com


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

Date: Tue, 27 Oct 1998 22:18:28 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Perl Error message
Message-Id: <Pine.GSO.4.02A.9810271417490.3421-100000@user2.teleport.com>

On Tue, 27 Oct 1998 cool_ez@my-dejanews.com wrote:

> "Bad name after nameoncard:: at
> C:\Inetsrv\wwwroot\writingformoney\cgi-bin\login.pl line 548."
> 
> I have no idea what this means, Can someone help?

Have you seen what the perldiag manpage has to say about this? Hope this
helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Tue, 27 Oct 1998 16:03:52 -0600
From: Dave Barnett <barnett@houston.Geco-Prakla.slb.com>
To: cool_ez@my-dejanews.com
Subject: Re: Perl Error message
Message-Id: <36364348.D2852432@houston.Geco-Prakla.slb.com>

[courtesy cc to cited author]

cool_ez@my-dejanews.com wrote:
> 
> I have been using perl for some time now, but this is the first time I have
> encountered this error message.
> 
> "Bad name after nameoncard:: at
> C:\Inetsrv\wwwroot\writingformoney\cgi-bin\login.pl line 548."
Well, not being psychic, I can only take a SWAG (Scientific Wild-Assed
Guess) at it.

1.  Try using   use diagnostics; so that perl can tell you what is
wrong.
2.  Perhaps you have some gibberish in your script after nameoncard:: on
line 548 of your script?

HTH.

Dave

-- 
Dave Barnett	Software Support Engineer	(281) 596-1434

Give a man a fish, and he will eat for a day.  Teach him how to fish,
and he will sit in a boat and drink beer all day.


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

Date: Tue, 27 Oct 1998 22:24:35 -0800
From: "Jamie Walker" <jamie@howgarth.demon.co.uk>
Subject: Perl XS using C++ classes
Message-Id: <715h7s$rdk$1@newnews.global.net.uk>

I have spent too long trying to figure this out, so I thought that this
would be the place to ask.

I have developed a C++ class library for querying a database, and am trying
to make a perl module to access this library. My problem is, I can't
everything to link together: the furthest I have got was a segfault on 'make
test' :(

All I would like to do is create one instance of a c++ class when the module
loads, and in the perl functions, call some methods and return some of the
class's member variables. At the moment I have just one perl function that
creates the instances of the class upon entering, calls the methods and then
the instances are destroyed.

Please can someone show me some documentation on using XS with C++? Surely
this is possible ?

TIA,





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

Date: Tue, 27 Oct 1998 22:16:04 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: persistent variables ?
Message-Id: <Pine.GSO.4.02A.9810271409570.3421-100000@user2.teleport.com>

On Tue, 27 Oct 1998, _Paul Coleman wrote:

> Tom Phoenix wrote in message ...
> >On Tue, 27 Oct 1998, _Paul Coleman wrote:
> >
> >> Is there a way to have persistent variables (or information) across
> >> Web Pages?
> >
> >Sounds as if you're interested in CGI programming. The docs, FAQs, and
> >newsgroups about CGI programming should be helpful to you. Good luck!

> I must have missed something.  Was there some information that
> pertained to my question that you forgot to include with your post or
> did it just not get through to the newsgroup?

No, I think that everything's there. Maybe I was unclear.

What you were asking, about information on web pages, seems to be
something that is the same no matter what programming language is used.
For example, you could ask the same question when you're thinking about
programming in C. That means that it's not really a question which belongs
in a Perl-specific newsgroup. (Despite the fact that web-related questions
and answers often crop up here, this newsgroup is still about Perl! :-)

You seem to be asking about CGI programming, so you should probably check
out the docs, FAQs, and newsgroups about CGI programming. Good luck!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



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

Date: Tue, 27 Oct 1998 17:34:05 -0500
From: "_Paul Coleman" <Paul.Coleman@CoSeCo.com>
Subject: Re: persistent variables ?
Message-Id: <36364baf.0@news3.paonline.com>

Hi Tom,
I think you don't understand my question.  I am asking a question that is
specific to Perl.  In Microsoft's ASP, two objects are provided as part of
the install. They are Session and Application.  They provide a convenient
way to save persistent data.  I am asking if Perl or a Package provides a
similar thing.  I have looked all over the web, the books that I have (many
from O'Reilly) and couldn't find any information on the subject.  I was
hoping to just find some pointers as to what to look for and where to find
it. It may be the Perl uses different terminology than persistent.  It may
be that Perl does not provide any such functions. But the question is
specific to Perl.  I am not looking for a C, ASP or any other language
solution.  My best hopes would be a package or module that has already been
written as I don't like re-inventing the wheel. It is too bad you think it
is your job to chase people away from this news group.
Paul Coleman


Tom Phoenix wrote in message ...
>No, I think that everything's there. Maybe I was unclear.
>
>What you were asking, about information on web pages, seems to be
>something that is the same no matter what programming language is used.
>For example, you could ask the same question when you're thinking about
>programming in C. That means that it's not really a question which belongs
>in a Perl-specific newsgroup. (Despite the fact that web-related questions
>and answers often crop up here, this newsgroup is still about Perl! :-)
>
>You seem to be asking about CGI programming, so you should probably check
>out the docs, FAQs, and newsgroups about CGI programming. Good luck!
>
>--
>Tom Phoenix       Perl Training and Hacking       Esperanto
>Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/
>




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

Date: Tue, 27 Oct 1998 22:53:35 GMT
From: tnguru@termnetinc.com (Ben Coleman)
Subject: Re: persistent variables ?
Message-Id: <36364d4a.532695495@news.mindspring.com>

On Tue, 27 Oct 1998 16:29:02 -0500, "_Paul Coleman"
<Paul.Coleman@CoSeCo.com> wrote:

>I must have missed something.  Was there some information that pertained to
>my question that you forgot to include with your post or did it just not get
>through to the newsgroup?

No, he's just telling you(in a nicer way than some others on this
newsgroup) that your question is, strictly speaking, a CGI question, not a
Perl question(the ways of dealing with this problem are language
independent) and that you should refer to information sources that deal
with CGI issues rather than those that deal with Perl issues.  That way you
1) are more likely to get useful information and 2) won't twerp off the
denizens of this newsgroup who are already highly irritated with new
posters who fail to realize that Perl and CGI are not synonymous.

Ben
-- 
Ben Coleman
Senior Systems Analyst
TermNet Merchant Services, Inc.
Atlanta, GA


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

Date: Tue, 27 Oct 1998 22:56:35 GMT
From: Daniel Grisinger <dgris@rand.dimensional.com>
Subject: Re: persistent variables ?
Message-Id: <m3vhl5bp84.fsf@rand.dimensional.com>

"_Paul Coleman" <Paul.Coleman@CoSeCo.com> writes:

> I think you don't understand my question.  I am asking a question that is
> specific to Perl.  

No, you are not.  Or, at least, it certainly doesn't seem so.

>                    In Microsoft's ASP, two objects are provided as part of
> the install. They are Session and Application.  

That is very wonderful for Microsoft ASP.

>                                                 They provide a convenient
> way to save persistent data.  I am asking if Perl or a Package provides a
> similar thing.  

Persistent data is a completely meaningless term.  Do you mean data that
is constant across multiple invocations of an ASP script (or whatever
they're called), or an object and reference dump similar to what is
produced by Data::Dumper, or something like Python's pickle, or maybe
serialization in Java, or a file containing configuration parameters?

>                 I have looked all over the web, the books that I have (many
> from O'Reilly) and couldn't find any information on the subject.  I was
> hoping to just find some pointers as to what to look for and where to find
> it. It may be the Perl uses different terminology than persistent.

It is very possible that a change in terminology would help us help 
you.  What are you trying to do?

dgris
-- 
Daniel Grisinger          dgris@perrin.dimensional.com
Supporter of grumpiness where grumpiness is due on clpm.
perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print 
m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'


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

Date: Tue, 27 Oct 1998 18:04:45 -0500
From: "_Paul Coleman" <Paul.Coleman@CoSeCo.com>
Subject: Re: persistent variables ?
Message-Id: <363652dd.0@news3.paonline.com>

Hi Ben,
I am sorry that you also misinterpreted my question.  You must get allot of
questions that don't pertain to Perl in this newsgroup for all of you to be
so sensitive like that.  I am not asking a CGI type question.  I am asking
if there is a way using Perl that provides a solution to my problem.  As I
wrote in a previous response, it could take the shape of a Package that
provides Objects similar to the Session or Application object in Microsoft
ASP.  It could be a module that someone wrote that solves the problem.  But
I am definitely looking for a Perl solution.  I would think that if you
thought that the question was off topic for the newsgroup, you would simply
ignore it. So do you or don't you know of a Perl solution the persistent
data across Web Pages (the usage of Web Pages is only to imply scope).
Thanks,
Paul Coleman

Ben Coleman wrote in message <36364d4a.532695495@news.mindspring.com>...
>No, he's just telling you(in a nicer way than some others on this
>newsgroup) that your question is, strictly speaking, a CGI question, not a
>Perl question(the ways of dealing with this problem are language
>independent) and that you should refer to information sources that deal
>with CGI issues rather than those that deal with Perl issues.  That way you
>1) are more likely to get useful information and 2) won't twerp off the
>denizens of this newsgroup who are already highly irritated with new
>posters who fail to realize that Perl and CGI are not synonymous.
>
>Ben





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

Date: Tue, 27 Oct 1998 18:32:25 -0500
From: "_Paul Coleman" <Paul.Coleman@CoSeCo.com>
Subject: Re: persistent variables ?
Message-Id: <36365962.0@news3.paonline.com>

Hi Daniel,
I can only relate this to Microsoft ASP.  It seems to have provoked a mean
streak in the group.  The Session and Application Object provide a way to
save data on the server so that other pages that come from that site can
retrieve the saved data.  The scope of the data is different in each of the
objects.  Obviously the longer scope Session object would have to be used
judiciously.  In concept, it is similar to a cookie but on the server and a
predefined shorter scope or duration.  If I were to write such an
application I would probably (and it looks like I will) write the data to a
file as name value pairs with the Client IP address and a date time stamp.
The IP address would allow identification and the time stamp would expire
the data.  This is a simple explanation, there are many other solutions ( I
hope) But I am definitely looking for one in Perl.  I am also asking this
question because at first  glance, the Perl community seems to share what
they are doing and I was hoping someone else has already solved the
problem.  I am learning that (and I hope it is restricted to this group)
that it is loaded with tolerant challenged individuals that are reluctant to
share any information and thrive of bashing the new people that drop by with
cutting sarcasm.  I can only hope that it is isolated to here.
Thanks for everything,
Paul Coleman

Daniel Grisinger wrote in message ...
>"_Paul Coleman" <Paul.Coleman@CoSeCo.com> writes:
>
>> I think you don't understand my question.  I am asking a question that is
>> specific to Perl.
>
>No, you are not.  Or, at least, it certainly doesn't seem so.
>
>>                    In Microsoft's ASP, two objects are provided as part
of
>> the install. They are Session and Application.
>
>That is very wonderful for Microsoft ASP.
>
>>                                                 They provide a convenient
>> way to save persistent data.  I am asking if Perl or a Package provides a
>> similar thing.
>
>Persistent data is a completely meaningless term.  Do you mean data that
>is constant across multiple invocations of an ASP script (or whatever
>they're called), or an object and reference dump similar to what is
>produced by Data::Dumper, or something like Python's pickle, or maybe
>serialization in Java, or a file containing configuration parameters?
>
>>                 I have looked all over the web, the books that I have
(many
>> from O'Reilly) and couldn't find any information on the subject.  I was
>> hoping to just find some pointers as to what to look for and where to
find
>> it. It may be the Perl uses different terminology than persistent.
>
>It is very possible that a change in terminology would help us help
>you.  What are you trying to do?
>
>dgris
>--
>Daniel Grisinger          dgris@perrin.dimensional.com
>Supporter of grumpiness where grumpiness is due on clpm.
>perl -Mre=eval -e'$_=shift;;@[=split//;;$,=qq;\n;;;print
>m;(.{$-}(?{$-++}));,q;;while$-<=@[;;' 'Just Another Perl Hacker'




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

Date: Tue, 27 Oct 1998 23:40:09 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: persistent variables ?
Message-Id: <slrn73cq7k.55.alastair@calliope.demon.co.uk>

_Paul Coleman <Paul.Coleman@CoSeCo.com> wrote:
>Hi Ben,
>I am sorry that you also misinterpreted my question.  You must get allot of
>questions that don't pertain to Perl in this newsgroup for all of you to be
>so sensitive like that.  I am not asking a CGI type question.  I am asking

Yes, that's the basic reason. People seem to think any 'web' or 'cgi' or 'html'
question can be asked in a Perl newsgroup. Your question has all the hallmarks
of such. Perhaps this might help - look at the CGI module and perhaps 'hidden'
form fields ...

CGI.pm : http://stein.cshl.org/~lstein/

HTH.

-- 

Alastair
work  : alastair@psoft.co.uk
home  : alastair@calliope.demon.co.uk


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

Date: Tue, 27 Oct 1998 17:41:21 -0500
From: "Garrett G. Hodgson" <garry@sage.att.com>
Subject: Re: psychology of language choice (was Re: language war ...)
Message-Id: <36364C11.9258A777@sage.att.com>

Uri Guttman wrote:

> i would hate
> to do this in a language that forced OO like java and python.

you seem to have a misconception here.
python does not force OO.

> perl lets me do OO or procedural and even mix the two

as does python.

> (i call OO modules).

huh?

-- 
Garry Hodgson			and when they offer
garry@sage.att.com		golden apples
Software Innovation Services	are you sure you'll refuse?
AT&T Labs			heaven help the fool.


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

Date: Tue, 27 Oct 1998 18:11:22 -0500
From: "Garrett G. Hodgson" <garry@sage.att.com>
Subject: Re: psychology of language choice (was Re: language war ...)
Message-Id: <3636531A.DF693E97@sage.att.com>

Uri Guttman wrote:

> python types always talk about rigid structure

i must've missed these posts.

> , fixed indenting, consistant forms.

not fixed.  just self consistent.

> also pythoners (and tcl
> and rexx) dislike perl's use of 'noise' chars for language conciseness
> and power.

not to mention all of the hidden state.

> like java in some ways it
> tries to enforce a object and coding style on you.

no, it doesn't.

> i dislike having a fixed indent and rigid coding style force on
> me but that is my choice.

at least learn the language before pronouncing judgement on
things like "rigid coding style" and "fixed indent".


-- 
Garry Hodgson			and when they offer
garry@sage.att.com		golden apples
Software Innovation Services	are you sure you'll refuse?
AT&T Labs			heaven help the fool.


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

Date: Tue, 27 Oct 1998 22:51:10 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Repost from Data
Message-Id: <y7sZ1.52$085.112505@nsw.nnrp.telstra.net>

In article <714g04$8j1$1@nnrp1.dejanews.com>,
	toiday@my-dejanews.com writes:
> In article <slrn72vns2.oi4.sholden@pgrad.cs.usyd.edu.au>,
>   sholden@cs.usyd.edu.au wrote:
>> On Thu, 22 Oct 1998 18:09:22 GMT, toiday@my-dejanews.com
>> 	<toiday@my-dejanews.com> wrote:
>> >I'm writing a cgi program.  Because program generate a webpage that need to
>> >update the information, I include the following:
>> >
>> ><META HTTP-EQUIV="REFRESH" CONTENT="120">

[snip]

>> I think you just use...
>> <META HTTP-EQUIV="REFRESH" CONTENT="120" MISC="POST DAMN YOU!!!!!!">
>>
>> Then again I write perl not HTML... maybe you should try a more appropriate
>> news group...
>>
>> --
>> Sam
>>
>> PC's are backwards ... throw them out! Linux is ok though.
>> 	--Rob Pike (on the subject of CR/LF etc)
>>
> 
> FYI - Most people use Perl to write CGI for living, NOT for fun.

You are wrong. Most people I know use perl, but not for CGI programs.
I am not even sure whether most people use perl because they need to
earn money or because they like it. Probably a combination of both.

> Do you parents or college teach you to be an asshole?  If you don't know the
> answer then shutup.  May be one day when you grow up, get out of college and

He was right. You asked a question which had absolutely nothing at all
to do with perl. It didn't even have anything to do with CGI.

> get a real job, you may understand.  Meanwhile, computer is not a toy. 

Computers are toys. If there hadn't been a lot of people regarding the
computer as a toy, you probably wouldn't even know they existed. If it
wasn't for the first bunch of hackers at MIT, and later people like
Steve Wozniak, who all most definitely saw the computer as a toy,
there wouldn't be any good tools. There wouldn't be any home
computers. There probably wouldn't even be micros. All that would have
been available would be big batch processing monsters, for business
and academic purposes only.

If everyone had always taken computers totally serious, there would
never have been computer games. That industry provided some of the
best code algorithms around. That industry stretched hardware and
programming languages, made them expand. That industry made the
computer market grow.

If you don't see the computer as a toy, at least in some part, then I
don't believe you stand a chance of ever becoming a good programmer.
The people who saw computers as toys are the people who made computers
available. They're the people that _made_ computers, operating
systems, languages, code libraries and many many programs. Without
those, you wouldn't even read this.

> Newsgroup is not the place for you to harass people.  Don't waste you
> parent's hard working money.

hey, if you can't harrass people on newsgroups, then where can you?
That is what this is all about. You get to rant and yell at someone,
he gets to correct you. And we all happily chime in.

Isn't this a great world?

Now stop taking yourself so seriously.

Martien
-- 
Martien Verbruggen                      |
Webmaster www.tradingpost.com.au        | "In a world without fences,
Commercial Dynamics Pty. Ltd.           |  who needs Gates?"
NSW, Australia                          |


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

Date: Tue, 27 Oct 1998 22:32:51 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Sending mail using perl
Message-Id: <nSrZ1.48$085.112505@nsw.nnrp.telstra.net>

In article <MPG.109f9f8f93b912cf9896ab@news.supernews.com>,
	danbeck@eudoramail.com (Daniel Beckham) writes:
> He just needs to check for a ; in his fields and die if found.

That is not totally reliable, since there are other shell characters
that may cause danger. It's much, much better, safer, and
easier to just use sendmail the right way, with the -t option.

And now, this has absolutely nothing to do with perl anymore.

Martien
-- 
Martien Verbruggen                      |
Webmaster www.tradingpost.com.au        | "In a world without fences,
Commercial Dynamics Pty. Ltd.           |  who needs Gates?"
NSW, Australia                          |


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

Date: Tue, 27 Oct 1998 22:36:16 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Size of JPEG and GIF
Message-Id: <AVrZ1.50$085.112505@nsw.nnrp.telstra.net>

In article <MPG.109f9f44628e15609896aa@news.supernews.com>,
	danbeck@eudoramail.com (Daniel Beckham) writes:
> Hehe, fly is a unix program that was ported to NT.  Please, give credit 
> where credit is due.  We wouldn't be talking here if it wasn't for the 
> unix world...

Of course you would be talking. Of course, if it wasn't for the unix
world, fly.exe would be a shareware program with a nag screen. And
there would be about 100 other programs doing about the same thing but
none of them would do it the way you need it done. And there would be
no source.

Martien
-- 
Martien Verbruggen                      |
Webmaster www.tradingpost.com.au        | "In a world without fences,
Commercial Dynamics Pty. Ltd.           |  who needs Gates?"
NSW, Australia                          |


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

Date: Tue, 27 Oct 1998 21:57:52 GMT
From: edwardquentinbridges@my-dejanews.com
Subject: use lib generates warnings with -w
Message-Id: <715fl0$msf$1@nnrp1.dejanews.com>

when i compile a CGI script with the -w switch, i get the following
warning about the lib.pm pragma (which i'm using for the script).

Warning message:
%> perl -cw Poll.cgi
Use of uninitialized value at /opt/lib/perl5/lib.pm line 17.
Poll.cgi syntax OK

cc'ing your replies to my email address (edb@interport.net)
would be appreciated.

thanks
--e--

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: Tue, 27 Oct 1998 23:16:16 GMT
From: debel@my-dejanews.com
Subject: Re: Web Client Automation
Message-Id: <715k7v$uec$1@nnrp1.dejanews.com>

In article <comdog-ya02408000R2710981316530001@news.panix.com>,
  comdog@computerdog.com (brian d foy) wrote:
> In article <712lku$mad$1@nnrp1.dejanews.com>, debel@my-dejanews.com posted:
>
> > I'm using the ActiveState port of Perl (5.005) and I'm encoding the "space"
> > character like this:
> >
> > $city =~ s/(\W)/sprintf("%%%x", ord($1))/eg;
>
> perhaps you'd like to use the URI::Escape module.  saves time *and* money :)
>
> --
> brian d foy                                  <comdog@computerdog.com>
> CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
>

brian,

Thanks for the advice -- I looked at the documentation and I am trying
something like this:

$city = "Los Angeles";
$city =~ s/_/ /g;
$city =~ s/(\W)/sprintf("%%%x", (ord($1)))/eg;
$city =~ uri_escape($city,"\20");

The above code yields, on STDOUT, Los%20Angeles.

Unfortunately, I still can't escape "spaces" properly. As before, the program
works with cities that don't have spaces in their names, but fails with cities
with "spaces" in their name.

Thanks again!
--
Daniel

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    


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

Date: 27 Oct 1998 23:17:50 GMT
From: "George H" <george@tapestry.net>
Subject: Word Wrap
Message-Id: <01be01ff$0210db60$3195cdcf@hp-customer>

I am trying to manipulate data received from a textarea field via HTML
pages on my website using Perl.  I have the text field so the text wraps at
63 characters per line on the web page ... and I want the text to look
exactly like that whether it is posted somewhere else on the site or sent
in an email in my group.  It currently doesn't work out that way.  I have
been trying to write a CGI to take the text field and put in hard-returns
where it should wrap.  My program has been tough to write for me ... and I
was wondering if anyone knows of a module or some code that would do that.

My approach has been to read each word from the textare into an array and
make lines that are no greater than 63 before inserting my own hard return
 ... but with other miscellaneous characters I am having a tough time.  Any
suggestions

George H
georgeh@got.net


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

Date: Tue, 27 Oct 1998 23:21:34 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Word Wrap
Message-Id: <2AsZ1.61$085.139889@nsw.nnrp.telstra.net>

In article <01be01ff$0210db60$3195cdcf@hp-customer>,
	"George H" <george@tapestry.net> writes:

> My approach has been to read each word from the textare into an array and
> make lines that are no greater than 63 before inserting my own hard return
> ... but with other miscellaneous characters I am having a tough time.  Any
> suggestions

There is a module on CPAN called Text::Wrap. I think it may do what
you want.

http://www.perl.com/CPAN/

Martien
-- 
Martien Verbruggen                      |
Webmaster www.tradingpost.com.au        | "In a world without fences,
Commercial Dynamics Pty. Ltd.           |  who needs Gates?"
NSW, Australia                          |


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

Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>


Administrivia:

Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.

If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu. 


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.misc (and this Digest), send your
article to perl-users@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.

The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.

The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.

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 V8 Issue 4087
**************************************

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