[10940] in Perl-Users-Digest
Perl-Users Digest, Issue: 4541 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jan 4 04:07:12 1999
Date: Mon, 4 Jan 99 01: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 Mon, 4 Jan 1999 Volume: 8 Number: 4541
Today's topics:
Re: Formatting Dates (Searching for date + 30) <ebohlman@netcom.com>
Re: Help XS'ing a C function which malloc's its argumen (Michael G Schwern)
Re: How to get start ? <ex5316@netvigator.com>
htaccess,LWP, & redirecting <nsurfer@bellsouth.net>
installing DBI-1.02 problems!! :( <crstlblu@planet.eon.net>
Re: Is Perl as multifunctional as I've heard\read? <aj2000@sympatico.ca>
Re: List Boxes in Perl <vbezard@atos-group.com>
Re: looking for perl programmer <chatmaster@c-zone.net>
Re: Newbie: Search Engine imchat@ionet.net
Re: Perl Cookbook <chatmaster@c-zone.net>
Please help <it@arms.com.sg>
Re: Please help (Ethan H. Poole)
Re: Retrospective on comp.lang.perl.moderated? (John Stanley)
Re: Retrospective on comp.lang.perl.moderated? (John Stanley)
Re: Rookie CGI problem imchat@ionet.net
Re: Security & Permissions: Why can't Perl read files f (John Stanley)
Re: Security & Permissions: Why can't Perl read files f (Abigail)
Re: Sorting a hash (Abigail)
Re: strange behavior of $~ (John Stanley)
Re: Syntax error in subroutine: help please <chatmaster@c-zone.net>
Re: Thanks! and happy new year! <chatmaster@c-zone.net>
Re: tutorial websites <aj2000@sympatico.ca>
Using Filter Module to Protect Source Code <admin@oneseek.com>
Re: Using Filter Module to Protect Source Code <cmcurtin@interhack.net>
where are perl distribution pages found? <aj2000@sympatico.ca>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 4 Jan 1999 08:36:34 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Formatting Dates (Searching for date + 30)
Message-Id: <ebohlmanF5118y.A3s@netcom.com>
webmaster@entrepreneur-online.com wrote:
: > All your other field indices are off by one. $terms[4] is undefined.
: I disagree. The fourth field is defined or none of the dates would be printed
You're correct. My eye skipped over the initial '|' on each line of your
data file, and I interpreted it as the more common pipe-*separated* file
rather than the pipe-*delimited* file you had.
Where does $datestamp come from and what format does it have?
------------------------------
Date: Mon, 04 Jan 1999 01:40:44 -0500
From: schwern@pobox.com (Michael G Schwern)
Subject: Re: Help XS'ing a C function which malloc's its arguments.
Message-Id: <schwern-0401990140440001@news.erols.com>
I think I've fixed my own problem (with many thanks to EFNet #perl and
meowing@banet.net).
I did the following in Module.xs:
int
function(input, output)
char *input;
char * &output = NO_INIT;
CODE:
RETVAL = function(input, &output);
XST_mPV(2, output);
OUTPUT:
output
If you're not familiar with it, XST_mPV is a macro from XSUB.h that I
stumbled onto:
#define XST_mPV(i,v) (ST(i) = sv_2mortal(newSVpv(v,0)))
It basically takes a char *, makes a new SV out of it, makes that SV
mortal, then sticks it onto the argument stack at the given position (in
this case 2 for output, since the RETVAL is ST(0), input is ST(1) and
output is ST(2).)
Putting output into the new SV makes perl aware of it, and it will now
automagically handle freeing its memory (umm, I hope. At least I didn't
see anything like a memory leak... $self->knock($wood))
Yay. (You have no idea how many segfaults I went through before figuring this
out.)
PS. My new XS version of Text::Metaphone is ~40x faster than my original
perl version (which, I must admit, was kinda doggish). :)
In article <schwern-0301991640500001@news.erols.com>, schwern@pobox.com
(Michael G Schwern) wrote:
>Say I have a C function like:
>
>int function(char *input, char **output) {
> /* calculate size based on input */
>
> /* allocate memory for output */
> if ((*output = (char *)malloc(size)) == NULL)
> return 0; /* malloc failure */
>
> /* put stuff in output, based on input */
>
> /* return success */
> return 1;
>}
>
>
>Never mind the details, the fact that it does its own malloc() of an output
>parameter is the important part. I wish to put an XS wrapper around this.
>
>I tried the following XS prototype for it...
>
>int
>function(input, output)
> char *input
> char * &output = NO_INIT
> OUTPUT:
> output
>
>Calling the function from perl as:
>
>function($input, $output) || warn "function failed";
>print $output;
>
>
>This worked, but it has a memory leak, since perl is not aware that function()
>allocates the memory for $output.
>
>
>My question is:
>How can I make perl aware that $output has had its memory allocated for it
>and handle it appropriately?
<snicker-snatch>
Michael G Schwern schwern@pobox.com
------------------------------
Date: Mon, 04 Jan 1999 15:35:24 +0800
From: Alex <ex5316@netvigator.com>
To: Ronald J Kimball <rjk@linguist.dartmouth.edu>
Subject: Re: How to get start ?
Message-Id: <36906F3C.EFEF500E@netvigator.com>
If the name " Free stuff" make any misunderstanding to somebody. I use
my Real Name Alex for corresponding.
Thank you for help
Alex
------------------------------
Date: Mon, 04 Jan 1999 07:57:25 GMT
From: Steve Miles <nsurfer@bellsouth.net>
Subject: htaccess,LWP, & redirecting
Message-Id: <3690727B.3B34B644@bellsouth.net>
Hi all,
My problem-du-jour is that I'd like to have my users admitted to an
.htaccess protected directory without having to put in the password and
username. Now what I planned to do was have them enter through a form
button which calls a cgi script that essentially prints "Location:
http://username:password@www.mydomain.com". Now, this works when I type
it into the browser, and when I use the script with Netscape4.5, BUT
when the script is called in IE4 the user/password window appears.
Does anyone have an idea how to get around that? Or is it just
impossible to "secretly" admit someone to an .htaccess directory and/or
is this just not a safe method in IE4 and older browsers?. I fiddled
around with LWP::Useragent and was able to call ONE password protected
page fine in both browsers. But when you click on to hyperlinks within
the same directory the password window prompt comes up again. (Of
course, I know that LWP is only "summoning" the page and probably isn't
the answer - but I thought there might be a trick there or something.)
Thanks in advance.
Steve Miles
------------------------------
Date: Mon, 04 Jan 1999 07:43:21 GMT
From: <crstlblu@planet.eon.net>
Subject: installing DBI-1.02 problems!! :(
Message-Id: <36906b2c.7384102@news.planet.eon.net>
Hello:
downloaded and installed (self extracting exe file called "APi508e.exe"... I
ended up with a working (? I think, because perl will run simple print and
variable shuffles and sorts etc to THE SCREEN) - copy of "ActivePerl v5.00502"
now of course i would like to access databases; i also downloaded the latest
versions of: DBI-1.02;...
the DBI makefile is located in c:\perl\lib\Dbi-1.02\makefile.pl
so from BOTH the c:\perl directory i tried to run it, also from
the c:\perl\lib\Dbi-1.02 directory....
BOTH times i got an error message that said that:
"optional pRPC-module (pRPC::Client and etc.) are not
installed,... and that the DBD::ProxyDriver & DBI::ProxyServer won't
work or something like that...
THEN i download the latest pRPC-modules-0.1005,....
put those dir&files into the c:\perl\lib\pRPC-modules-0.1005\ directory
and try to run the makefile in that directory from BOTH the c:\perl
root directory, as well as from locally within the
c:\perl\lib\pRPC-modules-0.1005\ directory
BOTH TIMES i got the following error message from that:
CHECKING FOR STORABLE,
YOU MUST HAVE INSTALLED "STORABLE" MODULE
then it told me some places to check the WEB for it,
which i did but i found nothing
Does anybody know what i should do? this is so much fun trying to simply build
a working win95 perl developement platform - WHO NEEDS TO LEARN PROGRAMMING? :)
wayne.
thanks for any help you can.
------------------------------
Date: Mon, 04 Jan 1999 02:07:38 -0500
From: Eric B <aj2000@sympatico.ca>
Subject: Re: Is Perl as multifunctional as I've heard\read?
Message-Id: <369068BA.D487DCC2@sympatico.ca>
Raphael wrote:
> After learning C/C++/Fortran/Pascal/Lisp/Basic/Java, I can confirm
> that Perl is by _far_ the best language to learn if you are only
> going to learn one. Mind you, its also hairy, inconsistent and strange,
> but so's life.
>
Hello
I am about to start to learn perl it will be my first computer language... other
than html (which is not really programming i guess)
I am considering switching majors at the university I attend to computer
science...
I hope I can ask for some advice from you Ralph and the rest of this newsgroup
My main interest is webprogramming and there is so many languages to learn...
what would be the best languages to pursue....
I choose perl because it seems to be a very popular language on the net...
I look forward to your response and thanks
Sincerely
Eric B
:-)
------------------------------
Date: Mon, 4 Jan 1999 09:02:02 +0100
From: "Vincent BEZARD" <vbezard@atos-group.com>
Subject: Re: List Boxes in Perl
Message-Id: <76psm9$501$1@jaydee.iway.fr>
This is an example that can help you with the list box in HTML:
############################## Silection des groupes d'appartenance
###########################
Win32::AdminMisc::GetGroups($server,GROUP_TYPE_ALL,\@List);
print '<select name="groupes" size="1">';
map
{
if ( Win32::NetAdmin::GroupIsMember($server,$_,$nom) )
{
print '<option>';
print "$_\n";
}
}
@List;
print '</option>';
print '</select><p>';
############################################################################
#####################
Arthur Merar a icrit dans le message <3690116e.64423191@news.chaven.com>...
>
>
>Hello,
>
>I have two questions.
>
>If I have an HTML form that has a multiple selection list box, what
>type of code do I need to get all my selections? Currently I am only
>able to access the last selected option.
>
>This leads into another question. If I need to repost the form data,
>including the list box data as hidden fields, how would I do this?
>
>Please send replies to my e-mail.
>
>Thank you for your help.
>
>Arthur
>amerar@unsu.com
>
------------------------------
Date: Mon, 04 Jan 1999 00:35:46 -0800
From: TRG Software <chatmaster@c-zone.net>
Subject: Re: looking for perl programmer
Message-Id: <36907D62.DD53F1A3@c-zone.net>
Burt Adsit wrote:
>
> Sorry to burst your bubble but anyone who is an 'intermediate-expert' in
> perl doesn't need free hosting ($20/mo). They really don't need 'front
> page support'. 'possable money' would be a good thing. Expect to pay
> $50-$150/hr. Depends on how annoying you are.
>
> Parplex wrote:
> >
> > i am looking for an intermediate-expert perl programmer to do some programming
> > for my Co. in return you get 20 megs, cgi-bin, front page support, and much
> > more..possable money depending on how good. Email parplex@aol.com.
> > HURRY
>
> --
> Burt Adsit
> Earthenware
> http://www.featurefarm.com
> lat n43.10' lon w86.2'
I'm laughing my ass of here.. I emailed this guy, and told him I'd do
coding for him if he'll host my chat site I wrote in Perl (and I get a
ton of traffic!), because I need somewhere to host my site that won't
charge an arm and a leg.. Here's the email reply I got.. (This person
can't even spell!).
-- Reply below --
Hey Whats up my bos Refured u to me Hello Happy new Year I hope your
holidays
were great my holidays were great! okay im emailing u to tell u the
information u have requested!
Okay. u get unlimited Bandwith ( hits i.e Data Transfer)
and how long of a traid off as long as u can help us out when we need it
its
just a few scripts As long as we provide web hosting..
I dont know much about the hardware but its a unix server on the fast
connection to the net on a DSL ( faster then a t-3) line you will be
aloud
to
use 20 megs of web space if u need more (email Parplex@aol.com) see
what
my
bos can work out with u! u the server suports SSI SSL All Unix Cgi
scripts
you will get full accsess i dont know anything about the ram but it must
be
a
hell of a lot of it if its running as a web server -=) heh the server
suports
Microsoft Server Exts and youl be given your very own pop3 email account
The perl Compiler line is....
#!/usr/bin/perl
the server suports Perl 5!
The Send mail Prog for the server is....
/usr/sbin/sendmail
if thiar is something else u need to know please email me!
- Dan
www.parplex.com (main page)
www.parplex.com/bigsoft/ ( My page)
( i know my page has messed up Cgi-scripts i havnt had the time to fix
them
heh)
--- End Reply --
So I humor myself and email him back anyway and ask what they want done
specifically..
"Can you give me some info about the programs you need done or fixed, or
modified? What sort of programs, and what you're looking to do. Are you
looking to have programs created from scratch, or modified, or both?
And
what are they? More info please..."
And I get this -->
-- More crap --
Happy New Year!
Yes in fact i know one u can start working if ud like it is a Graphical
Counter made in perl that people can sign up for and it will so diff
counts
for every page and im not to sure how this next part is done but
somehow
it
must link back to our page say u had a web page with Geocities and u
wanted
a
nicer looking counter so thay came to us that request a counter and thay
put
it on thair page well we want it so when thay click on it it takes who
ever
clicked it back to our main page
The other scripts i my self arnt sure of but prob a meta tag Gen ( this
sould
be ez)
- Dan
www.parplex.com (main page)
www.parplex.com/bigsoft/ ( my web page)
-- End crap... --
Needless to say, it was worth a good laugh, but it was too ridiculous to
reply again.. :-)
--
Regards,
Tim Greer - chatmaster@c-zone.net
TRG Software and The Link Worm
http://www.linkworm.com
The Chat Base
http://www.chatbase.com
-----------------------------------------------------------------------
* Creator of Paradise Chat, Chat Central & Spiral Chat
* Receiving over 250,000+ hits a day from users Worldwide!!!
* Sales of custom chat server scripts * CGI/Perl scripting
* Script trouble shooting/security * Modify & debug scripts
* Freelance Perl Scripting for any purpose or application
Copyright ) 1998 TRG Software and The Link Worm.
------------------------------
Date: Mon, 04 Jan 1999 05:57:22 GMT
From: imchat@ionet.net
Subject: Re: Newbie: Search Engine
Message-Id: <3660d3ca.226382600@news.ionet.net>
If you're trying to use a Wintel machine get the Xitami web
server and ActiveState perl package. On your shebang line,ie;
#!/usr/bin/perl, just leave it that way or just put #! perl,. It works
either way. Xitami web server is a very good web server for Wintel.
Absolutely do NOT use IIS or PWS unless you like messing around with
your registry to get perl running.
Xitami can be downloaded from nonags.com and Just search on
keyword activestate to find the perl binaries.
On 29 Nov 1998 01:14:06 GMT, hp-katalog@t-online.de (Matthias Wiehl)
wrote:
>Hi all,
>
>I desperately need help with a search script written in perl. I want to
>use a script called "Search_Engine Script", available for download from
>http://www.extropia.com/, to make it possible for visitors to my site to
>search some of the files of my web site.
>
>How do I get this script installed? I thought it would be possible to
>run it on my local Win95 system, so I inserted the correct directories
>into the script files and a searching form into a temporary search.html
>file. But now, if I enter anything into the form, my browser just
>displays the script itself, not the results! If I run the perl compiler
>on the .pl files, (with Perl 5 correctly installed), nothing happens.
>
>What can I do to solve this problem? What file format do the script
>files have to be to run properly?
>
>I would like to test the script on my local system before looking for a
>free CGI hosting service. (My ISP doesn't provide me with CGI.)
>
>Or are there even better solutions than this script? Thanks in advance
>for your replies,
>
>Matthias
>--
>"Homepages bei T-Online" - http://home.t-online.de/home/hp-katalog/
>eMail: hp-katalog@t-online.de Feedback: Sebastian.Boehm@t-online.de
------------------------------
Date: Sun, 03 Jan 1999 23:19:50 -0800
From: TRG Software <chatmaster@c-zone.net>
Subject: Re: Perl Cookbook
Message-Id: <36906B96.AC450392@c-zone.net>
Jonathan Stowe wrote:
>
> On 2 Jan 1999 22:29:05 GMT Charles R. Thompson wrote:
> >
> > I used to be intimidated by the 'animal books' until I finally got serious
> > about Perl.. now they barely ever make it back to the shelf.
> >
>
> Hey, I dont even have a shelf for them, they're just creeping up the side
> of the chair and now I've got the 'sendmail' book back from the office
> they're threatening to take over the whole room.
>
> /J\
> --
> Jonathan Stowe <jns@btinternet.com>
> Some of your questions answered:
> <URL:http://www.btinternet.com/~gellyfish/resources/wwwfaq.htm>
> Hastings: <URL:http://www.newhoo.com/Regional/UK/England/East_Sussex/Hastings>
I've made myself a nice comfy bed out of all my ORA Perl books. :-) Why
bother to move..
--
Regards,
Tim Greer - chatmaster@c-zone.net
TRG Software and The Link Worm
http://www.linkworm.com
The Chat Base
http://www.chatbase.com
-----------------------------------------------------------------------
* Creator of Paradise Chat, Chat Central & Spiral Chat
* Receiving over 250,000+ hits a day from users Worldwide!!!
* Sales of custom chat server scripts * CGI/Perl scripting
* Script trouble shooting/security * Modify & debug scripts
* Freelance Perl Scripting for any purpose or application
Copyright ) 1998 TRG Software and The Link Worm.
------------------------------
Date: Thu, 31 Dec 1998 21:29:22 +0800
From: Chris <it@arms.com.sg>
Subject: Please help
Message-Id: <368B7C32.506F0CCB@singnet.com.sg>
Hi,
Would really appreciate if anyone could advise on how to convert perl
codes on an NT platform to Unix system. It appears that the perl
program on Unix could not recognize the CR commands. My Unix system is
RH 5.2
Is there a command to do this via the Unix prompt or do I have to insert
it in the code itself?
Thanks for the help.
Regards,
Chris
------------------------------
Date: Mon, 04 Jan 1999 07:02:21 GMT
From: ehpoole@ingress.com (Ethan H. Poole)
Subject: Re: Please help
Message-Id: <1IZj2.596$384.5718@news3.ispnews.com>
[Posted and Emailed] In article <368B7C32.506F0CCB@singnet.com.sg>,
it@arms.com.sg says...
>
>Hi,
>
>Would really appreciate if anyone could advise on how to convert perl
>codes on an NT platform to Unix system. It appears that the perl
>program on Unix could not recognize the CR commands. My Unix system is
>RH 5.2
>Is there a command to do this via the Unix prompt or do I have to insert
>it in the code itself?
>
>Thanks for the help.
We'll need a little more information to go on than what you've provided.
If it's the perl script that perl is having problems with, make sure you FTP
the script to the server as an ASCII file so that the end of line characters
are automatically converted from (CR/LF (DOS) to LF (UNIX)). You could also
convert plain ASCII data files in this manner as well.
If you are reading data files generated on a Windows machine and having
problems with EOL characters under Unix, here is what you need to know to
make your handler much more robust:
Operating System End Of Line Characters: (hex) ASCII
---------------- -----------------------------------------------------
UNIX \n (NewLine or Line Feed) 0x0A 10
NT \r\n (Carriage Return + Line Feed) 0x0D0A 13,10
MAC \r (Carriage Return) 0x0D 13
You could do the conversion with a very simple script that reads in the
contents of the file and does a simple REGEX substitute for the EOL
character:
Assuming the entire file was read into a string named $a:
$a=~s/\r|\n|\r\n/\n/g; # Note, including the first \n is redundant,
# but I like to include it for the sake of
# completeness.
Then write the new contents of $a to a converted filename.
--
Ethan H. Poole | Website Design and Hosting,
| CGI Programming (Perl & C)..
========Personal=========== | ============================
* ehpoole @ ingress . com * | --Interact2Day, Inc.--
| http://www.interact2day.com/
------------------------------
Date: 4 Jan 1999 06:04:16 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Retrospective on comp.lang.perl.moderated?
Message-Id: <76pll0$pop$1@news.NERO.NET>
In article <1dl2vkr.c8ror1jiygtbN@bay2-410.quincy.ziplink.net>,
Ronald J Kimball <rjk@linguist.dartmouth.edu> wrote:
>You're comparing apples and oranges. You were going to send the post
>anyway, otherwise you wouldn't have needed to register.
It may be apples and oranges, but I did not create the comparison. The
statement was that it was as difficult to post for the first time to
.moderated as to subscribe to a mailing list. Not "send mail to a
mailing list", just subscribe.
Even so, most mailing lists do not prevent non-subscribers from sending
mail, so "contributing" to a mailing list requires one piece of mail,
which is still easier than contributing to .moderated.
>So, it's no harder to contribute to clp.mod than it is to contribute to
>a mailing list,
#!/usr/local/bin/perl
$mail = .01;
$post = .01;
print "harder" if ($post+$mail) > $mail;
print "harder" if ($mail+$mail) > $mail;
This program will print "harder" for any non-zero, non-negative values
of $mail and $post you choose. This principle is taught, as I recall, as
part of basic number theory.
>and it's easier to start reading clp.mod than to start
>reading a mailing list.
This was not part of the claim.
------------------------------
Date: 4 Jan 1999 06:12:43 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Retrospective on comp.lang.perl.moderated?
Message-Id: <76pm4r$puf$1@news.NERO.NET>
In article <1dl2v19.omgwrwvyfv7iN@bay2-410.quincy.ziplink.net>,
Ronald J Kimball <rjk@linguist.dartmouth.edu> wrote:
>John Stanley <stanley@skyking.OCE.ORST.EDU> wrote:
>
>> In article <1dktfwl.1jx9aol1mzemdkN@bos-ip-1-101.ziplink.net>,
>> Ronald J Kimball <rjk@linguist.dartmouth.edu> wrote:
>> >Leslie Mikesell <les@MCS.COM> wrote:
>> >> >Well, I guess that's your problem. Registering for
>> >> >comp.lang.perl.moderated is no more difficult than signing up for an
>> >> >electronic mailing list.
>>
>> That is not true. Signing up for most mailing lists requires just one
>> piece of email. The first posting to .moderated requires posting a news
>> article AND sending email.
>
>That's because you only have to register if you actually want to post an
>article.
That is not true. The statement quoted above ("Registering for c.l.p.m
is no more difficult ...") is false whether or not you want to register.
The comparative difficulties of two acts does not depend on the
desirability of or necessity for either act.
>So there's no practical need for registering without posting
>an article. Duh!
Well, Duh. Who said there was?
>Whereas on a mailing list, you have to register even if you only want to
>read the list. Thus, registering for clp.mod is actually *easier* then
>signing up for a mailing-list.
Signing up for most lists takes one piece of mail. Registering for .mod
requires one posting and one mail. READING .mod requires neither, while
reading a mailing list sometimes requires one piece of mail. But then,
the statement under discussion is not reading, but registering.
>> >So that every poster will read the about the many resources available
>> >(documentation/FAQ, other appropriate newsgroups, etc.) *before* having
>> >a message posted to the newsgroup.
>>
>> This is an erronious argument. Forcing Leslie to prove that his email
>> address is valid once (which is all that the registration accomplishes)
>> does not force anyone else to read the FAQs. It did not force me to read
>> the FAQs or any other Perl documents, neither when Leslie was asked to
>> register, nor when I registered.
>
>Excuse me? I did not say that it forced anyone to read the FAQs. The
You said "So that every poster will read about the many resources...".
While you did not specify that you would force them to read the FAQs,
you did imply you were forcing them to read a faq about the FAQs. It is
still erronious to argue that forcing Leslie, someone who has already
posted to this group, and thus most likely received the faq about the
FAQs, will cause anyone else to read them.
"We must make YOU register so that every poster will read ..." is
falacious.
>Of course, we cannot force someone to read the FAQs, so I don't see why
>you're trying to build your argument around that.
You mistake my refutation of your argument as my creating a different
one. No, sorry. I'm just point out where yours is mistaken.
>> I guess the purpose for newsgroups has been lost.
>
>Why? Because you have to register to post? Waa waa!
Well, if it prevents people from using the group, yes. Your sound
effects are cute, but misplaced.
------------------------------
Date: Mon, 04 Jan 1999 05:02:40 GMT
From: imchat@ionet.net
Subject: Re: Rookie CGI problem
Message-Id: <36904af0.212180719@news.ionet.net>
Sun, 03 Jan 1999 15:08:40 -0800, mig@pwave.com (Miguel Fernandez)
wrote:
snip
@referers = ('pwave.com', 209.110.38.196);
You forgot to add the single quotes around your IP address.
@referers = ('pwave.com', '209.110.38.196');
------------------------------
Date: 4 Jan 1999 05:57:45 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Security & Permissions: Why can't Perl read files from the owner level?
Message-Id: <76pl8p$pjk$1@news.NERO.NET>
In article <7ecp67.7tp.ln@magna.metronet.com>,
Tad McClellan <tadmc@metronet.com> wrote:
>Charles R. Thompson (design@raincloud-studios.com) wrote:
>: So how in the heck does someone protect a directory from outside access when
>: Perl seems to require at least a 755 before it will read a file in it?
> ^^^^^^^^^^^^^^^^
>
> Perl doesn't require that. It just calls the OS. Operating
> Systems are responsible for managing files.
>
> The _OS_ is requiring that.
If your OS requires mode 755 on a file before you can read it, then
your OS is broken. Your OS should be requiring at least 400 for files
you own read by a process running under your uid, 040 for a file you
own being read by someone in your group, and 004 for a file you own
being read by anyone else except someone with superuser privileges.
That one bit is the least amount of privilege you need to allow a read.
Which one or more of those bits you need depends on your situation.
>: I guess my *real* question is how can Perl read a file I *want* set to
>: rw-r-r?
I guess the answer is "very well, thank you". A perl script will have
no problems reading any file with that set of permissions.
> A CGI program may not be able to though...
A "CGI program" is just a program, and if the file is user read, group
read, and other read, then there is no reason a CGI program cannot read
the file. Even if the program is being run under uid "nobody", that uid
is certainly one of the set (user|group|other).
Now, the original question dealt with a DB file being opened. While the
user may want to just read from a DB file, I am almost certain that the
generic open for such a file will try opening it read/write, since it
will be tied to a r/w variable.
> You don't have a Perl problem.
>
> You are asking in the wrong newsgroup.
"How do I get the DB open routines to open a file in read-only mode?" is
a perl question. Whether it is answered in any of the documentation is a
different issue.
------------------------------
Date: 4 Jan 1999 06:55:28 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Security & Permissions: Why can't Perl read files from the owner level?
Message-Id: <76pol0$o60$1@client3.news.psi.net>
Charles R. Thompson (design@raincloud-studios.com) wrote on MCMLI
September MCMXCIII in <URL:news:76p05t$13h@bgtnsc01.worldnet.att.net>:
++ So how in the heck does someone protect a directory from outside access when
++ Perl seems to require at least a 755 before it will read a file in it?
You're wrong.
Witness:
$ mkdir Foo
$ echo bar > Foo/foo
$ chmod 400 Foo/foo
$ chmod 100 Foo
$ ls -ld Foo
d--x------ 2 abigail staff 177 Jan 4 01:50 Foo
$ ls -l Foo/foo
-r-------- 1 abigail staff 4 Jan 4 01:50 Foo/foo
$ perl -pwe '' Foo/foo
bar
$
File permissions are a OS thing. Get a basic introduction book about
your OS and read it.
HTH. HAND.
Abigail
------------------------------
Date: 4 Jan 1999 06:57:59 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: Sorting a hash
Message-Id: <76popn$o60$2@client3.news.psi.net>
Benjamin Curtis (bgcurtis@surfree.com) wrote on MCMLII September MCMXCIII
in <URL:news:36901738.B3C7C6C@surfree.com>:
++
++ Is there a way to sort a hash by the values?
No. But you are able to sort the values.
RTFFAQ.
Abigail
------------------------------
Date: 4 Jan 1999 05:44:28 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: strange behavior of $~
Message-Id: <76pkfs$pcp$1@news.NERO.NET>
In article <3690AA84.DC2690B6@mail.nevalink.ru>,
Mike <blazer@mail.nevalink.ru> wrote:
>Is there any reason that these variables have such a strange behavior? I
If you read the perl documentation, you will find that the $punctuation
variables have special meaning.
------------------------------
Date: Sun, 03 Jan 1999 23:35:10 -0800
From: TRG Software <chatmaster@c-zone.net>
Subject: Re: Syntax error in subroutine: help please
Message-Id: <36906F2E.A5DB4D43@c-zone.net>
Dave Martina wrote:
>
> NEWBIE QUESTION!
>
> OK, I've been through this a dozen times but I can't find the syntax error
> even though PERL reports one. I've typed it in exactly as it is shown in
> the
> O'Reilly book.
>
> The error I get when I try to execute is:
>
> ++++++++++++++++++++++++++++++++++
> Syntax error at <path> line 39 near "rename"
> Execution aborted due to compilation errors
> ++++++++++++++++++++++++++++++++++
>
> TIA to anyone who can help me find the error
>
> The code is attached:
>
> sub init_words {
> while (defined ($filename = glob("*.sec")) ) {
> open (WORDSLIST,$filename) ||
> die "Can't open $filename: $!";
> if (-M WORDSLIST <= 7.0) {# comply with policy for 7 days aging
> while (defined ($name = <WORDSLIST>)) {
> chomp ($name);
> $word = <WORDSLIST>;
> chomp ($word);
> $words{$name}=$word;
> }
> close (WORDSLIST) ||
> die "coouldn't close $filename: $!";
> }
> else {
> # must close file before renaming it
> close (WORDSLIST) ||
> die "can't close $filename.old: $!"
^^^
Oops.. forgot that semicolon...
> rename ($filename, "$filename.old") ||
> die "can't rename $filename: $!";
> }
> }
> }
--
Regards,
Tim Greer - chatmaster@c-zone.net
TRG Software and The Link Worm
http://www.linkworm.com
The Chat Base
http://www.chatbase.com
-----------------------------------------------------------------------
* Creator of Paradise Chat, Chat Central & Spiral Chat
* Receiving over 250,000+ hits a day from users Worldwide!!!
* Sales of custom chat server scripts * CGI/Perl scripting
* Script trouble shooting/security * Modify & debug scripts
* Freelance Perl Scripting for any purpose or application
Copyright ) 1998 TRG Software and The Link Worm.
------------------------------
Date: Mon, 04 Jan 1999 00:19:16 -0800
From: TRG Software <chatmaster@c-zone.net>
Subject: Re: Thanks! and happy new year!
Message-Id: <36907984.3FD4DAB0@c-zone.net>
"Andrew M. Langmead" wrote:
>
> TRG Software <chatmaster@c-zone.net> writes:
>
> >Are you sure you have the right NG!? :-)
>
> I hope not, despite common complaints about certain people being
> unhelpful, or about everyone being unhelpful, many people (including
> myself) try to find questions that we might have answers to. We find
> documentation that might be useful to the poster. We try to give
> helpfule advice. We write (and test) example scripts. Basically, make
> some sort of effort to help people over their current stumbling block.
>
> Is that being helpful? I hope so. (I can't be sure, since over the
> years I get fewer and fewer "thank you" messages e-mailed to me. Maybe
> my posts aren't reaching anyone? Maybe my ISP isn't really sending out
> all the messages I write. Maybe I'm getting ripped off, assuming
> they're sending stuff that they really aren't.)
>
> If what I'm doing isn't helpful to anyone, let me know and I'll find
> better things to do with my time.
>
> --
> Andrew Langmead
I hope you're joking! I've been following the Perl NG's for years, and
there are about 15 people that I will ALWAYS click on their posts to
learn something, or see other good ways to do it, and _you_ are one of
them! I was joking with that post when I said that (I thought that was
obvious?). Sure, there's a lot of flaming going on sometimes, but I find
humor in them, more then insult.. Then again, I've never really been
flamed.. Yourself, Tom Christiansen, Randal Schwartz, Tad McClellan,
Bart Lateur, Ilya Zakharevich, Abigail, Clay Irving, Tom Phoenix, Brian
D Foy, Jonathan Stowe, Mike Guy, Mark-Jason Dominus, Uri Guttman, and
_many_ more have always helped and posted wise and helpful posts to
people, and I've learned very cool things from a lot of them! If you
guys weren't around in the NG, then I wouldn't bother to come here! I'd
like to personally thank all of the people (including you!) personally
for the advice and help offered. Even though I've never personally
posted a question here, I do learn from you guys, and I *know* I won't
be mislead from bad advice or ideas. We all contribute our time in this
NG to helping people, and you've done a lot.. No joke here, don't sell
yourself short. I appreciate wheat you do, even if the person asking the
question doesn't thank you.. people like me watching are always
thankful, so then, -thank you all! I for one am aware of how much you
contribute, and there are many others I'm sure!!
have a great New Year!
--
Regards,
Tim Greer - chatmaster@c-zone.net
TRG Software and The Link Worm
http://www.linkworm.com
The Chat Base
http://www.chatbase.com
-----------------------------------------------------------------------
* Creator of Paradise Chat, Chat Central & Spiral Chat
* Receiving over 250,000+ hits a day from users Worldwide!!!
* Sales of custom chat server scripts * CGI/Perl scripting
* Script trouble shooting/security * Modify & debug scripts
* Freelance Perl Scripting for any purpose or application
Copyright ) 1998 TRG Software and The Link Worm.
------------------------------
Date: Mon, 04 Jan 1999 03:11:33 -0500
From: Eric B <aj2000@sympatico.ca>
Subject: Re: tutorial websites
Message-Id: <369077B5.DED10728@sympatico.ca>
Hello
Can someone tell me if the oreilly courses give you any credibility when trying
to find a job.. do you get a certificate or something when you finish the
course?
Also how does it compare in value to a community college or university degree?
Thanks
Eric B
Robert Gwynne wrote:
> Try http://www.digitaled.com/preview/oreilly/home.html
>
> Bob Gwynne
>
> <uunews@hotmail.com> wrote in message
> news:76dint$si9$1@nnrp1.dejanews.com...
> >Hi Folks,
> > I am looking for useful websites and mail servers on PERL. Any help is
> >appreciated.
> >
> >Sincerely,
> >Ali
> >
> >-----------== Posted via Deja News, The Discussion Network ==----------
> >http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Sun, 03 Jan 1999 22:46:21 -0800
From: Jennifer Stone <admin@oneseek.com>
Subject: Using Filter Module to Protect Source Code
Message-Id: <369063BD.5F3B@oneseek.com>
Hello,
I have been researching a way to protect the Perl source for a
commercial application we are working on and have seen a great deal of
discussion of the Filter module written by Paul Marquess. I also read
Paul's recent article in the Perl Journal.
My question is whether it is possible to acheive any reasonable level of
protection if the decryption routine is written in Perl (ie. the Perl
Source Filter Paul talks about in his article).
It seems to me that if the decryption code is written in Perl and
shipped with our application, then it would be trivial for anyone to use
that code to decrypt our source code. Am I missing something?
I understand that writing the filter in C and linking it to the Perl
executable provides a higher level of security, but that seems to give
up the portability advantage of Perl.
Ideally, we would like to create a limited "evaluation" version of our
application which allows customers to try it before buying. Obviously,
that won't work very well if it is simple to remove the limitations from
the source code.
If anyone is aware of any real-world examples which use your module, it
would be very helpful to us to look at them.
Again, I'm sorry if I am being stupid. I just don't understand how
shipping a decryption algorithm which itself has visible source code can
provide any security at all....
Thank you for your time!
Jennifer Stone
------------------------------
Date: 04 Jan 1999 02:47:03 -0500
From: Matt Curtin <cmcurtin@interhack.net>
Subject: Re: Using Filter Module to Protect Source Code
Message-Id: <xlx4sq7pjig.fsf@gold.cis.ohio-state.edu>
Jennifer Stone <admin@oneseek.com> writes:
> My question is whether it is possible to acheive any reasonable level of
> protection if the decryption routine is written in Perl (ie. the Perl
> Source Filter Paul talks about in his article).
I used to work for a company that thought it was a good idea to hide
the source code to its product, which was written in Perl.
I personally don't buy into the idea of trying to hide source code.
The Open Source software movement has been getting some real
attention, and I think that the idea of not giving source code with
software products will be quiet antiquated in the not so distant
future.
No matter what you do, someone who wants it can reverse engineer your
code.
See http://www.opensource.org/ for some information on why including
your source code makes sense, from a techie's perspective, from that
of a business-type, and also from the customer's standpoint. And be
sure to check the case studies.
That probably isn't the answer you wanted, but at any rate, I hope it
will provide some ThoughtFood and be helpful.
--
Matt Curtin cmcurtin@interhack.net http://www.interhack.net/people/cmcurtin/
------------------------------
Date: Mon, 04 Jan 1999 02:01:36 -0500
From: Eric B <aj2000@sympatico.ca>
Subject: where are perl distribution pages found?
Message-Id: <36906750.CBC7162F@sympatico.ca>
Hi Tad and Newsgroup
How are you? Tad T saw your post in the perl.misc newsgroup and was wondering
if you could help a newbie like me out...
I am about to learn perl... i just bough a book and i weighs a ton :-)
In your post you said:
> " Books are a good third line of enquiry when you are wondering how
> to get something done in Perl.
>
> First would be the several hundred "pages" of documentation that
> are included with the perl distribution
> itself. "
Can you clarify this a little more for me... i am a newbie and not too sure what
you mean by "perl distribution"
Where can I get these pages and or the "dstribution"
Thanks in advance for you time and help
Sincerely
Eric B
>
>
>
------------------------------
Date: 12 Dec 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 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 4541
**************************************