[6975] in Perl-Users-Digest
Perl-Users Digest, Issue: 600 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jun 11 19:17:17 1997
Date: Wed, 11 Jun 97 16:00:25 -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 Wed, 11 Jun 1997 Volume: 8 Number: 600
Today's topics:
Re: [HELP] Perl on WindowsNT 4.0 Problem... (Jeremy D. Zawodny)
Re: [Q]. Replacing a carriage return <rootbeer@teleport.com>
Better way to split long strings into equal length part (Kjetil Skotheim)
bug :-) in perlfaq9 manual (Kyzer)
Re: C type macros? (Ken Fox)
converting mode from stat into ls style mode string (Sylvain Robitaille)
converting mode from stat into ls style mode string (Sylvain Robitaille)
Re: crypt/decrypt in perl <sibsib@hotmail.com>
Dereferencing an associative array (Harold J. Fennell)
Re: Help! perl -d under OpenWindows (Jot Powers)
How to call TELNET from within a script? (Huge Cajones Remailer)
Re: Magical Auto-increment operator <robp@electriciti.com>
Re: Mail using Perl <rootbeer@teleport.com>
Re: multiple white spaces <sibsib@hotmail.com>
Need a list of all subdirectories (but no files) <sdcote@lci.net>
Re: Need help with Perl command (Tad McClellan)
Newbie:To PUSH or not to PUSH? (P.M.Wong )
Re: Newbie:To PUSH or not to PUSH? (Tad McClellan)
Non-blocking UDP socket reads on Win 95??? (Mike Cunningham)
Re: Perl Compiler & Modules (Malcolm Beattie)
Re: Perl interface for PGP (Arnoud "Galactus" Engelfriet)
Re: perl joke of the day ? <sibsib@hotmail.com>
Re: perl joke of the day ? (Steffen Beyer)
Re: perl joke of the day ? (Ilya Zakharevich)
Perl Script <lde@mail.soc.soton.ac.uk>
Re: Perl Script (I R A Aggie)
Re: Problems with SETUID scripts running vi Apache w/ L <rasmusin@wpi.wpi.edu>
Re: Problems with SETUID scripts running vi Apache w/ L <rootbeer@teleport.com>
Re: Sample Simple Server from Camel book <psrc@corp.airmedia.com>
Re: Save HTML code in server side???? <rootbeer@teleport.com>
Re: Slow load-time in Perl - does 5.004 fix? <rootbeer@teleport.com>
WANTED: Win32/SQL/ODBC Contract Programmer <jnschmidt@aplica.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 11 Jun 1997 10:37:54 GMT
From: jzawodn@wcnet.org (Jeremy D. Zawodny)
Subject: Re: [HELP] Perl on WindowsNT 4.0 Problem...
Message-Id: <339e7fac.286910625@news.bgsu.edu>
On Wed, 11 Jun 1997 04:57:31 GMT, jbkim@cnt.co.kr (1h@g:@) wrote:
>Message: CGI output from C:/WebSite/cgi-shl/test3.pl contained no
>blank line separating
>header and data
>
>Please contact the server administrator at jbkim@cnt.co.kr and inform
>them of the time the error occured, plus
>anything you know of that may have caused the error.
>----------------------------------------------------------------------
>
>What mistake I have?
(1) This is a CGI question, so it doesn't belong in this newsgroup.
(2) It's a FAQ anyway, so you've obviously not done your homework.
(3) You gave us very little helpful information.
What's the error log say?
Jeremy
---
Jeremy D. Zawodny
WCNet Technical Geek & Web Stuff
<URL:http://www.wcnet.org/~jzawodn/>
"You are what you think."
------------------------------
Date: Wed, 11 Jun 1997 13:05:54 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: "John L. Stein" <stein@seas.ucla.edu>
Subject: Re: [Q]. Replacing a carriage return
Message-Id: <Pine.GSO.3.96.970611130302.5767A-100000@kelly.teleport.com>
On 11 Jun 1997, John L. Stein wrote:
> Isn't \cr the carriage return.
Nooooooo! That would be evil! :-) You're thinking of "\r", I'm sure.
> Also you might need \< and \>.
I hope not!
> Try
>
> $form_data{$message} =~ s/\\cr/\<BR\>/g;
Good advice. Did you take it yourself? :-)
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 11 Jun 1997 18:16:26 GMT
From: kjetil.skotheim@usit.uio.no (Kjetil Skotheim)
Subject: Better way to split long strings into equal length parts?
Message-Id: <5nmq1q$fdh$1@ratatosk.uio.no>
What is the fastest and/or most elegant way to split a long
string into equal length parts into a list.
I could do:
while($longstr){
push(@list,substr($longstr,0,$partlength);
substr($longstr,0,$partlength)='';
}
But I suspect faster methods exists? (With unpack?)
--
ks
------------------------------
Date: 11 Jun 1997 08:35:45 GMT
From: junkmail@sysa.abdn.ac.uk (Kyzer)
Subject: bug :-) in perlfaq9 manual
Message-Id: <5nlo11$qf5@info.abdn.ac.uk>
>From the lips of Jeff Stampes sprang:
: Gosh.,..this sounds almost like the FAQ "My CGI script runs from
: the command line but not the browser. Can you help me fix it?"
Talking of that, is there a bug in the perl manual?
The quote is:
--------
My CGI script runs from the command line but not the
browser. Can you help me fix it?
Sure, but you probably can't afford our contracting rates :-
)
--------
Now look at that, it's broken onto 2 lines! Shouldn't smileys be indivisable?
--
Stuart 'Kyzer' Caie - Kyzer/CSG |undergraduate of Aberdeen University |100%
http://www.abdn.ac.uk/~u13sac |My opinions aren't those of Aberdeen |Amiga -
kyzer@4u.net kyzer@hotmail.com |University or AUCC, thankfully.***** |always!
--
Random sig of the day:
DC.W f+++ s+++ df h++++ Csilv a+ $+++ m d--- WL++ Fr---- Bslobber
------------------------------
Date: 11 Jun 1997 21:38:12 GMT
From: fox@pt0204.pto.ford.com (Ken Fox)
Subject: Re: C type macros?
Message-Id: <5nn5s4$o1g10@eccws1.dearborn.ford.com>
ez041407@bullwinkle.ucdavis.edu (Eric Finley) writes:
> Is there a perl equivalent to a C macro. I find that I use some
> expressions very frequently. My favorite seems to be /(\s+)?\n/ to
> check for empty lines.
You could try using "perl -P" and write your macros in cpp. cpp is
quite possibly the worst macro processor ever invented though, so
I'd just go ahead and define the is_empty() subroutine and forget
about macros.
This code works for me using "perl -P":
#define IS_EMPTY(X) (X) =~ /^\n$/
my $a = "\n";
my $b = "not empty\n";
print "a is empty\n" if (IS_EMPTY($a));
print "b is empty\n" if (IS_EMPTY($b));
By the way, why do you use /(\s+)?\n/ to check for empty lines? Doesn't
chomp $line; if ($line eq "") { ... }
work much better?
- Ken
--
Ken Fox (kfox@ford.com) | My opinions or statements do
| not represent those of, nor are
Ford Motor Company, Powertrain | endorsed by, Ford Motor Company.
Analytical Powertrain Methods Department |
Software Development Section | "Is this some sort of trick
| question or what?" -- Calvin
------------------------------
Date: 11 Jun 1997 21:27:42 GMT
From: sp_robi@sinclair.concordia.ca (Sylvain Robitaille)
Subject: converting mode from stat into ls style mode string
Message-Id: <slrn5pu61e.2ue.sp_robi@sinclair.concordia.ca>
I hope someone can help me here. I've read many web pages, scanned
deja-news, and dug through the camel book, (2nd edition), and still
haven't found what I need. I've downloaded some sample scripts, some
public scripts, some free scripts, and some script fragments, all to no
avail...
I'm trying to write a routine which will take the mode of a file, as
returned by stat, and convert it into the ls style -rwxr-xr-x, (for
example), string.
If anybody's already done this, or knows how I could do it, I'd really
appreciate it if you would post the solution.
Thank you.
--
----------------------------------------------------------------------
Sylvain Robitaille sp_robi@alcor.concordia.ca
Assistant to the System Manager
Computing Services Department
Concordia University Montreal, Quebec, Canada
----------------------------------------------------------------------
------------------------------
Date: 11 Jun 1997 21:29:54 GMT
From: sp_robi@sinclair.concordia.ca (Sylvain Robitaille)
Subject: converting mode from stat into ls style mode string
Message-Id: <slrn5pu660.2ue.sp_robi@sinclair.concordia.ca>
I hope someone can help me here. I've read many web pages, scanned
deja-news, and dug through the camel book, (2nd edition), and still
haven't found what I need. I've downloaded some sample scripts, some
public scripts, some free scripts, and some script fragments, all to no
avail...
I'm trying to write a routine which will take the mode of a file, as
returned by stat, and convert it into the ls style -rwxr-xr-x, (for
example), string.
If anybody's already done this, or knows how I could do it, I'd really
appreciate it if you would post the solution.
Thank you.
--
----------------------------------------------------------------------
Sylvain Robitaille sp_robi@alcor.concordia.ca
Assistant to the System Manager
Computing Services Department
Concordia University Montreal, Quebec, Canada
----------------------------------------------------------------------
------------------------------
Date: Wed, 11 Jun 1997 16:05:19 -0400
From: Scott Blanksteen <sibsib@hotmail.com>
Subject: Re: crypt/decrypt in perl
Message-Id: <339F04FF.297CBEF7@hotmail.com>
Dennis Kowalski wrote:
> I am doing development in a WINDOWS95/NT environment.
Sorry to hear that :-)
> Does anyone know how to encrypt and decrypt data in perl in this
> environment (not UNIX).
Encrypt - try the built-in crypt function. (Actually, I don't
if it works in 5.001; it works on 5.003_07 on my W95 pc at home).
Decrypt - take a trip to Fort Meade...
Scott
--
Scott I. Blanksteen
sib (at) worldnet (dot) att (dot) net
------------------------------
Date: Wed, 11 Jun 97 20:56:36 GMT
From: harold@spectra.net (Harold J. Fennell)
Subject: Dereferencing an associative array
Message-Id: <5nn3f9$1ph@ns2.spectra.net>
Hello. Thank you for the time to read this post.
I am trying to make a program for myself that will keep track of some
information that I have accumulated over the years. I decided to use the perl
DBM routines and thought I would break the routines into particular functions
for me to use.
I am passing a routine and associative array with the \%assoc_array.
My problem is that I don't fully understand how to dereference this so that I
can use it in my routine to tie a DBM to it using the tie command. I also
need to have it, once tied to the associative array usable within the calling
routine without passing the vaiable again.
Is this the right way to do it, and is there a faster way, and how do I
dereference an associative array.
Thank you for your help in the matter.
Harold
-------------------------------------------------------------------------------------
- Harold J. Fennell Phone: 607-693-3304 -
- Advanced Research Labs Fax: 607-693-4250 -
- P.O. Box 56 E-mail: harold@spectra.net-
- Nineveh, NY 13813 -
- Internet Consultant -
-------------------------------------------------------------------------------------
------------------------------
Date: 11 Jun 1997 21:09:03 GMT
From: jot@tmp.medtronic.com (Jot Powers)
Subject: Re: Help! perl -d under OpenWindows
Message-Id: <5nn45f$su6$1@gazette.corp.medtronic.com>
In article <5nn14r$p2d$1@spock.asic.sc.ti.com>, mshaw@Jasic.Usc.Nti.Kcom (Mark Shaw) writes:
>Anyone run into this problem?
Nope. :)
[*snip*]
node127% perl -V
Summary of my perl5 (5.0 patchlevel 4 subversion 0) configuration:
Platform:
osname=solaris, osvers=2.5.1, archname=sun4-solaris
uname='sunos node127 5.5.1 generic sun4u sparc sunw,ultra-1 '
hint=recommended, useposix=true, d_sigaction=define
bincompat3=y useperlio= d_sfio=
...
node127% cat test.pl
#!/usr/local/bin/perl -d
my ($fred,$bob) = (1,99);
if ($fred) {
print "bob = $bob\n";
print "fred = $fred\n";
}
node127% perl -de 1
Loading DB routines from perl5db.pl version 1
Emacs support available.
Enter h or `h h' for help.
main::(-e:1): 1
DB<1> q
>Note that this does NOT occur if I start the script in an xterm --
>everything works fine -- but I really don't want to have to go to an
>xterm anytime I need to use the debugger!
I had to fire up a command tool to check. I'd hate to have to go
into one regularly. ;)
>Any ideas? Thanks in advance....
However, I'm guessing there might be something else going on with
your program? Have you reproduced this with say the following:
perl -de 'print "Hello world\n"'
or the equivalent if you think having the -d on the shebang line matters.
Install 5.004, and if that doesn't work, install Solaris 2.5.1. :)
(Or 2.6, but I don't have that so I can't confirm it would work)
-Jot
--
Jot Powers jot@tmp.medtronic.com
Unix System Administrator, Medtronic Micro-Rel
"Subtlety is the art of saying what you think and getting out of the way
before it is understood."
------------------------------
Date: Wed, 11 Jun 1997 05:32:01 -0700
From: nobody@huge.cajones.com (Huge Cajones Remailer)
Subject: How to call TELNET from within a script?
Message-Id: <199706111232.FAA08065@fat.doobie.com>
Can someone show me (or tell me where to look to find out) how to
start an interactive telnet session from within a script? I.e. is
there anyway for a Perl script to call and hand over control to
telnet? FWIW, I'm working in Unix.
Thanks! :)
Kathy
no e-mail, please--post replies
------------------------------
Date: Wed, 11 Jun 1997 11:39:25 -0700
From: Rob Perelman <robp@electriciti.com>
Subject: Re: Magical Auto-increment operator
Message-Id: <Pine.SUN.3.91.970611112222.28883H-100000-100000@circuit>
On Thu, 29 May 1997, Tom Phoenix wrote:
> To my mind, the big problem is that somebody may have a string reading "12
> cats" which they want to treat numerically. If they increment the number
> of cats, they don't want to have "12 catt". (Lest this seem unlikely,
> remember that Perl is often parsing crufty output from other programs.
> There's no telling what trailing junk might be out there.) So, right away,
> I don't see how we can allow anything like that to be incremented.
This is a very valid point. I would argue that it SHOULD be "12 catt"
because any moron sending in "12 cats" to be autoincremented deserves to
get bad output in my opinion. :) But take "cats 12" as an example.
Perl says that should be 1 when autoincremented. What use is that? I
say it should be cats 13.
> > My original problematic string, 'cs2#09', fails the ++ operation. I
> > want it to come back as 'cs2#10'. I personally think this is highly
> > logical.
>
> Well, just because something is logical, that doesn't necessarily mean
> it's a good idea. :-) But what would you get from incrementing that string
> a few more times. I think it would eventually count up to 'cs2#99'. At
> this point, logic fails me; should it become 'cs3#00' or 'cs3#0' or
> 'cs3#100'? I could make a good case for any two of them. :-) Can you give
> a simple rule for what should be done, and can you give a convincing
> argument that it's more useful than the alternatives?
All of your examples are possible cases. I am choosing which makes the
most sense for my condition. The function as it stands now does not
insert or delete characters in the middle of the string, only at the
leftmost side. That's why I stayed with the same logic of making
'cs2#99' autoincrement to 'cs3#00'. If you won't budge on the '12 cats'
(which I actually don't expect you to), will you budge on the 'cs2#01'?
If you really want '3/9' to increase to 4 because it leads with a number,
I can accept that. So my new proposal is as follows:
1. If the argument has already been used as a number,
increment it as a number.
2. If the argument begins with a number ('7', '3/9', '1a9z')
increment it as a number (to 8, 4, and 2).
3. Otherwise, increment it as a string.
(using my extended rules for extending a string)
This would allow '.' to get autoincremented to '..' instead of 1, '..e1'
to '..e2', 'cs2#09' to 'cs2#10', 'a1z9' to 'a2a0' and 'cats 12' to 'cats
13'. Now please don't say anyone is relying on 'cats 12'++ coming out as 1.
Let me know what you think.
--------------------------------------------------------------------------
Rob Perelman robp@eciti.com http://www.eciti.com/robp/
San Diego Rocks sdrocks@eciti.com http://www.eciti.com/sdrocks/
Alphabet Records alphabet@punketc.com http://www.punketc.com/alphabet/
--------------------------------------------------------------------------
------------------------------
Date: Wed, 11 Jun 1997 13:18:38 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Mark Hagler <mhagler@cse.unl.edu>
Subject: Re: Mail using Perl
Message-Id: <Pine.GSO.3.96.970611130720.5767B-100000@kelly.teleport.com>
On Wed, 11 Jun 1997, Mark Hagler wrote:
> I am working on a website ,
Perl doesn't know or care about websites, and consequently neither do I.
:-) As far as we're concerned, you're just moving some bits around.
> What I want to know is that how can we send mail to a particular address
You can use a Mail module to do that, or you can pipe to sendmail.
Modules are on CPAN. Hope this helps!
http://www.perl.org/CPAN/
http://www.perl.com/CPAN/
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 11 Jun 1997 16:11:15 -0400
From: Scott Blanksteen <sibsib@hotmail.com>
Subject: Re: multiple white spaces
Message-Id: <339F0663.766C379A@hotmail.com>
Tri Duy Tram wrote:
>
> I am wondering how do you change multiple white spaces to just one single
> white space? Lets suppose I have a string
To change multiple white space chars into one space char (' '):
s/\s+/ /g;
Scott
--
Scott I. Blanksteen
sib (at) worldnet (dot) att (dot) net
------------------------------
Date: Wed, 11 Jun 1997 09:32:54 -0400
From: "Stephan D. Cote" <sdcote@lci.net>
Subject: Need a list of all subdirectories (but no files)
Message-Id: <339EA905.AEC21D05@lci.net>
Does anyone have a simple way to get a listing of all the sub
directories under a given directory with a PERL script without listing
all the files?
I was going to use the File::Find module, but all I know how to do is
get a listing of all the fully qualified file names:
/data/text/file1.txt
/data/text/file2.txt
/data/text/file3.txt
/data/text/file4.txt
/data/html/file1.html
/data/html/file2.html
/data/html/projecta/file1.html
/data/html/projecta/file2.html
/data/html/projectb/file1.html
/data/html/projectb/file2.html
I could have hundreds of files within the directory structure and I want
to process the files within those directories in a manner that differs
for each directory. In short, what I want is:
/data/text/
/data/html/
/data/html/projecta/
/data/html/projectb/
Any suggestions?
--
---[Stephan D. Cote, CCP]------[ Sr. Network Engineer ]---
Data Engineering, LCI International Inc.
4650 Lakehurst Court, Dublin, OH 43016
---[ (614) 798-6000 ]-------------------------------------
------------------------------
Date: Wed, 11 Jun 1997 14:47:13 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Need help with Perl command
Message-Id: <1cvmn5.ij8.ln@localhost>
Douglas M. Croft (dcroft@zoo.uvm.edu) wrote:
: Does anyone know how the Perl commands for:
: Reckognizing whether a string exists in a file with a bunch of strings
: (one on top of another)?
Huh?
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: 11 Jun 1997 12:24:36 GMT
From: s11976@ctsc.hkbc.hk (P.M.Wong )
Subject: Newbie:To PUSH or not to PUSH?
Message-Id: <5nm5e4$8q6$1@power42t.hkbu.edu.hk>
Being a newbie in perl, i often seen scripts that read the whole file
into an array, so that further manipulation of the file can be done.
There are mainly 2 ways of doing so:
1. open (FILE, $filespec);
@LINES=<FILE>;
... etc
2. open (FILE, $filespec);
while (<FILE>) {
push(@lines, $_);
}
I have some questions:
a) For both methods, is there any limit on the size of the file that
it won't break down, i.e. will all the lines in the FILE be read into
the array @LINES , for most files ? If not, what are the max. size of FILE
for these to work ok?
b) If a) has limits, then which method 1) ir 2) is better, i.e. which
could accomodate a larger file ?
c) generally speaking, which method is preferable, 1 or 2
, i.e. under what circumstances do we use 1 and 2 ?
--
__
/ \_/ ) __ Pui Ming WONG (E-mail: pm@hkbu.edu.hk)
/ ( ------------- } System Support Programmer,
( =l=ll===============__} Computing & Telecomm. Services Centre
\ _ ( Hong Kong Baptist University
\_/ \__) 224 Waterloo Road, Hong Kong
------------------------------
Date: Wed, 11 Jun 1997 14:34:03 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Newbie:To PUSH or not to PUSH?
Message-Id: <bjumn5.oi8.ln@localhost>
P.M.Wong (s11976@ctsc.hkbc.hk) wrote:
: Being a newbie in perl, i often seen scripts that read the whole file
: into an array, so that further manipulation of the file can be done.
: There are mainly 2 ways of doing so:
: 1. open (FILE, $filespec);
: @LINES=<FILE>;
: .... etc
: 2. open (FILE, $filespec);
: while (<FILE>) {
: push(@lines, $_);
: }
: I have some questions:
: a) For both methods, is there any limit on the size of the file that
: it won't break down, i.e. will all the lines in the FILE be read into
: the array @LINES , for most files ? If not, what are the max. size of FILE
: for these to work ok?
It is limited by the amount of (virtual) memory available, not by perl.
: b) If a) has limits, then which method 1) ir 2) is better, i.e. which
: could accomodate a larger file ?
No difference, storage-wise.
: c) generally speaking, which method is preferable, 1 or 2
: , i.e. under what circumstances do we use 1 and 2 ?
Whichever is more clear to you (or to whomever will get stuck with trying
to figure it out after not seeing it for a few weeks/months) ;-)
I usually go with #1, using #2 only when there are some lines to
be excluded from the array ( I stick a test statement before the push() ).
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: Wed, 11 Jun 1997 11:56:40 -0700
From: mikec@metricom.com (Mike Cunningham)
Subject: Non-blocking UDP socket reads on Win 95???
Message-Id: <MPG.e0894c0a64aec8989680@news>
I'm having a problem with either PERL or Win95. I have a simple routine
that sends a UDP datagram and reads a reply.
The problem is that after many hundreds of successful reads, I see the
reply come back on a network analyzer but the program hangs waiting for
the reply. How do I do a non-blocking read?
Thanks,
Mike Cunningham
Metricom, Inc.
---------------------------------------------------------------
The read is being done by:
sub getsockbuff{
my ($readline, @allines);
while ($readline = <SOCK>) {
push @allines, $readline;
if ($readline =~ /OK/) {
last;
}
}
return @allines;
} # end getsockbuff -----------------------
The socket setup is as follows:
sub setup {
# pack dest address into "struct sockaddr" form
$sockaddr_fmt = 'S n a4 x8'; # set sockaddr pack format
<snip, snip, snip>
socket(SOCK, PF_INET, SOCK_DGRAM, $proto) or die "socket failed: $!";
bind(SOCK, $thispackdaddr) or die "bind failed: $!";
return $destpackdaddr;
} # end setup ----------------------
------------------------------
Date: 11 Jun 1997 12:37:53 GMT
From: mbeattie@sable.ox.ac.uk (Malcolm Beattie)
Subject: Re: Perl Compiler & Modules
Message-Id: <5nm671$i22@news.ox.ac.uk>
In article <865991361.11269@dejanews.com>, <psyclone@twd.net> wrote:
> I've checked all the FAQ's and such,
But obviously not the file called README that comes with the kit.
> and I can't seem to find out how to
>include "non-standard" modules in the perl compiler. I've got a few
>scripts written using modules from CPAN, they seem to compile fine,
>but when executed, they respond with
>"Can't call method xxx in module xxx".
Read the part of the README which begins
If your program uses classes which define methods...
--Malcolm
--
Malcolm Beattie <mbeattie@sable.ox.ac.uk>
Oxford University Computing Services
"Widget. It's got a widget. A lovely widget. A widget it has got." --Jack Dee
------------------------------
Date: Wed, 11 Jun 1997 19:03:15 +0200
From: galactus@stack.nl (Arnoud "Galactus" Engelfriet)
Subject: Re: Perl interface for PGP
Message-Id: <Tptnz4uYOhjK089yn@stack.nl>
-----BEGIN PGP SIGNED MESSAGE-----
In article <5njsns$gea@vidar.diku.dk>,
brother@diku.dk (Peter Makholm) wrote:
> But docinfo contains nothing but the clear text. I need to indentify
> the sender from a posting, either by having his key in a keyring or by
> having his name in a special list.
Why do you need the sender's name or address for *signing* messages
posting to a newsgroup? Surely you as the moderator are doing the
signing?
The PGPmoose package is used quite often by moderators who want to
do this kind of thing; you may want to look into that.
- --
To find out more about PGP, send mail with HELP PGP in the SUBJECT line to me.
NEW ADDRESS: --> galactus@stack.nl <-- Please PGP encrypt your mail.
Finger galactus@turtle.stack.nl for public key (key ID 0x416A1A35).
Anonymity and privacy site: http://www.stack.nl/~galactus/remailers/
-----BEGIN PGP SIGNATURE-----
Version: 2.6.3i
Charset: noconv
iQCVAgUBM573wTyeOyxBaho1AQFHfAQA2Vx7jL+YSaKjydVoos8u00iBwmdMiY36
j1qHbD4RS8PS4AM26FUBtaSGmP+TvkY/6uIoNQ4COsradTmaf+ptGitl9MiGLFiw
zCyW9NvSXJO0+ZXZs2/bE8R+4I2lu2v6jcfcf6n9FxVG3rUo1hWwC5jqV8Qrx1Tz
hx7Cl7UxnPU=
=FSCt
-----END PGP SIGNATURE-----
------------------------------
Date: Wed, 11 Jun 1997 16:15:57 -0400
From: Scott Blanksteen <sibsib@hotmail.com>
Subject: Re: perl joke of the day ?
Message-Id: <339F077D.B0D40748@hotmail.com>
Rick Klement wrote:
> I saw this line in a perl script today...
>
> if ( length($aString) gt 0 )
Come on, the author was obviously trying to avoid "anti-strings"
with length < 0, due to the drastic results when they come into
contact with regualr strings...
Scott
:-) for the humor-impaired
--
Scott I. Blanksteen
sib (at) worldnet (dot) att (dot) net
------------------------------
Date: 11 Jun 1997 07:24:05 GMT
From: sb@en.muc.de (Steffen Beyer)
Subject: Re: perl joke of the day ?
Message-Id: <5nljql$nbg$1@en1.engelschall.com>
Rick Klement <rick@rick.infoserv.com> wrote:
> I saw this line in a perl script today...
> if ( length($aString) gt 0 )
Maybe, and just for fun of course, we should add another Perl
programming contest to the pool; we already have the "obfuscated
Perl" programming contest, why not a "how many errors can you
put into a single line of Perl code" contest? >;-)
Although the contest itself would not be a serious affair, this
proposal is!!
Proposed scheme for evaluating submitted entries:
Turn it into a reasonable line of code and count the number of steps
needed to turn it into the submitted piece of code:
I.e.,
if ( length($aString) )
if ( length($aString) > 0 )
if ( length($aString) gt 0 )
(Also counting unnecessary steps or weird although working constructs
as errors)
What do you think? >;-)
Yours,
--
Steffen Beyer <sb@sdm.de> http://www.engelschall.com/u/sb/
"There is enough for the need of everyone in this world,
but not for the greed of everyone." - Mahatma Gandhi
>> Unsolicited commercial email goes directly to /dev/null <<
------------------------------
Date: 11 Jun 1997 21:02:15 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: perl joke of the day ?
Message-Id: <5nn3on$hru$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Scott Blanksteen
<sibsib@hotmail.com>],
who wrote in article <339F077D.B0D40748@hotmail.com>:
> Rick Klement wrote:
> > I saw this line in a perl script today...
> >
> > if ( length($aString) gt 0 )
>
> Come on, the author was obviously trying to avoid "anti-strings"
> with length < 0, due to the drastic results when they come into
> contact with regualr strings...
>
> Scott
>
> :-) for the humor-impaired
No, there is nothing of humourous nature here, it is easy to produce a
string with a length == -1 in Perl (unless you applied jumbo regexp
patches). Look on DejaNews for the examples.
Since the test -1 gt 0 is false, the above code may protect around
this bug. ;-)
Ilya
------------------------------
Date: 9 Jun 97 09:27:44 GMT
From: "Leigh Evans" <lde@mail.soc.soton.ac.uk>
Subject: Perl Script
Message-Id: <01bc74b7$840fdac0$24caa68b@beerdom.soc.soton.ac.uk>
I am trying to write a PERL script but I have not had any experience with
the language before. Can anyone recommend a good site to look at or to get
info at??
Cheers,
Leigh
------------------------------
Date: Wed, 11 Jun 1997 16:50:23 -0500
From: fl_aggie@hotmail.com (I R A Aggie)
Subject: Re: Perl Script
Message-Id: <fl_aggie-ya02408000R1106971650230001@news.fsu.edu>
In article <01bc74b7$840fdac0$24caa68b@beerdom.soc.soton.ac.uk>, "Leigh
Evans" <Leigh Evans <lde@mail.soc.soton.ac.uk>> wrote:
+ I am trying to write a PERL script but I have not had any experience with
+ the language before. Can anyone recommend a good site to look at or to get
+ info at??
Your local man pages come to mind, presuming you have perl already. If
not, then take a look at <url:http://www.perl.com/perl/>.
James
--
Consulting Minister for Consultants, DNRC
Support the anti-Spam amendment <url:http://www.cauce.org/>
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>
------------------------------
Date: 11 Jun 1997 12:42:06 -0400
From: Frank Sweetser <rasmusin@wpi.wpi.edu>
Subject: Re: Problems with SETUID scripts running vi Apache w/ Linux
Message-Id: <wvywwo1jdlt.fsf@wpi.WPI.EDU>
Andy N <andy@netadv.co.uk> writes:
>
> I have been writing a set of Web-pages which communicate with some Perl
> (5.004) scripts in our Apache server's /cgi-bin. What they are
> _supposed_ to do is provide a simple interface for adding/removing users
> and editing user details, ie, messing about with /etc/passwd.
>
> The problem is that they do not seem to have permission to make the
> necessary changes when run from the web-page, although they are
> perfectly happy if I run them from the command line. I have chmod
> 6755'd them, which as I understand it should ensure that the scripts run
> as root, but they clearly aren't when our web-server has finished with
> them..
by default, the setuid bits on scripts are ignored by the linux kernel, as
they can be a major security hole. You've got three options:
1) either write a c-based wrapper that calls your scripts
2) re-write the scripts in C or some other compiled language
3) get the patch from www.linuxhq.com under unoficial 2.0 patches to
re-enable the setuid bits on scripts
--
Windows: I can play Doom! |RedHat Linux 2.0.30 i486
Linux: I can be a file server, be a Web |Because reboots are for upgrades!
server, run the accounting package with |mail to rasmusin@wpi.edu
twelve terminals AND play Doom! |for pgp key. frank sweetser
------------------------------
Date: Wed, 11 Jun 1997 13:54:11 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Andy N <andy@netadv.co.uk>
Subject: Re: Problems with SETUID scripts running vi Apache w/ Linux
Message-Id: <Pine.GSO.3.96.970611134708.5767F-100000@kelly.teleport.com>
On Wed, 11 Jun 1997, Andy N wrote:
> I have been writing a set of Web-pages which communicate with some Perl
> (5.004) scripts in our Apache server's /cgi-bin. What they are
> _supposed_ to do is provide a simple interface for adding/removing users
> and editing user details, ie, messing about with /etc/passwd.
Oooh, I hope you wrote them with security issues in mind! :-)
> The problem is that they do not seem to have permission to make the
> necessary changes when run from the web-page, although they are
> perfectly happy if I run them from the command line. I have chmod
> 6755'd them, which as I understand it should ensure that the scripts run
> as root, but they clearly aren't when our web-server has finished with
> them..
I think that you mean that a non-root user can run them from the command
line, and they successfully run as root, right? Then the problem is
(almost certainly) that your 'nobody' uid is number -1 and Linux uses the
uid of -1 to mean "no change" in the system call to swap uids. That means
that Perl can't let the nobody user run setuid scripts like you want.
One solution is to make the webserver run as user -2, instead of -1.
Hope this helps!
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 11 Jun 1997 11:45:10 -0400
From: Paul S R Chisholm <psrc@corp.airmedia.com>
To: sigi@remsmurr.de
Subject: Re: Sample Simple Server from Camel book
Message-Id: <339EC806.2473@corp.airmedia.com>
Sigi wrote:
> This works for a few times ... then the server hangs.
The sample server in the Blue Camel book has a bug in the way it waits
for its children. Pick up the fix from the errata:
http://www.perl.com/perl/critiques/camelrata/
> Excuse my bad english.
It's 'way better than my German!
--
Paul S. R. Chisholm, AirMedia, Inc. (formerly Ex Machina)
mailto:psrc@corp.airmedia.com http://www.corp.airmedia.com/~psrc
I'm not speaking for the company, I'm just speaking my mind
------------------------------
Date: Wed, 11 Jun 1997 11:30:19 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Spin <spin@cyberlab.nl>
Subject: Re: Save HTML code in server side????
Message-Id: <Pine.GSO.3.96.970611112905.18839I-100000@kelly.teleport.com>
On Wed, 11 Jun 1997, Spin wrote:
> Recently I use SQL server to write some scripts making HTML pages with
> database data, and everything is OK. Now I want to save the HTML hard
> code in server side by clients, but I can't write a script by SQL
> server. Can anybody tell me that Perl-CGI can do this job or not.
Yes, you can do this in Perl. Hope this helps!
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 11 Jun 1997 11:28:35 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Ronald Klimaszewski <microsys@IntNet.net>
Subject: Re: Slow load-time in Perl - does 5.004 fix?
Message-Id: <Pine.GSO.3.96.970611112730.18839H-100000@kelly.teleport.com>
On Tue, 10 Jun 1997, Ronald Klimaszewski wrote:
> because perl is being called from a menu program, it takes 2-3 seconds
> before anything appears on the screen. This is quite a bit of time for
> impatient users to sit around wondering whats happening.
Ouch! Why don't you write the menu program directly in Perl? That would be
much faster. Hope this helps!
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 11 Jun 1997 21:15:23 GMT
From: "J. Nicholas Schmidt" <jnschmidt@aplica.com>
Subject: WANTED: Win32/SQL/ODBC Contract Programmer
Message-Id: <01bc76ac$72fbd350$d086b3cc@notebook200>
Do you program the Win32 API in Microsoft Visual C++?
Do you have working knowledge of SQL, ODBC, and the CGI protocol?
Then you should apply for this contract assignment!
The Project:
- Continue development of an existing Web-based shopping cart system
- Currently only dynamic HTML, possibly add Java user interface elements
- Work from home on your own equipment
- Paid by the hour as an independent contractor (1099 or corporate)
- Time estimate: 3 - 6 months for this project
- Future projects based on this one are coming up
Required:
- Strong C++ OOP skills
- CGI experience (C or PERL)
- SQL & ODBC experience
Pluses:
- A proven track record in programming Web-based shopping cart apps (URLs
if on the public Internet)
- ISAPI experience
- Java, RMI, JDBC experience
- WinSock experience
- Windows NT 4.0 and Internet Information Server 3.0 experience
- Windows NT 4.0/IIS 3 equipment at your location
- The possibility to meet a couple of times face-to-face in the San
Francisco Bay Area. Otherwise, your location does not matter.
Email resume (including your hourly rate) today to:
jnschmidt@aplica.com
or fax in the USA:
415-326-9977
Hurry, only one assignment available!
J. Nicholas Schmidt
Aplica Communications
706 Colorado Ave
Palo Alto, CA 94303
------------------------------
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 600
*************************************