[9410] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 3005 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Jun 27 23:07:11 1998

Date: Sat, 27 Jun 98 20:00:53 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Sat, 27 Jun 1998     Volume: 8 Number: 3005

Today's topics:
        An interesting observation <rra@stanford.edu>
    Re: An interesting observation (Bob Trieger)
    Re: ANNOUNCEMENT: clpa doesn't accept perl announcement <ajohnson@gpu.srv.ualberta.ca>
    Re: ANNOUNCEMENT: clpa doesn't accept perl announcement (I R A Aggie)
    Re: Any idea about ...... (Jonathan Stowe)
        building Perl on Win32 <jvargyas@carroll.com>
    Re: CGI Question In Regards To & Char (Andre L.)
    Re: creating unique session id w/ perl <rootbeer@teleport.com>
    Re: creating unique session id w/ perl birgitt@my-dejanews.com
    Re: eval (Data::Dumper->dump($cool, ...'limit?')); <ckilburn@nbnet.nb.ca>
    Re: Field Sort without modules? (I R A Aggie)
    Re: Flames.... (I R A Aggie)
    Re: Help with Programming <dbalsillie@email.msn.com>
    Re: Help with Programming (Jonathan Stowe)
    Re: Help with Programming (www.helpmaster.com)
    Re: Hiding the Perl source (John Stanley)
    Re: Hiding the Perl source (Abigail)
    Re: HTML pages with Perl <rootbeer@teleport.com>
    Re: Linked list and a code challenge (Craig Berry)
    Re: Parsing a list of names and assigning each to an ar (Jeremy D. Zawodny)
    Re: Parsing a list of names and assigning each to an ar (Abigail)
        Problem deleting keys/values from .db files <stevemcc@adelphia.net>
    Re: Problem deleting keys/values from .db files <rootbeer@teleport.com>
        setuid and hiding script questions. <bikejog@bellatlantic.net>
    Re: setuid and hiding script questions. <rra@stanford.edu>
        sorting array of array question <rp001@dial.oleane.com>
    Re: Subroutine Variables <maierc@chesco.com>
    Re: Testing perl knowledge (Snowhare)
        Visible proxy?  using require? <sbronson@opentv.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

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

Date: 27 Jun 1998 19:18:15 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: An interesting observation
Message-Id: <m3af6y2rrs.fsf@windlord.Stanford.EDU>

The past few days, I've had more time to read this group and respond to
posts than I normally do, so I've been scanning through looking for
unanswered questions to answer.  Ever since I started doing this, I've
found something very interesting.

There usually aren't any.  Unanswered questions, that is.

Maybe one or two that just came in, and a small handful of really obscure
stuff (compiling Perl on a platform I've never heard of, some sort of
problem with interfacing with databases, some sort of relatively advanced
Windows or Mac question), but apart from that pretty much every question
has already been answered by the time I get to it.

I think that's an interesting thing to be aware of, particularly in light
of the recent complaints about how this group has been working.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: Sun, 28 Jun 1998 02:30:05 GMT
From: sowmaster@juicepigs.com (Bob Trieger)
Subject: Re: An interesting observation
Message-Id: <6n49v5$vlk$1@strato.ultra.net>

[ posted and mailed ]

Russ Allbery <rra@stanford.edu> wrote:
-> The past few days, I've had more time to read this group and respond to
-> posts than I normally do, so I've been scanning through looking for
-> unanswered questions to answer.  Ever since I started doing this, I've
-> found something very interesting.
-> 
-> There usually aren't any.  Unanswered questions, that is.
-> 
-> Maybe one or two that just came in, and a small handful of really obscure
-> stuff (compiling Perl on a platform I've never heard of, some sort of
-> problem with interfacing with databases, some sort of relatively advanced
-> Windows or Mac question), but apart from that pretty much every question
-> has already been answered by the time I get to it.
-> 
-> I think that's an interesting thing to be aware of, particularly in light
-> of the recent complaints about how this group has been working.

They aren't whining about posts not being answered. they are whining because 
they aren't being answered with kids' gloves or handed a script on a silver 
platter. I try answering all of them that I can, even if only to tell the 
poster which FAQ or group they can find the answer in. As do most others.


Bob Trieger
sowmaster@juicepigs.com
" Cost a spammer some cash: Call 1-800-286-0591
  and let the jerk that answers know that his
  toll free number was sent as spam. "


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

Date: Sat, 27 Jun 1998 16:04:01 -0500
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: ANNOUNCEMENT: clpa doesn't accept perl announcements!
Message-Id: <35955E41.E11C754@gpu.srv.ualberta.ca>

Tom Christiansen wrote:
!
! I tried to be nice, but it failed.  Randal is derelict in his
! duties, plain and simple.
[snip]

! We need either a Perl announcement group that actually contains
! Perl announcements, or else we need a new moderator.  It can be
! trivially fixed, right now.  We don't need a committee.  We just
! need someone doing their job.

seems Randal has clearly stated his intentions and the steps he
is taking regarding this matter ...

! Send Randal mail.  

oh, by all means... I'm sure that an additional mail load will
improve Randal's efficiency in addressing the issue.

! Or volunteer to be the new moderator. :-)

but it is so much easier to simply voice your frustration at the
way someone else handles the job you don't want to do :-0

regards
andrew


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

Date: Sat, 27 Jun 1998 18:30:09 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: ANNOUNCEMENT: clpa doesn't accept perl announcements!
Message-Id: <fl_aggie-2706981830090001@aggie.coaps.fsu.edu>

In article <6n3ghh$sp6$1@csnews.cs.colorado.edu>, tchrist@mox.perl.com
(Tom Christiansen) wrote:

+ I tried to be nice, but it failed.  Randal is derelict in his duties,
+ plain and simple.  The system is broken, but easily fixed.  But 
+ he refuses, letting perfectly fine postings languish for more
+ than two solid weeks before he mindlessly rejects them.  This is
+ unacceptable in time-sensitive material, because they're dead by 
+ the time they're posted.

Were they posted to clp.misc seperately?

James


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

Date: Sun, 28 Jun 1998 01:00:07 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Any idea about ......
Message-Id: <3595912e.15217630@news.btinternet.com>

On Sat, 27 Jun 1998 19:30:37 +0200, delta wrote :

>Hi,
>Look at the following script lines :
>
><td  align="middle" bgcolor="#e1e1e1" colspan="2">
><font face="Book Antiqua"    size="3" color="#00356A">
>FIN
>$cnt=0;
>while (!(@info->[$cnt] =~ /---------------/))
>@info->[$cnt] =~ s/\n/<BR>/g;
>print @info->[$cnt];
>$cnt++;
>} for ($i=1;$i<=$cnt+1;$i++) {shift @info;}
>print << "FIN";
></td>
>
Sorry chief but I cant make head nor tale of this.  I think that it
probably should read like:

print <<"FIN";
<td  align="middle" bgcolor="#e1e1e1" colspan="2">
<font face="Book Antiqua"    size="3" color="#00356A">
</td>
FIN
$cnt=0;
while (!(@info->[$cnt] =~ /---------------/))
{
@info->[$cnt] =~ s/\n/<BR>/g;
print @info->[$cnt];
$cnt++;
} 
for ($i=1;$i<=$cnt+1;$i++) {shift @info;}

But nonetheless it still doesnt make agreat deal of sense ;-}

Thats not a great deal of help really is it ?

/J\

Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>



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

Date: Sat, 27 Jun 1998 21:03:21 GMT
From: "joev" <jvargyas@carroll.com>
Subject: building Perl on Win32
Message-Id: <Ev8Arq.5Hu@news2.new-york.net>

I'm trying to build Perl on a Win NT system from the source in p500404.zip,
which I got from CPAN.  I've read all the docs I could find pretty carefully
and I think I've got everything set up correctly, but the build always
aborts at a certain point.  The tools I'm using are dmake and Borland C++
5.02.

At first I couldn't get dmake to get going on makefile.mk, but then I
figured out that it needed the -B switch (use spaces not tabs to start
recipes).  I didn't see this documented in any of the readme's etc., but
it's the only way I could get it to start.  So after that it chugs along
fine for quite a while -- albeit with copious warnings from BC++ -- until I
get the following fatal error from dmake (this is verbatim):

 ...
cd .. && miniperl configpm
if exist lib\* xcopy /f /r /i /e /d lib\*.* ..\lib\
xcopy /f /r /i /d ..\*.h ..\lib\CORE\*.*
0 File(s) copied
xcopy /f /r /i /d *.h ..\lib\CORE\*.*
0 File(s) copied
xcopy /f /r /i /e /d include ..\lib\CORE\*.*
0 File(s) copied
 ..\miniperl.exe -I..\lib config_h.PL || f:\dmake\dmake.exe -S -S -B
CCTYPE=BORLAND \
        RUNTIME=-D_RTLDLL CFG= ..\lib\Config.pm
 ..\miniperl.exe -w makedef.pl BORLAND > perldll.def
bcc32 -c -w -tWM -tWD -I.\include -I. -I.. -If:\Borland\Bc5\include -DWIN32 
-DPERLDLL  -O -D_RTLDLL -operllib.obj perllib.c
Borland C++ 5.2 for Win32 Copyright (c) 1993, 1997 Borland International
perllib.c:
copy dl_win32.xs ..\ext\DynaLoader\dl_win32.xs
        1 file(s) copied.
if not exist ..\lib\auto mkdir ..\lib\auto
xcopy /f /r /i /d ..\ext\\.pm ..\lib\
File not found - .pm
0 File(s) copied
dmake.exe:  Error code 4, while making '..\ext\DynaLoader\DynaLoader.c'


That last line is where it aborts.  Since it apparently has trouble with
DynaLoader.c, I tried to find it; it turns out its not in the distribution.
I can only guess that that is how it's supposed to be, but dmake definitely
seems to want to give it to the compiler.  I edited makefile.mk to tell it
where I wanted Perl installed, and where my compiler is installed, but
that's it.

At this point I don't know what else could be wrong, so if anyone has an
idea I'd like to know.  Note that this is the first time I'm trying this, so
if I'm missing something obvious don't slaughter me for it.

Thanks,

Joe Vargyas









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

Date: Sat, 27 Jun 1998 19:21:25 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: CGI Question In Regards To & Char
Message-Id: <alecler-2706981921250001@dialup-808.hip.cam.org>

In article <359551dd.29309408@news.btinternet.com>,
Gellyfish@btinternet.com (Jonathan Stowe) wrote:

> On Sat, 27 Jun 1998 15:48:24 GMT, Ralph Freshour wrote :
> 
> >I have a perl cgi script that has been working for many months passing
> >data from the browser to the unix server to write text data to disk -
> >I recently discovered that if one of the characters in the text lines
> >contains an & char, the cgi transfer truncates all of the data
> >starting from the & char and everything else!!!  In other words, I
> >only get the data up to the & and not the rest of the data.
> >
> >What can I do to transfer the & char and not have this happen?
> >
> 
> Aieee.
> 
> Of course this is *NOT A PERL THING* .  The ampersand character has
> special meaning in CGI terms being the character used to separate
> parameters in the query string.  I dont really want to go into this
> but my thought is that a browser should translate/escape these
> characters.  You might get more sense out of a more CGI oriented NG
> like comp.infosystems.www.authoring.cgi or preferably its FAQ.
> 
> If you use CGI.pm you might find yourself with an extra param() whose
> name contains the missing data however.

Just a thought: is the encoding for the form set to "text/plain", by any chance?

Jonathan is right, this ain't no Perl question.

A.L.


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

Date: Sat, 27 Jun 1998 22:26:56 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: creating unique session id w/ perl
Message-Id: <Pine.GSO.3.96.980627151906.19372C-100000@user2.teleport.com>

On Sat, 27 Jun 1998, Plamen Petkov wrote:

>     srand (time|$$);

That's not the recommended way to use srand. The perlfunc manpage shows a
better way, unless your perl binary is old.

>     $cart_id = int(rand(10000000));

That won't necessarily be able to produce 10_000_000 possible integers on
many (most?) systems. It should probably be something more like this.

	$cart_id = sprintf "%04d%03d", rand(10_000), rand(1000);

>     $cart_id .= "_$$";

Of course, that could have been done as part of the last statement. But as
long as you're going to register the numbers in a file, it's probably not
needed, unless your perl binary is old.

>     $sc_cart_path = "${cart_id}.cart";

Those curly braces don't hurt, but they're not needed, either.

Hope this helps!

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



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

Date: Sun, 28 Jun 1998 02:45:23 GMT
From: birgitt@my-dejanews.com
Subject: Re: creating unique session id w/ perl
Message-Id: <6n4ao3$pse$1@nnrp1.dejanews.com>

In article <Pine.SOL.3.96.980626174012.2371A-100000@ruby.ils.unc.edu>,
  Kyle Poquette <poquk@ils.unc.edu> wrote:
>

> Is there a way to create a session id (using perl, of course) which cannot
> easily be guessed, and which will generate a unique string for each
> invocation of the cgi script (which could possibly be running multiple
> times per second)?

You might want to look at the GPL'ed shopping cart package,
MiniVend, available through CPAN and at www.minivend.com.

> How do the larger shopping cart sites like amazon.com
> create their session ids?

Read the documentation of minivend. It will help you.

Birgitt Funk

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum


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

Date: Sat, 27 Jun 1998 23:18:21 -0300
From: Colin Kilburn <ckilburn@nbnet.nb.ca>
Subject: Re: eval (Data::Dumper->dump($cool, ...'limit?'));
Message-Id: <3595A7EC.6C74C9A@nbnet.nb.ca>

Tom Phoenix wrote:

> On Sat, 27 Jun 1998, Colin Kilburn wrote:
>
> > What is the size of the largest piece of code that can
> > be evaled?
>
> You're talking about eval of a string, right? Like most things in
> Perl,
> there's no hard limit built into eval. If you can fit it into a string
> and
> have enough memory left to process it, you should be able to eval it.
>
> Of course, that's not likely to be the best way to solve whatever
> problem
> you might be having... :-)
>

Ok, I'll bite.No problem that I am aware of, I just wanted to know the
bounds
and limits of eval's input.

I'm having a ball redesigning a major component of our companies
(Yr2K shop) product.  The customer code setup. It unpacks
and massages the customer code for the parsers which feed
the transformers and remediators. Our product runs on UNIX whereas
the customer's code is mostly MVS and some VMS based.  Lots
of gotchas.  Perl's specialty! After the customer's code is processed,
Perl again jumps in and does a bunch of stuff.  bla bla bla

One of the nice things about the new design is that, a Cust object
can absorb the configuration information and some nested structures
(customer code module information). As well, there is a Messaging
object for a consistent interface for the pending GUI.
I place a reference to the Messaging object in the Cust object
to allow Cust to control that instance of the Messaging object.
I could use more then one Messaging object if the need arises.

The super cool part of it all is the persistence of Cust, and the
Data::Dumper
makes it all too easy. This has worked very well. I am impressed.
It is also useful for debugging and explaining the structure and purpose

of the Cust object to co-workers.

I replaced my serializing code with a call to the very cool
Data::Dumper.
The object lives again and again in its afterlives. The dump happens in
the
DESTROY method so, it's automatic no matter what. Its just so elegant,
at least to me.

All the details of the customer's code at your finger tips throughout
the process.
Need a script to do this or that, just reinitialize Cust, and do it. My
design is
becoming a tool kit for developing a consistent process.  fun fun fun.

This new design is integrating many individual scripts, from 4 to 6
years
of development.  It's soooo much better to redesign, with insight, then
continue to maintain a wack of piece meal scripts.  The Perl is quite
stable but not well organized and similar tasks are repeated, and fairly

unintelligent.

One enhancement of the design that I haven't quite solved is the
communication with the non Perl (middle stages) of the process.
I will post a new question for advice.

Thanks for reading all of this (Tom), and I hope I was clear enough.
Colin.

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





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

Date: Sat, 27 Jun 1998 18:53:50 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Field Sort without modules?
Message-Id: <fl_aggie-2706981853500001@aggie.coaps.fsu.edu>

In article <35945839.7374@jps.net>, Trent Hare <trent@jps.net> wrote:

+ If you would be so kind to tell me *which Perl FAQ you are referring to
+ I'd appreciate it. I'm only a little stupid.... maybe I'll be able to
+ find it with a small clue.

Here's a small clueX4...

% perldoc perlfaq
[...]
    the perlfaq4 manpage: Data Manipulation
        Manipulating numbers, dates, strings, arrays, hashes, and
        miscellaneous data issues.
[...]

% perldoc perlfaq4
[...]
  How do I sort an array by (anything)?
[...]

There's also a Far More Than You Ever Wanted To Know (FMTYEWTK) on 
sorting on http://www.perl.com/.

James


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

Date: Sat, 27 Jun 1998 18:46:34 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Flames....
Message-Id: <fl_aggie-2706981846340001@aggie.coaps.fsu.edu>

In article <lt67hnr772.fsf@asfast.com>, Lloyd Zusman <ljz@asfast.com> wrote:

+ Actually, I would very much be in favor of a c.l.p.cgi newsgroup.
+ This proposal has been rejected in the past, but perhaps now might be
+ a good time to revisit this idea.  Any thoughts?

In a word: no.

Unless you can come up with good reasons why comp.infosystems.www.authoring.cgi 
is either perl hostile (it isn't) or broken (it isn't) then there is no
reason to go creating another Big 8 newsgroup.

And to be blunt: CGI is boring. Let <your favorite perl CGI library here>
do the dirty work of talking CGI. Concentrate your time and talents on
the KEWL parts that make the program work. And gosh, all of a sudden,
that's part is interface independent, and belongs in a perl newsgroup.

James


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

Date: Sat, 27 Jun 1998 17:58:09 -0400
From: "Cybervillain" <dbalsillie@email.msn.com>
Subject: Re: Help with Programming
Message-Id: <us7dtaho9GA.169@upnetnews05>

Most of the books on the market are written to make profit for their
authors. You are better off to obtain such materials from their source.
I would go with ASP though. The learning curve is faster to attain and I
believe this technology will be here to stay for a while and will be
compatible with future technologies.




Bruno Pisano wrote in message <6n0rb1$83q@nntp02.primenet.com>...
>I develop web sites, and trying to get into more complex
>programming.
>Searching through CGI/Perl, ASP and Cold Fusion.
>To build sites that need search capabilities and
>shopping cart, what would you recommend I learn, which
>is the easiest and most practical?
>(I bought a book which is supposed to be the best,
>called CGI/Perl Cookbook, and I'm having a hard time
>even on the very first application...)
>
>Please, reply to
>
>Bruno Pisano
>chiherbs@primenet.com




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

Date: Sat, 27 Jun 1998 22:57:36 GMT
From: Gellyfish@btinternet.com (Jonathan Stowe)
Subject: Re: Help with Programming
Message-Id: <35957363.7593436@news.btinternet.com>

On Sat, 27 Jun 1998 17:58:09 -0400, Cybervillain wrote :
>Bruno Pisano wrote in message <6n0rb1$83q@nntp02.primenet.com>...
>>I develop web sites, and trying to get into more complex
>>programming.
>>Searching through CGI/Perl, ASP and Cold Fusion.
>>To build sites that need search capabilities and
>>shopping cart, what would you recommend I learn, which
>>is the easiest and most practical?
>>(I bought a book which is supposed to be the best,
>>called CGI/Perl Cookbook, and I'm having a hard time
>>even on the very first application...)
>>
>Most of the books on the market are written to make profit for their
>authors. 

What are you saying here ?  Most books are written by their authors in
order to make money yes, money to pay the rent, money to feed the
children or the cat, money to buy that one last beer with the mates
down the pub ...

<troll>
Most programs are written by programmers to make a profit ... 
</troll>

>          You are better off to obtain such materials from their source.

Of course, the Perl distribution comes with a wealth of excellent
documentation which mirrors in some ways the best commercial books
available

>I would go with ASP though. The learning curve is faster to attain and I
>believe this technology will be here to stay for a while and will be
>compatible with future technologies.
>
But what is all this ASP stuff ?  Active Server Pages.  A proprietary
Microsoft technology (And dont let that PerlScript stuff fool you ).
It still isnt a replacement for learning to program.  The technology
is as ephemeral as Microsoft's interest in the Internet and is tied
solely to their server products whereas Perl is widely applicable well
beyond the CGI/Internet arena.  

/J\
Jonathan Stowe
Some of your questions answered:
<URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>



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

Date: 28 Jun 1998 01:06:59 GMT
From: Josef_Becker@t-online.de (www.helpmaster.com)
Subject: Re: Help with Programming
Message-Id: <6n44vj$ftj$3@news00.btx.dtag.de>

comp.os.ms-windows.programmer.winhelp
is the absolute wrong group for this question.

Why not only spam related groups?
The whole threads have been posted
to comp.os.ms-windows.programmer.winhelp

Have you ever heard about winhelp? 
That are the files with the HLP extension.

Josef


IFCEB Computer Based Training Award in 1989, 1992, 1995
AGAG Award of Excellence in 1997, GIFArtist Award in 1998
Visit: http://www.helpmaster.com


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

Date: 27 Jun 1998 21:16:15 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Hiding the Perl source
Message-Id: <6n3nev$ce9$1@news.NERO.NET>

In article <6n1tns$pjs$2@client3.news.psi.net>,
Abigail <abigail@fnx.com> wrote:
>John Stanley (stanley@skyking.OCE.ORST.EDU) wrote on MDCCLXI September
>MCMXCIII in <URL: news:6n1h6b$jig$1@news.NERO.NET>:
>++ In article <6muia5$9au$5@client3.news.psi.net>,
>++ Abigail <abigail@fnx.com> wrote:
>++ >I said it was anti-social to expect the tools you are developing
>++ >with to be free, yet the things you are developing shouldn't be.
>++ 
>++ It is as anti-social to say that your code is free but then tell people
>++ that you don't want them to use it for things you don't like.
>
>Your point being?

I don't know. You seemed to think it was important to mention what
anti-social behaviour was. I assumed you were doing so because you
thought it was bad. If that isn't true, then what is _your_ point?



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

Date: 28 Jun 1998 02:03:17 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Hiding the Perl source
Message-Id: <6n4895$5qp$1@client3.news.psi.net>

John Stanley (stanley@skyking.OCE.ORST.EDU) wrote on MDCCLXI September
MCMXCIII in <URL: news:6n3nev$ce9$1@news.NERO.NET>:
++ In article <6n1tns$pjs$2@client3.news.psi.net>,
++ Abigail <abigail@fnx.com> wrote:
++ >John Stanley (stanley@skyking.OCE.ORST.EDU) wrote on MDCCLXI September
++ >MCMXCIII in <URL: news:6n1h6b$jig$1@news.NERO.NET>:
++ >++ In article <6muia5$9au$5@client3.news.psi.net>,
++ >++ Abigail <abigail@fnx.com> wrote:
++ >++ >I said it was anti-social to expect the tools you are developing
++ >++ >with to be free, yet the things you are developing shouldn't be.
++ >++ 
++ >++ It is as anti-social to say that your code is free but then tell people
++ >++ that you don't want them to use it for things you don't like.
++ >
++ >Your point being?
++ 
++ I don't know. You seemed to think it was important to mention what
++ anti-social behaviour was. I assumed you were doing so because you
++ thought it was bad. If that isn't true, then what is _your_ point?


Edvard Majakari (ed@lodge.ton.tut.fi) wrote on MDCCLIX September MCMXCIII
in <URL: news:m0af71lja5.fsf@lodge.ton.tut.fi>:

++ Not that it makes any difference, but IMHO so called 'core stuff'
++ should be always distributed under GPL. With 'core stuff' I mean all
++ the software needed for developing specialized software, like in Unix,
++ the kernel itself and basic utilities (cat, ls, command interpreter
++ and so on). 

To which I replied with:

++ I really dislike the attitude of "what I need to develop stuff should
++ be free, but what I develop should not". It's anti-social.

That was misinterpreted, so I clearified.



Abigail
-- 
perl -we '$_ = q ;4a75737420616e6f74686572205065726c204861636b65720as;;
          for (s;s;s;s;s;s;s;s;s;s;s;s)
              {s;(..)s?;qq qprint chr 0x$1 and \161 ssq;excess;}'


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

Date: Sat, 27 Jun 1998 22:16:25 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: HTML pages with Perl
Message-Id: <Pine.GSO.3.96.980627151448.19372B-100000@user2.teleport.com>

On 27 Jun 1998, mikep wrote:

> The trick is that the first line out of your perl script must be
> "Content-type: text/html\n\n" (note the two line breaks, don't forget
> them) if your script is to be a standalone script (e.g. a standalone
> "page"). 

That's not necessarily the (whole) truth. For a more complete answer,
check the docs, FAQs, and newsgroups about CGI programming. Hope this
helps! 

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



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

Date: 28 Jun 1998 01:48:49 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Linked list and a code challenge
Message-Id: <6n47e1$5oj$1@marina.cinenet.net>

Snowhare (snowhare@devilbunnies.org) wrote:

:  CHRIS    => sub { &do_it(\&chris_berry_findloop) },

That's 'Craig' Berry, please.  If I'm going to go down in algorithmic
history, I want it to be under my actual name. :)

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


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

Date: 27 Jun 1998 16:58:26 -0400
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: Parsing a list of names and assigning each to an arry?
Message-Id: <m34sx6ef4d.fsf@peach.z.org>

"M. Zschoch" <mzschoch@bc.sympatico.ca> writes:

> Can anyone point me to an example of a method to parse through a file
> containing a list of names and assigning each name to an element in an
> array?

Sure. What's the file format like?

If it's simply one name per line, how about this...

--- snip ---

#!/usr/bin/perl

my @list_of_names = ();

while(<>) {
	chomp;
	push(@list_of_names, $_);
}

--- snip ---

That'll put the names in the elements of the @list_of_names array.

Jeremy
-- 
Jeremy D. Zawodny                   Web Geek, Perl Hacker, etc.
http://www.wcnet.org/~jzawodn/      jzawodn@wcnet.org

LOAD "LINUX",8,1


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

Date: 28 Jun 1998 02:07:36 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Parsing a list of names and assigning each to an arry?
Message-Id: <6n48h8$5qp$2@client3.news.psi.net>

M. Zschoch (mzschoch@bc.sympatico.ca) wrote on MDCCLXI September MCMXCIII
in <URL: news:3594E11E.7F45B1A8@bc.sympatico.ca>:
++ Hello,
++ 
++ Despite reading the FAQ and most of Swartz & Christiansen's Learning
++ Perl I'm still having trouble with a problem.
++ 
++ Can anyone point me to an example of a method to parse through a file
++ containing a list of names and assigning each name to an element in an
++ array?


I have the feeling the real question is different.

   open FILE, "names" or die "Failed to open file: $!";
   chomp (my @names = <FILE>);
   close FILE or die "Failed to close file: $!";



Abigail
-- 
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'


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

Date: Sat, 27 Jun 1998 23:39:24 GMT
From: Steve McClellan <stevemcc@adelphia.net>
Subject: Problem deleting keys/values from .db files
Message-Id: <35958058.984C39D3@adelphia.net>

I try to use the following code to delete records from a .db file only
to find out it doesn't. I have opened the database up in a plain text
editor and still see both the key and value that I have tried to delete.
Here's the code:
sub del {
my($ref, %rd, %nd); #variable declarations

$ref = $_[0];

dbmopen(%rd, "rank", 0644); #open the ranks and names database
dbmopen(%nd, "name", 0644);

delete $rd{$ref};
delete $nd{$ref};

out($ref, $rank, %nd, %rd);

close(%rd); #close the ranks and names databases
close(%nd);
}

If you know what is wrong, please email me at unforgivenII@hotmail.com
Thank you



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

Date: Sun, 28 Jun 1998 00:25:05 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Problem deleting keys/values from .db files
Message-Id: <Pine.GSO.3.96.980627171549.19372K-100000@user2.teleport.com>

On Sat, 27 Jun 1998, Steve McClellan wrote:

> I try to use the following code to delete records from a .db file only
> to find out it doesn't. I have opened the database up in a plain text
> editor and still see both the key and value that I have tried to delete.

It's not a text file; why are you using a text editor to read it?

Of course, like most non-text files, the file may include remnants of old
data which has been "deleted". But if you open the file in the right way,
you should find that the information has been properly removed by the
delete function. 

This is directly analogous to what happens when a file is deleted. 

Didn't we just go through this a week ago?

Hope this helps!

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



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

Date: Sat, 27 Jun 1998 20:55:57 -0400
From: Andrew Chang <bikejog@bellatlantic.net>
To: Tom Phoenix <rootbeer@teleport.com>
Subject: setuid and hiding script questions.
Message-Id: <3595949D.35DF@bellatlantic.net>

Hi,
   Thanks for the info.  I think I can do away with using setuid.  Here
are brand new questions on setuid.  Suppose I have two scripts

start.pl and
shell.pl

   Both are setuid scripts.  start.pl has read and execute permissions
for everyone, but shell.pl has read/exec permissions only for the owner.
When a user executes start.pl, it starts shell.pl.  First thing
shell.pl does is to set the effective uid back to the real uid.

   Here are two questions:

1) Does this scheme allow the user to run shell.pl and prevents
   him/her from reading shell.pl?
2) By setting the user's effective uid back to its real uid, does
   that prevent the user from accessing the script owner's files?
   (shell.pl will allow simple file operations)


Please email if all possible.

Thanks a million.

Andy
mailto:  bikejog@zdial.com


Tom Phoenix wrote:
> 
> On Sat, 27 Jun 1998, Andrew Chang wrote:
> 
> > Newsgroups: comp.lang.perl, comp.lang.perl.misc
> 
> If your news administrator still carries comp.lang.perl, please let him
> or her know that that newsgroup has not existed since 1995. If you
> have such an outdated newsgroup listing, you are probably missing out
> on many other valid newsgroups as well. You'll be doing yourself and
> many others a favor to use only comp.lang.perl.misc (and other valid
> Perl newsgroups) instead.
> 
> > I would like to assign a subdirectory to be the root for those
> > operations in my shell (same as what chroot does) so that user programs
> > compiled and executed within the shell cannot have access to anything
> > outside of the designated root.
> 
> If your system doesn't let non-root users access the chroot system call,
> there's no way for Perl to do it. But perhaps you can convince your system
> administrator to let you make a chroot "wrapper" for you to use. This
> would be a small program which would be setuid to root so that it could
> chroot and launch another program.
> 
> Hope this helps!
> 
> --
> Tom Phoenix       Perl Training and Hacking       Esperanto
> Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/


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

Date: 27 Jun 1998 19:15:49 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: setuid and hiding script questions.
Message-Id: <m3d8bu2rvu.fsf@windlord.Stanford.EDU>

Andrew Chang <bikejog@bellatlantic.net> writes:

> Both are setuid scripts.  start.pl has read and execute permissions for
> everyone, but shell.pl has read/exec permissions only for the owner.
> When a user executes start.pl, it starts shell.pl.  First thing shell.pl
> does is to set the effective uid back to the real uid.

> Here are two questions:

> 1) Does this scheme allow the user to run shell.pl and prevents
>    him/her from reading shell.pl?

No, not if he's determined.  See, you now have a running process of
shell.pl sitting in memory owned by the person who ran the original
script; since it's his process, he has access to all of the memory space
it's using and could simple attach to it with gdb or some other tool and
probably extract quite a bit of the code with time and patience.

I have to really wonder why you're trying to do this, as you're
introducing a potential security hole in your system for no apparent gain.

> 2) By setting the user's effective uid back to its real uid, does that
>    prevent the user from accessing the script owner's files?  (shell.pl
>    will allow simple file operations)

*Probably.*  However, in my experience setuid is a vast chasm of hidden
dangers that vary from platform to platform.  About the only thing I
consider safe in terms of dropping permissions is to set both the real and
effective UID and then exec another process; my understanding is that
there is no way to recover the original privileged UID in the exec'd
process after that has been done.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


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

Date: Sun, 28 Jun 1998 03:20:53 +0200
From: Richard <rp001@dial.oleane.com>
Subject: sorting array of array question
Message-Id: <35959A75.375EAD59@dial.oleane.com>

hi everybody,

i'm trying to make a webforum script in perl and i ve got a problem for
sorting  the replies to a thread, i ve
got all the data concerning the replies in an array of array, (lets call
it $reply),  if i do  that :

  my($i,$j);

   for $i(0..$#{$reply}){

         for $j (0..$#{$reply->[$i]}) {

      print "$reply->[$i][$j]\t";

         }
         print "\n";
     }


the output is something like that (with more stuff like name,email,.. ),
here the 1st field is the msg_id,  and
after the date is the respond_to id and the last is the base_id (ie the
id of the main thread):

msg_id              date             rep_to   base_id

9         1998-06-27 02:54:21     7       2
8         1998-06-27 02:47:09     3       2
7         1998-06-27 02:46:49     5       2
5         1998-06-27 02:44:27     2       2
3         1998-06-27 02:43:46     2       2

(in this example the msg number 9 is a response to the 7 which is a
response to the 5 which is himself a response to the main thread)

so if anybody got an idea for sorting this to print the replies in the
correct order which here would be (for
getting the famous indentation between replies of webforums scripts :-]
):


msg_id              date             rep_to   base_id

5         1998-06-27 02:44:27     2       2
7         1998-06-27 02:46:49     5       2
9         1998-06-27 02:54:21     7       2
3         1998-06-27 02:43:46     2       2
8         1998-06-27 02:47:09     3       2

any help appreciated.

regards,

Richie



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

Date: Sun, 28 Jun 1998 01:16:31 GMT
From: Charles Maier <maierc@chesco.com>
Subject: Re: Subroutine Variables
Message-Id: <35942E5C.81D@chesco.com>

I get the impression that there is more to this post.. but my news
server missed it. 

The 2 functions   my()   and local() have different impact on the
variables assignments.

 With my()... the variable will exist only within THIS block. It also
generates a stack frame so recursive subroutines will act like you would
expect of 'local()'.... a new copy for each recursion.

With local() ... the variable will exist within this block and any block
CALLED from this block.


-- 
Chuck Maier
CDM Consulting Services
http://www.cdmcon.com
(610) 943-2726




mikep wrote:
> 
> In article <3593C588.88421608@cs.purdue.edu>
> Alex Svetlev <svetlev@vmw3.ibm.com> writes:
> 
> > I have a subroutine with variables that I declare with "my". Each time I
> > call this subroutine, the variables still have the values they did in
> > the previous call. How can I clear them out? Nothing seems to be
> > working. Not local, my, or undef. This doesn't seem like a complex
> > thing, but I'm stumped.
> 
> Doesn't the local function declare or at least limit an instance of a
> variable to its current scope?
> 
> ===========================
> Mike Powell
> mikep@rt66.com
> http://www.rt66.com/~mikep/


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

Date: 27 Jun 1998 16:45:42 -0600
From: snowhare@xmission.xmission.com (Snowhare)
Subject: Re: Testing perl knowledge
Message-Id: <6n3smm$9sj$1@xmission.xmission.com>



Nothing above this line is part of the signed message.

In article <6n1g9m$jb2$1@news.NERO.NET>,
John Stanley <stanley@skyking.OCE.ORST.EDU> wrote:
>In article <eli$9806251708@qz.little-neck.ny.us>,
>Eli the Bearded  <*@qz.to> wrote:
>
>>It is well within my rights to state (after
>>being certified whatever by Chris) that I am a Chris Nandor Certified
>>Whatever.
>
>Yes, you may certainly call yourself a Certified Whatever. I'm simply
>pointing out that in some places, if you call yourself an Engineer you
>might be violating the law. Not that I care, I'm just pointing it out
>in case there are people here who care about not violating laws and
>such. If you aren't one of them, that's nice. Do what you will.
>

You both might find the following URLs interesting reading.

<URL:http://www.prnewswire.com/cgi-bin/stories.pl?ACCT=105&STORY=/www/story/04-14-1998/0000631351&EDATE=>

<URL:http://www.prnewswire.com/cgi-bin/stories.pl?ACCT=105&STORY=/www/story/7-14-97/275622&EDATE=>

They are regarding attempts by some states to prevent Novell from using
the word 'Engineer' as part of their 'Certified NetWare/Novell Engineer'
title. 

About all that is clear to me is that some degree of confusion exists in
the area and that people without the monetary resources to fight a legal
battle would be wise to steer clear of the whole thing. 

Benjamin Franz


Version: 2.6.2

iQCVAwUBNZV2EOjpikN3V52xAQF4WQP+PwNsURWz28o+/cUWnDSJNKbTqNZU70CJ
Fme7cpAIwjnWYRAUqqw0ufybSegRJKF/uUQ/OoTdW3mm7FBLtSebRbKCh3UJyRYw
aTUmjQs3CLLPAKKjrzU+7mZr6FZLyOLshRXSeaizBD3PlkPfB5tLLo5WXnyotn9c
DwTaneOBp8I=
=h9A1
-----END PGP SIGNATURE-----


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

Date: Sat, 27 Jun 1998 19:54:14 -0700
From: Scott Bronson <sbronson@opentv.com>
Subject: Visible proxy?  using require?
Message-Id: <3595B056.216C9E01@opentv.com>

Has anyone written what I can best describe as a visible proxy?  I want
to capture and watch all text sent and recieved over a single TCP port
on my computer.   I picture this being very similar to a serial protocol
analyzer, except that it watches network ports instead of serial ports. 
This seems right up Perl's alley.


Also, I have a standalone command (right now it's named "clean") that
runs terrific.  However, I'd like to run it inside a harness to do
regression testing.  My solution for now has been:

   Clean: all subroutines, plus this single executable line:

      execute_command() unless( $harnessed );


   The harness contains these two lines.

      $harnessed = 1;
      require "clean";

Therefore, when the harness loads Clean, execute_command will not run. 
The harness is then free to call all of Clean's routines however it
wants.  I don't want to split Clean up into modules--it's not that big
yet, and I would like to avoid the version and maintenance headaches
that would incur.

However, my solution seems hackish to me, not to mention the annoying
error message, "Name "main::harnessed" used only once: possible typo at
clean line 1524."  There has got to be a better way, yes?

Thanks, 

	- Scott


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

Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.  

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

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