[7113] in Perl-Users-Digest
Perl-Users Digest, Issue: 738 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jul 16 16:39:11 1997
Date: Wed, 16 Jul 97 13:00:31 -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, 16 Jul 1997 Volume: 8 Number: 738
Today's topics:
Re: 64K limit on matches <rootbeer@teleport.com>
Re: bizarre regexp behaviour with split <rootbeer@teleport.com>
calling awk from perl (David Clapperton)
Can I send a fax through cgi? <chris@cybertech.com.sg>
Re: co-routines in Perl (Chris Schleicher)
date conversion (from-to seconds) <marc@crmtraining.com>
en francais <dantin@icp.grenet.fr>
gethostbyaddr <wn@vttz.at>
Re: Global Vars : Why would I want to use "use strict" (Jeff Stampes)
Re: help - need recursive chown() for big restore. <che@imsa.edu>
Help with C/Perl CGI app <acobb@ius.indiana.edu>
Re: How to redirect STDERR to make it the same as STDOU (A. Deckers)
Re: Implmenting flock <steven@angst-inc.com>
Is anyone using Net::Telnet? (Phil Freed)
Linux perl install misses Library <blizzard@interact.canoe.ca>
Re: Newbie Problem - IE/Netscape differences (Matthew D. Healy)
Re: online tutorial (Bob)
Re: perl V. HTML?? (Eric Bohlman)
Re: Perl Editors (Paul D. Smith)
Re: Perl Editors (Scott McMahan)
problem with perl cgi script (benjamin j snyder)
Re: regex: grouping problem (A. Deckers)
Re: script to change header / footer for large site <rootbeer@teleport.com>
Re: Three questions about Selena Sol's Database Manager (Bruce Spedding)
Re: use OR require (suite) (Andrew M. Langmead)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 15 Jul 1997 21:08:31 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: George Apostol <apostol@lsil.com>
Subject: Re: 64K limit on matches
Message-Id: <Pine.GSO.3.96.970715204207.5131f-100000@kelly.teleport.com>
On Tue, 15 Jul 1997, George Apostol wrote:
> Camel 2nd edition, page 63 indicates that character matches are "limited
> to integral values less than 65,536."
Not my copy. :-) Mine says that the values of n and m in numeric RE
quantifiers such as {n,m} are limited to integral values less than 65,536.
But it doesn't say anything about limiting other quantifiers. (And I think
this is irrelevant to your situation.)
> ($key,$value) = $statement =~ /\s*(\S+)\s*(.*?);/;
> If the $value field is greater than 64k characters, this program HANGS!
> and never returns. <== BAD BEHAVIOR
No, I don't think that's what it does. This works on my system, at least.
$statement = ("this is a test " x 10000) . ";" ;
($key,$value) = $statement =~ /\s*(\S+)\s*(.*?);/;
$kl = length $key; $vl = length $value;
print "Lengths are $kl and $vl\n";
But let's imagine that you have a string which doesn't match. For example,
replace that first line with this one.
$statement = ("this is a test " x 10000) . "\n;" ;
Now the expression can't match, since there isn't anything that can match
.* before a semicolon. That's easy for us to see, but the RE engine isn't
that smart. It's having to try combination after combination in a vain
attempt to match, a process that will possibly take years to complete.
(Really! You can get more information about these "neverending" matches
in Jeffrey Friedl's book "Mastering Regular Expressions".)
So, howsabout finding out how to give you what you want? I think this code
might do it. (Then again, it might not. :-)
$pos = index($statement, ';') ; # Find the semi
die "No semicolon in statement" unless $pos > -1
($key, $value) = substr($statement, 0, $pos-1) =~ /(\S+)\s+(.*)/;
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: Tue, 15 Jul 1997 11:58:17 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: web@calarts.edu
Subject: Re: bizarre regexp behaviour with split
Message-Id: <Pine.GSO.3.96.970715115416.7560E-100000@kelly.teleport.com>
On Tue, 15 Jul 1997 web@calarts.edu wrote:
> #Can anyone explain to me why
>
> split /\Q$delimiter\E/;
>
> #and
>
> split /(\Q$delimiter\E)/;
>
> #behave differently?
Parens in the split expression trigger "delimiter retention mode":
Whatever is captured in the parens is returned as another item. This is
documented in the entry for split in perlfunc. You can avoid this behavior
by using non-capturing parens (?: ... ) wherever you need parens (which,
of course, you don't in this example). 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: 15 Jul 1997 18:11:03 GMT
From: davidc@westminster.ac.uk (David Clapperton)
Subject: calling awk from perl
Message-Id: <5qgefn$q94@badger.wmin.ac.uk>
The following system is made from a perl script:-
system("ypcat passwd | awk -F: '{print $1}' > filename");
However what happens is that the awk call is ignored and the
"ypcat passwd" command is output to the file. Is there a
reason for this? The full path for the awk command has been
specified but this makes no difference.
Thanks
David Clapperton, Systems Programmer, University of Westminster, London, UK
E-mail: davidc@westminster.ac.uk
------------------------------
Date: Wed, 16 Jul 1997 16:51:11 +0800
From: Christopher Chan <chris@cybertech.com.sg>
Subject: Can I send a fax through cgi?
Message-Id: <33CC8B7F.952@cybertech.com.sg>
Is it possible??
--
Christopher Chan
------------------------------
Date: 16 Jul 1997 11:28:09 -0700
From: chrissch@cs.uoregon.edu (Chris Schleicher)
Subject: Re: co-routines in Perl
Message-Id: <5qj3rp$l0h@psychotix.cs.uoregon.edu>
In article <w4olo3eu6ry.fsf@deneb.cs.rose-hulman.edu>,
Matthew X Economou <econommx@rose-hulman.edu> wrote:
>But can you do co-routines in Perl?
Not easily. This stems from the fact that perl doesn't really have
continuations. You could, however, implement something like the
classic samefringe problem using CPS style and perl's closures.
Hope this helps,
--Chris
--
Chris Schleicher Office: 541/346-3998
Univ of Oregon CIS GTF email: chrissch@cs.uoregon.edu
URL: http://www.cs.uoregon.edu/~chrissch/
------------------------------
Date: Tue, 15 Jul 1997 11:34:54 -0700
From: Marc Belcourt <marc@crmtraining.com>
Subject: date conversion (from-to seconds)
Message-Id: <33CBC2CE.2B5D@crmtraining.com>
hello all,
Is there a perl library that will convert seconds sinc Jan. 1, 1970 to a
date format. And visa-versa.
Please e-mail me
Thank You
Marc Belcourt
marc@crmtraining.com
------------------------------
Date: Tue, 15 Jul 1997 15:32:02 +0200
From: Joelle D'Antin & Nicolas Gregoire <dantin@icp.grenet.fr>
Subject: en francais
Message-Id: <33CB7BD2.31A7@icp.grenet.fr>
Desole de poster en francais,
mais je savais pas comment dire en anglais;
Voila notre probleme :
on cherche les operateurs qui permettent de faire une division entiere,
et celui pour obtenir le reste.
Je sais pas si j'ai ete tres clair:
ex:7%3=2 division entiere
7&3=1 reste
Merci.
------------------------------
Date: Wed, 16 Jul 1997 16:34:27 +0200
From: Natalie Wojtech <wn@vttz.at>
Subject: gethostbyaddr
Message-Id: <33CCDBF3.B@vttz.at>
gethostbyaddr works very slow for unresolved users (passes the NULL
string after 1.5 minutes). Does anyone know any way to avoid this very
long waiting period. Thanks for your help.
et
------------------------------
Date: 15 Jul 1997 20:01:19 GMT
From: stampes@xilinx.com (Jeff Stampes)
Subject: Re: Global Vars : Why would I want to use "use strict"
Message-Id: <5qgkuf$7qa$2@neocad.com>
mashfiel (ashfield.matthew@miti.nb.ca) wrote:
: use strict;
: From what I understand this enforces me to declare all my variables with
: my()
Sort of...it does requre you scope all your variables. They could be
my(), local(), or you can prefix them $package::variable.
: them. So if I use the 'use strict;' command, which forces me to declare all
: my variables with 'my()' then I can't use global variables right??
Nope...see 'use vars':
use strict;
use vars qw($foo %hash @an_array);
: If this
: is correct, then I guess I'll have to read the passing by reference section
: about 5 more times! Anyway, any discussion/advice would be appreciated!
A good idea anyway...you CAN use globals, but you could also pass
references...it's a matter of how often the data changes, how
often and where in the flow it is accessed.
HTH
--
Jeff Stampes -- Xilinx, Inc. -- Boulder, CO -- jeff.stampes@xilinx.com
------------------------------
Date: 15 Jul 1997 10:57:16 -0500
From: Ben Gertzfield <che@imsa.edu>
Subject: Re: help - need recursive chown() for big restore.
Message-Id: <y8sg1tgmhpf.fsf@imsa.edu>
>>>>> "Fil" == Fil Krohnengold <fil@amnh.org> writes:
Fil> Hello, all.
Fil> I'm a little sysadmin with a big problem. I lost one of my
Fil> disks very early this morning and have had to do my first
Fil> ever restore of an entire user partition. First time in 3
Fil> yeras. So anyway, I need to come up with some way to restore
Fil> the owner and group permissions to the user directories.
Fil> Somewhere around 3am I came up with this:
(snip)
You'll want to use the File::Find module. Run a perldoc File::Find for
more information on this.
I recently wrote a script to do this very thing -- it chowned
directories and files recursively.
But it ran into a big problem -- the chown system call on my platform,
Solaris, follows symbolic links -- so any user who had a symlink to,
say, /bin/sh, now owned that file. Not very cool.
Anyway, just make sure that your chown syscall (man 2 chown) does what
you want, and use File::Find. That should work just dandy.
--
Brought to you by the letters P and W and the number 19.
"Ohhhh, Mentos Boy!" -- Guppy
Ben Gertzfield <http://www.imsa.edu/~wilwonka/> Finger me for my public
PGP key. I'm on FurryMUCK as Che, and EFNet and YiffNet IRC as Che_Fox.
------------------------------
Date: Tue, 15 Jul 1997 15:17:59 -0300
From: Andy Cobb <acobb@ius.indiana.edu>
Subject: Help with C/Perl CGI app
Message-Id: <33CBBED7.2318@ius.indiana.edu>
Hi,
I'm trying to call a perl script from a C program using the 'system()'
command in C. The perl script will execute from the C program works
with a normal environment but when I use the CGI app, the perl script
doesn't print.
Any ideas?
Andy C.
------------------------------
Date: 16 Jul 1997 18:31:27 GMT
From: deckers@man.ac.uk (A. Deckers)
Subject: Re: How to redirect STDERR to make it the same as STDOUT ?
Message-Id: <slrn5sq4rr.rje.deckers@news.rediris.es>
In <5qj10h$130i$1@mercury.cc.uottawa.ca>,
Jean-Francois Delannoy <delannoy@csi.uottawa.ca> wrote:
>
>Is there a way to have error messages go to the screen
>in all cases?
>
>My problem is: I use Perl over a CGI server via Netscape.
>If there is a syntax error, all I get is "File contains no data".
>There's no indication of the location and type of the error.
Last time I looked at it, you could do:
use CGI::Carp qw(fatalsToBrowser);
Try perldoc CGI/Carp.pm for more information about redirecting errors
from CGI scripts.
HTH,
Alain
--
Perl information: <URL:http://www.perl.com/perl/>
Perl archive: <URL:http://www.perl.com/CPAN/>
Perl FAQ: <URL:http://www.perl.com/CPAN/doc/FAQs/FAQ/>
>>>>>>>>>>>>> NB: comp.lang.perl.misc is NOT a CGI group <<<<<<<<<<<<<<
------------------------------
Date: Tue, 15 Jul 1997 17:16:43 -0400
From: Steven Robert Bates <steven@angst-inc.com>
Subject: Re: Implmenting flock
Message-Id: <33CBE8BB.3F131C44@angst-inc.com>
Tom Phoenix wrote:
> On 14 Jul 1997, Joseph Davidson wrote:
>
> > I have Perl 5.000 on SunOS 5.4 Generic_101945-13. It does not
> support the
> > flock function. Do I need a later version of Perl, a re-build or
> what to
> > support flock?
>
> If you're using 5.000, you should install 5.004. That will solve your
> flock problem, as well as many other shortcomings of 5.000. Literally
> hundreds of bugs have been fixed since that version came out. Hope
> this
> helps!
>
You could also use the Fcntl module bundle with perl5 it works fine on
Solaris 2.x.
------------------------------
Date: Wed, 16 Jul 1997 13:27:50 GMT
From: phil@freed.com (Phil Freed)
Subject: Is anyone using Net::Telnet?
Message-Id: <33ccca48.355015@newshost.cybertours.com>
Is anyone out there using Net::Telnet with Perl 5.003? I've had some
odd experiences with it, and I'd really like to know whether it's
something peculiar to my installation. (This is a repost; an earlier
posting to clp.modules got no response.)
I've installed Net::Telnet v3.00 under both Solaris 2.4 and 2.5.1, but
I couldn't use it as shipped.
The principal problem was that the module strips the first line
returned after issuing a telnet command. Apparently, this assumes
that the first line of the response will contain an echo of the
command; this was not the case on any system that I use. I added what
I consider to be a kludge which only strips the line if it matches the
initial command. It's not well-tested -- but it seems to work in my
environment. A better answer might be a -echo or -duplex switch.
The other two problems were relatively minor. The default prompt (in
both the code and documentation) is '/[$%#>] $/' , but I had to
insert a backslash before that first dollar sign to get it to work
(that is, '/[\$%#>] $/' ).
In addition, the code generally recognizes either 'login' or
'username' prompts for the automated login code. But in one place,
only 'login' is recognized....
Below are my patches. Any comments?
Thanks for your time.
# diff -p Telnet_0.pm Telnet.pm
*** Telnet_0.pm Sun Jun 8 09:15:39 1997
--- Telnet.pm Thu Jun 12 23:50:41 1997
*************** sub new {
*** 44,50 ****
bin_mode => '',
blksize => $Default_blksize,
buf => '',
! cmd_prompt => '/[$%#>] $/',
eofile => 1,
errormode => 'die',
errormsg => '',
--- 44,51 ----
bin_mode => '',
blksize => $Default_blksize,
buf => '',
! ## cmd_prompt => '/[$%#>] $/', ## ptf
! cmd_prompt => '/[\$%#>] $/', ## ptf
eofile => 1,
errormode => 'die',
errormsg => '',
*************** sub cmd {
*** 300,306 ****
}
## Get rid of echo back command.
! shift @$output;
unless (@$output) {
@$output = ('');
}
--- 301,308 ----
}
## Get rid of echo back command.
! ## shift @$output; ##ptf
! shift @$output if $$output[0] and $$output[0] =~ $cmd[
scalar(@cmd) - 1];
##ptf
unless (@$output) {
@$output = ('');
}
*************** sub login {
*** 844,849 ****
--- 846,852 ----
## Wait for command prompt or another login prompt.
($prematch, $match) = $self->waitfor(-match => $cmd_prompt,
+ -match => '/username[:
]*$/i', ##ptf
-match => '/login[: ]*$/i')
or return &$error("login timed-out waiting for command
prompt");
--phil <phil@freed.com>
------------------------------
Date: Wed, 16 Jul 1997 10:41:54 -0400
From: Dave Blizzard <blizzard@interact.canoe.ca>
Subject: Linux perl install misses Library
Message-Id: <33CCDDB2.76E7D4B2@interact.canoe.ca>
While trying to build perl5.003 on my office Linux box, the make fails
cause it can't find the dl.so library (I think) even though the library
is there and in the path. I have found a more recent library from my
home machine which does build ok there but it still won't work on my
office machine.
The particulars are below. Any help would be greatly appreciated.
The error during make is:
rm -f libperl.a
ar rcu libperl.a perl.o gv.o toke.o perly.o op.o regcomp.o dump.o
util.o mg.o hv.o av.o run.o pp_hot.o sv.o pp.o scope.o pp_ctl.o pp_sys.o
doop.o doio.o regexec.o taint.o deb.o globals.o
cc -L/usr/local/lib -o miniperl miniperlmain.o libperl.a -lgdbm -ldb
-ldl -lm -lc
/usr/i486-linux/bin/ld: cannot open -ldl: No such file or directory
make: *** [miniperl] Error 1
Here's the /lib dir
root@pike:/lib# ls
X11 libcurses.so.0.1.2 libm.so.5
cpp libcurses.so.1 libm.so.5.0.6
gnumalloc.so libcurses.so.1.0.0 libncurses.so
ld-linux.so.1 libdl.so.1 libncurses.so.1.9
ld-linux.so.1.7.14 libdl.so.1.7.14 libncurses.so.1.9.9e
ld.so libdl.so.1.8.2 libncurses.so.2.1
lib.old.tar libe2p.so.2 libncurses.so.3
libc.so.4 libe2p.so.2.1 libncurses.so.3.0
libc.so.4.7.6 libext2fs.so.2 libss.so.2
libc.so.5 libext2fs.so.2.0 libss.so.2.0
libc.so.5.3.12 libgdbm.so.1 libtermcap.so.2
libcom_err.so.2 libgdbm.so.1.7.3 libtermcap.so.2.0.8
libcom_err.so.2.0 libm.so.4 modules
libcurses.so.0 libm.so.4.6.27
here's the myconfig output:
Summary of my perl5 (5.0 patchlevel 3 subversion 0) configuration:
Platform:
osname=linux, osver=2.0.29, archname=i586-linux
uname='linux pike 2.0.29 #1 mon mar 3 19:18:32 est 1997 i586 '
hint=recommended, useposix=true, d_sigaction=define
Compiler:
cc='cc', optimize='-O2', gccversion=2.7.2
cppflags='-Dbool=char -DHAS_BOOL -I/usr/local/include'
ccflags ='-Dbool=char -DHAS_BOOL -I/usr/local/include'
stdchar='char', d_stdstdio=undef, usevfork=false
voidflags=15, castflags=0, d_casti32=define, d_castneg=define
intsize=4, alignbytes=4, usemymalloc=n, randbits=31
Linker and Libraries:
ld='ld', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lgdbm -ldb -ldl -lm -lc
libc=/lib/libc.so.5.3.12, so=so
Dynamic Linking:
dlsrc=dl_none.xs, dlext=none, d_dlsymun=undef, ccdlflags=''
cccdlflags='', lddlflags=''
------------------------------------------
Dave Blizzard
blizzard@canoe.ca www.canoe.ca
-----------------------------------------
------------------------------
Date: Wed, 16 Jul 1997 15:45:50 -0500
From: Matthew.Healy@yale.edu (Matthew D. Healy)
Subject: Re: Newbie Problem - IE/Netscape differences
Message-Id: <Matthew.Healy-1607971545500001@pudding.med.yale.edu>
In article <33CA2305.81FF4686@osk0.attnet.or.jp>, Robert Stewart
<robert@osk0.attnet.or.jp> wrote:
>
> Does anyone have a suggestion why this form behaves differently under
> the 2 browsers.
>
Not without some sample code we don't. And with a CGI script, probably
it does not matter what is in the script, what matters are the HTTP
headers and HTML or whatever body that it emits.
--------
Matthew.Healy@yale.edu http://ycmi.med.yale.edu/~healy/
As of 09 Jul 1997, only 905 days until Y2K....
Any person with a phone line can become a town crier with a voice
that resonates farther than it could from any soapbox.
--The US Supreme Court, overturning the Communications Decency Act
------------------------------
Date: Tue, 15 Jul 1997 18:24:58 GMT
From: xxbbell@voicenet.com (Bob)
Subject: Re: online tutorial
Message-Id: <33ccc047.74360938@netnews.voicenet.com>
danew@enterprise.net (Matthew Burnham) wrote:
>print '#' . join("\n#", @lines); is one of many ways.
Another way, which I think they are looking for, is to set $"
= '#' and then print "@lines";
--
- Bob
http://www.voicenet.com/~bbell
xxbbell@voicenet.com
remove x's to reply
------------------------------
Date: Wed, 16 Jul 1997 05:07:51 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: perl V. HTML??
Message-Id: <ebohlmanEDEBL3.3CE@netcom.com>
Fan Ng (FANNGMAIL@prodigy.net) wrote:
: Can HTML do everything perl does??
: Like Image or song or video??
HTML is a language for marking up the structure of documents. Perl is a
general-purpose programming language. As such, the two aren't
comparable. Your question is equivalent to "can a fireplace do
everything a toolbox can?" HTH
------------------------------
Date: 16 Jul 1997 13:15:34 -0400
From: psmith@baynetworks.com (Paul D. Smith)
Subject: Re: Perl Editors
Message-Id: <p5pvsihqa1.fsf@baynetworks.com>
%% psf@gwi.net (Paul Faulstich) writes:
pf> also, Visual SlickEdit (Win95 & most UNIX flavors) does a nice job
pf> and has a GUI.
%% mupe@desk.nl (M. muPe) writes:
mm> Besides the famous unix editors, there are some GUI editors which
mm> are easy to start with and support color; ted,nedit , xcoral
Definitely don't want to start an editor war, but I'd be interested in
how you definite "GUI", such that Emacs and XEmacs don't qualify.
Both Emacsen have scroll bars, menu bars, popup menus, multiple frames,
mouse cursor placement, mouse selection, pasting, etc. You can even
start different frames from the same editor on different hosts.
About the only GUI thing they don't have is drag-n-drop, but none of the
other editors above do either (that I'm aware of).
What about these other editors makes them "GUI" editors? Maybe it's
worth adding to Emacs, too :).
--
-------------------------------------------------------------------------------
Paul D. Smith <psmith@baynetworks.com> Network Management Development
"Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
These are my opinions--Bay Networks takes no responsibility for them.
------------------------------
Date: 16 Jul 1997 11:53:55 GMT
From: scott@lighthouse.softbase.com (Scott McMahan)
Subject: Re: Perl Editors
Message-Id: <5qicoj$iks$4@mainsrv.main.nc.us>
M. muPe (mupe@desk.nl) wrote:
: Besides the famous unix editors, there are some GUI editors which are
: easy to start with and support color; ted,nedit , xcoral
The argument for vi and emacs is they're available everywhere.
Learning one of them means you can use just about any machine
on the planet.
These also-ran editors suffer from not being available. If you
learn them and have to log onto a machine without them,
you're going to be in bad shape. A few months spent
learning emacs pays off big for your survival and adaptability.
Scott
------------------------------
Date: 16 Jul 1997 11:26:36 -0400
From: bens@sioux.cis.ohio-state.edu (benjamin j snyder)
Subject: problem with perl cgi script
Message-Id: <5qip7cINN1kr@sioux.cis.ohio-state.edu>
I am writing a cgi script in perl that is supposed to create three web pages
from input it receives from the web browser. When I run the script from the
command line it appears to hang as if stuck in an infinte loop. When I use the
browser to run the script I get a message that the files couldnt be opened (a
check I put in the script myself), but this message is not displayed when ran
from the script.
To open the files I am using the foolowing command:
open (CHECK, "> [path and file name to be opened])
I am doing the check I mentioned earlier at this point with the following type
of line:
if (!(open (CHECK, "> [filename]"))) {
### display error message
exit(1);
}
with three different files and three different filehandles. Shouldn't open
with the '>' operator erase any data already in the file and replace it with
the data I tell it to output? Nothing is heppening with the files. I put some
data in them simply to see if this was heppening and nothing happened to the
data already in the files.
To print to the files I am using the standard:
print CHECK "blah blah blah";
Is there a command that I might be using that is redirecting the output to
somewhere else?
I have checked permissions and the files are all groups readable, writable, and
executable. I didnt bother with world writability since the page with the cgi
script is being opened as a file.
Here's some info about the system I am using:
OS HP-UX 9.05
Perl Perl 4 (maybe 4,2...cannot find the info on our system)
Any info you could give would be much appreciated.
--
Ben Snyder
IICF Consultant Supervisor
Computer and Information Science
The Ohio State University Office phone: (614) 292-1153
------------------------------
Date: 16 Jul 1997 15:14:17 GMT
From: deckers@man.ac.uk (A. Deckers)
Subject: Re: regex: grouping problem
Message-Id: <slrn5sppa4.kgl.deckers@news.rediris.es>
In <Pine.GSO.3.96.970715210937.5131g-100000@kelly.teleport.com>,
Tom Phoenix <rootbeer@teleport.com> wrote:
>On 15 Jul 1997, A. Deckers wrote:
>
>> $headers =~ s/^Path:.+((\![^!]+){3})$/Path: ...$1/m;
>
>Let's re-write that for clarity.
>
> $headers =~ s{
> ^ # Start of string or line
> Path: # "Path:"
> .+ # some required chars
> ( # Group one starts (unused)
> ( # Group two starts
> \! # A bang (didn't need escaping)
> [^!]+ # One or more non-bangs
> ){3} # Exactly three of group two
> ) # Group one ends
> $ # End of line or string
> } "Path: ...$1"mx; # Replacement string
>
>Hmmm... Looks like it should work, although I'd clean it up a little. For
>example, you could take out the outer parens. More importantly, you're
Can I? Is s/((foo){3})bar/$1/ equivalent to s/(foo){3}bar/$1/? I would have
thought that in the second case it only remembers /foo/ once.
_> perl
$_ = 'foofoofoo';
/((foo){3})/ and print "$1\n";
/(foo){3}/ and print "$1\n";
<Ctrl-D>
foofoofoo
foo
_> perl -v
This is perl, version 5.003 with EMBED
built under solaris at Jan 28 1997 19:36:08
+ suidperl security patch
Copyright 1987-1996, Larry Wall
Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5.0 source kit.
Yeah, yeah, I know, I should upgrade, but having spent the morning
trying to compile Perl on another Solaris box, I'm not about to attempt
it again. :-(
>using the /m option, so you could use this on multi-line strings, but the
>character class [^!] will match a newline character, which you don't want.
>Try [^!\n] instead, so that you can't accidentally cross a newline.
>(Admittedly, this shouldn't normally be a problem.)
[...]
Seems that it did. I unquoted the exclamation mark and added \n to the
character class and it now behaves. Thanks.
Cheers,
Alain
--
Perl information: <URL:http://www.perl.com/perl/>
Perl archive: <URL:http://www.perl.com/CPAN/>
Perl FAQ: <URL:http://www.perl.com/CPAN/doc/FAQs/FAQ/>
>>>>>>>>>>>>> NB: comp.lang.perl.misc is NOT a CGI group <<<<<<<<<<<<<<
------------------------------
Date: Mon, 14 Jul 1997 20:45:36 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Mike Aspros <ad_link@europa.com>
Subject: Re: script to change header / footer for large site
Message-Id: <Pine.GSO.3.96.970714204138.22574I-100000@kelly.teleport.com>
On Mon, 14 Jul 1997, Mike Aspros wrote:
Newsgroups: comp.lang.perl
If your news administrator still carries comp.lang.perl, please encourage
him or her to check out the frequent posting about bogus newsgroup names
in news.announce.newgroups. You'll be doing yourself and many others a
favor to use comp.lang.perl.misc (and other valid Perl newsgroups)
instead.
news:news.announce.newgroups
> I am looking for a perl script which would change the header and footer
> of a document and then go though the whole directory tree and do the
> same.
You can use one of the file-finding modules to get the file names, then
use some code something like this to update the files.
local(@ARGV) = $filename; # Or a list of names...
local($^I) = '.bak';
local($/) = "\n\n";
while (<>) {
s/old header pattern/new header/;
s/old footer pattern/new footer/;
print;
}
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: Thu, 17 Jul 1997 00:28:49 LOCAL
From: Bruce@winzurf.co.nz (Bruce Spedding)
Subject: Re: Three questions about Selena Sol's Database Manager
Message-Id: <Bruce.574.02865DEF@winzurf.co.nz>
>>2.
>>Is it possible too make it so the user only have modify and delete
>>access too the documents he/she added? (I don't want everyone too
>>delete all documents....)
>>
>This should already be the case. It is in classified AD scripts, and I
>think it is with the database too. But if not, it would be easy to do.
not so in the case of the version I used, but I added a patch to do so, not
too difficult. Also found a bug which was quite serious (i.e. wouldn't work)
...
------------------------------
Date: Tue, 15 Jul 1997 15:32:08 GMT
From: aml@world.std.com (Andrew M. Langmead)
Subject: Re: use OR require (suite)
Message-Id: <EDD9tL.3HJ@world.std.com>
perl guy <perlprogrammer@hotmail.com> writes:
>Joelle D'Antin & Nicolas Gregoire wrote:
>>
>> I call my libarry with :
>> require '/users/dantin/perl/biblios/recherche_par_prenom.pl';
>>
>> help me.
>um...????..
>$file = "/path/to/file.pl";
>require("$file") || die "Could not get file";
>You can try that.. it should tell you if it's working...
"require" automatically dies if the file does not exist or does not
return a true value when executed. Saying "require $file || die" is
redundant.
Joelle was not too specific in either of the "use OR require"
articles, but as I wild guess, I'd suspect that
"recherche_par_prenom.pl" does not end in
1;
or any other boolean true value.
require()d files get parsed and run and return the last expression
evaluated. They must return a true value to signal to perl that
everything is OK.
--
Andrew Langmead
------------------------------
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 738
*************************************