[7092] in Perl-Users-Digest
Perl-Users Digest, Issue: 717 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jul 10 11:17:12 1997
Date: Thu, 10 Jul 97 08: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 Thu, 10 Jul 1997 Volume: 8 Number: 717
Today's topics:
*writers/seeking/publication cdr43a@aol.com
Re: /x /s ......problem <ajohnson@gpu.srv.ualberta.ca>
Re: A logical Problem: Rounding to $ and Cents ( Thomas Lachlan XMS x4206 )
Anyone compile 'cterm' (for Hobbs RDB) under linux/gcc (Linux Enthusiast)
DBI's make clean <chris@ixlabs.com>
empty package "DBI" <uma@heidelbg.ibm.com>
Extra info: writing documents (and .pl's) to an user di <sv@xs4all.nl>
Function pointers in PERL crr026@email.mot.com
Re: How do you do a 'cut -cx-y' with Perl? <me@anon.com>
How to save in File ??? <MFNeubauer@ThePentagon.com>
How to write robust servers in perl-win 32 <manu@ipbs.fr>
Need help wrapping C functions <badger@prtr-13.ucsc.edu>
ODBC, Perl, Access and Insert <kermit@ticnet.com>
Password program.... <mmartinez@techstaff.com>
Re: pattern matching problem (Tad McClellan)
Re: Perl 5.003 -> 5.004_1 migration mpeppler@mbay.net
Re: PERL Book (A. Deckers)
Perl/Remote Sendmail (Blake Kritzberg)
Re: Problems running the embed example (interp.c) with (Edgar Walter Iparraguirre)
PUBLIC: Installing FAME extension for Perl <David.Heffernan@ubs.com>
Re: Q: Mail::Send (Erik Braun)
Re: Resolving URLs server side (Magnus Bodin)
reverse chop? <eglamkowski@mathematica-mpr.com>
Sockets <gssherma@schmelze.corp.hp.com>
SSI on apache (cREATURE dEM0N)
Re: Stripping text from a file (Tad McClellan)
Re: using array elements in regexps (Bart Lateur)
Re: using array elements in regexps <ajohnson@gpu.srv.ualberta.ca>
Web Architect <recruiter@lds.com>
Re: Y2K and Perl (was Re: Y2K problems??) <steveg@ccis.adisys.com.au>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 7 Jul 1997 03:52:13
From: cdr43a@aol.com
Subject: *writers/seeking/publication
Message-Id: <5pq7fc$o9u$5789@roadrunner.miracle.net>
We are a New York based international literary agency with two branch offices, one of
which is in Florida. We are seeking new and previously published authors, so please
adhere to the following guidelines.
All fiction: send brief synopsis, first chapter, and include a self addressed, stamped
envelope (SASE).
All nonfiction: brief synopsis, first chapter, SASE.
Short Stories: brief synopsis, 3 pages, SASE.
Poetry: send 3 poems, SASE.
Please do not send complete manuscript unless we ask for it.
Send to: Woodside International Literary Agency
33-29 58 Street>>>>>>>>
Woodside, New York>>>>>>>>
11377>>>>>>>
Phone (main office):
718-651-8145>>>>>>>
------------------------------
Date: Thu, 10 Jul 1997 00:05:43 -0500
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: /x /s ......problem
Message-Id: <33C46DA7.37B38039@gpu.srv.ualberta.ca>
Fan Ng wrote:
>
> Hi all:
>
> I don't know that what is the slash follow a character means.
> just like /x or /s .......
> But i know \s or \n or \w.......means.
> Can someone tell me that where are they different. and where use the /x /s
you should really take a look at the wealth of
free documentation provided with Perl...in the
present case the following documents contain
relevant information:
perldoc perlop
perldoc perlre
perldoc perlfaq6
regards
andrew
------------------------------
Date: 7 Jul 1997 08:33:14 GMT
From: etltsln@etlxd30.ericsson.se ( Thomas Lachlan XMS x4206 )
Subject: Re: A logical Problem: Rounding to $ and Cents
Message-Id: <5pq9ka$5t8@newstoo.ericsson.se>
Scarcat (scarcat@followme.com) wrote:
: O.K. here we go...
: Assuming: a numnerical value of 12.34
: was read in from a file, and placed inside the variable $sum
: and...
: you multiply the variable sum by 2 using
: $sum = $sum *2;
: you should get 24.68, correct?... uh no.
: instead I get 24.679999999999999
: ..
: I've tried to get around it a number of ways including multiplying it by 100,
: then throwing the
: $sum=INT($sum);
: command to work on it, but calculating the decimal places is
: more work than it it worth.
: ..
: Can Someone tell me what the heck is going on here?
: Please e-mail me @
: hector@netside-cafe.on.ca should you have any suggestions.
: Hector Catre
Hi,
try this printf("%.2f", $product); or
$var = sprintf("%.2f", $product);
cheers Tam
------------------------------
Date: 10 Jul 1997 09:57:27 GMT
From: brett@teleport.com (Linux Enthusiast)
Subject: Anyone compile 'cterm' (for Hobbs RDB) under linux/gcc ???
Message-Id: <slrn5s9cle.24r.brett@teleport.com>
Keywords: RDB, Hobbs, perl, cterm, gcc, linux
Hi -
It would be immeasurably appreciated if someone who has successfully
compiled cterm under linux/gcc could provide the methods involved :-)
Having tried to compile it and get it running, it is a no-go, despite
no errors reported during compilation.
The original author compiled it under a sun sparc, I believe. He is gone
for the next month, so anyone who can help please do!
-TIA
-Brett
brett@teleport.com
P.S. I am seeking info in the area of compiler flags and such. I have
almost no knowledge of curses or c compilers at all. Thanks again!!
------------------------------
Date: Wed, 09 Jul 1997 15:01:13 -0700
From: Chris Schoenfeld <chris@ixlabs.com>
Subject: DBI's make clean
Message-Id: <33C40A29.70FB@ixlabs.com>
I just installed DBI 0.85 on 2 perl distributions on the same machine.
In between, I did a 'make clean', and it tried to delete all sorts of
stuff well outside the distribution directory!!! I hit CTRL-C before
many files I had permission to delete were hit.
I changed the 'rm -rf' to 'echo' in clean, and got the following:
DBI.c DBI-0.85/ ./blib Makefile.aperl ./blib/arch/auto/DBI/extralibs.all
perlmain.c mon.out core so_locations pm_to_blib Makefile~ */*~ */*/*~
DBI.o *.a perl.exe DBI.bs DBI.bso DBI.def DBI.exp
So I don't know what the problem was.
Anyone else experience this?
------------------------------
Date: Tue, 08 Jul 1997 12:39:07 +0200
From: Uma Shanker <uma@heidelbg.ibm.com>
Subject: empty package "DBI"
Message-Id: <33C218CB.41C6@heidelbg.ibm.com>
hello all perl-ish !
what it means
Can't call method "install_driver" in empty package "DBI" at ./erste.pl
line 9.
here is my code :
#!/client/bin/perl -w
#
#
use lib "/hd/u/uma/java/modules/lib/site_perl/";
#use DBI;
$drh = DBI->install_driver('DB2');
die unless $drh;
--------------------------
Is path to the module is correct.
any help/idea
--
uma shanker
uma@heidelbg.ibm.com
bad mail go to /dev/null <<
------------------------------
Date: Thu, 10 Jul 1997 14:28:17 +0200
From: Sia Veenstra <sv@xs4all.nl>
Subject: Extra info: writing documents (and .pl's) to an user directory
Message-Id: <33C4D561.6CDD@xs4all.nl>
I forgot to mention that this the beginning of the form is:
<FORM METHOD="POST" ACTION="cgi-bin/save.pl">
<TEXTAREA COLS=60 ROWS=12 NAME="text">
and that the script is called "save.pl"
------------------------------
Date: Mon, 07 Jul 1997 01:11:19 -0600
From: crr026@email.mot.com
Subject: Function pointers in PERL
Message-Id: <868255371.18225@dejanews.com>
Hi!
I'm trying to speed up a long list of if-elsif-else. Is there a simple way
to do this without going through each condition check?
In C (my mother tongue, :-}), there's a construct called function
pointers. I can load an array with pointers to the functions concerned,
and instead of going through the if-else chain, work out the index and
jump to the function right away. Is there such a beast or technique I can
use in Perl?
Best regards,
Ramesh
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: Wed, 09 Jul 1997 20:50:15 -0700
From: Chris Hostetter <me@anon.com>
Subject: Re: How do you do a 'cut -cx-y' with Perl?
Message-Id: <33C45BF7.4D1970FB@anon.com>
> > but then i got to he end of the discription and i see: "To break apart a
> > string with fixed-position fields, use unpack."
>
> Where? Which version? I cannot seem to find this in 5.004 pods or in
> the FAQ.
camel : 222
> Why are you removing the spaces in the fields?
it seemed like a good idea
(i mean, hey: who wants to waste the disk/memory to keep a bunch of
spaces around?)
---
------------------------ The Hoss Man --- "c4"
-------------------- Chris M Hostetter -- --Deep Blue
---------- hossman@uclink3.berkeley.edu - "Resign!"
http://www.rescomp.berkeley.edu/~hossman/ --Gary Kasparov
------------------------------
Date: Thu, 10 Jul 1997 09:00:59 +0100
From: Martin Neubauer <MFNeubauer@ThePentagon.com>
Subject: How to save in File ???
Message-Id: <33C496BB.4034@ThePentagon.com>
Hello,
I'm a newcomer in perl Programming ...
can you tell me how i can change the following Perl Programm to print
the output, and save it to harddisk.
Each form should appendet to a file ...
Many thanks for an answer (Plaese per EMail too)...
Martin Neubauer
require
"cgi-lib.pl";
MAIN:
{
# Read in all the variables set by the
form
&ReadParse(*input);
# Print the
header
print
&PrintHeader;
print &HtmlTop ("cgi-lib.pl demo form
output");
# Do some processing, and print some
output
($text = $input{'text'}) =~
s/\n/\n<BR>/g;
# add <BR>'s after carriage
returns
# to multline input, since HTML does
not
# preserve line
breaks
print
<<ENDOFTEXT;
You, $input{'name'}, whose favorite color is $input{'color'} are on
a
quest which is $input{'quest'}, and are looking for the weight of
an$input{'swallow'} swallow. And this is what you have to say
for
yourself:<P>
$text<P>
ENDOFTEXT
# If you want, just print out a list of all of the
variables.
print "<HR>And here is a list of the variables you
entered...<P>";
print
&PrintVariables(*input);
# Close the document
cleanly.
print
&HtmlBot;
------------------------------
Date: Thu, 10 Jul 1997 15:56:32 +0200
From: Emmanuel Courcelle <manu@ipbs.fr>
Subject: How to write robust servers in perl-win 32
Message-Id: <33C4EA10.15FB@ipbs.fr>
Hello.
I am trying to write a "robust" server in perl-win 32.
I mean that the server, while reading from the socket, should specify a
time-out, so that if the client hangs the server is not hung.
In Unix, I write the following:
$dring=0; # re-armer l'alarme
while (1) {
alarm (10); # time-out = 10 s
$_=<$client>;
alarm (0); # desarmer l'alarme
if ($dring) {
print $client "au revoir\n";
last;
};
It works perfectly well... however, the alarm finction is NOT
implemented in perl win-32: is there a workaround ???
Thanks in Advance,
--
--------------------------------------------------------------
Emmanuel COURCELLE
Institut de Pharmacologie et de Biologie Structurale - I.P.B.S.
Groupe de cristallographie biologique.
CNRS/CEMES/IPBS Tel (33 ou 0) 5-62-25-79-62
29 rue Jeanne Marvig Fax (33 ou 0) 5-62-25-79-60
31055 TOULOUSE cedex - FRANCE e-mail manu@ipbs.fr
--------------------------------------------------------------
------------------------------
Date: Wed, 09 Jul 1997 17:39:41 -0700
From: Toshio Kuratomi <badger@prtr-13.ucsc.edu>
Subject: Need help wrapping C functions
Message-Id: <33C42F4C.41C67EA6@prtr-13.ucsc.edu>
I've been trying to embed some C functions into
a CGI script. But I am having no end of problems.
Background:
The C functions are used to talk to a kerberos/moira
database that holds information about users of my system.
They utilize a kerberos library (libkrb), moira library (libmoira),
an encryption library (libdes), and a library that handles errors
(libcom_err). These C functions were yanked from a curses
based program to be implemented in this CGI script.
I am trying to call these C functions from perl so I
don't have to touch the libraries, but only the functions that
I need. (Is this the proper way to do this?)
I have read the perlxs and perlxstut manual pages,
but am not sure that I have everything set up correctly.
Currently I have a directory "moira" with a subdirectory
"reg_stubs". I put the C files into the reg_stubs directory,
cd'd below the moira directory adn ran
h2xs -O -n moira ./moira/reg_stubs/reg_stubs.h
Then I edited things similarly to example 4 in the perlxstut
manual and added
LIB => '-L/usr/athena/lib -lmoira -lkrb -ldes -lcom_err'
to the Makefile.PL in the moira directory. I also added
-I/usr/athena/include to the Makefile.PL in the directory and
the subdirectory.
Problem:
This allows me to compile and install my extension, but when I
attempt to reference one of the extensions I receive the error:
ld.so: Undefined symbol: __et_list
....Which should be in libcom_err.... Additionally, when I run
my test as a cgi script with a setuid C wrapper, I get the error
ld.so: libkrb.so.1: not found
If anyone can help me fix this, or help point me at what might
be wrong, or even tell me, "that's entirely the wrong way to go
about the problem, do it this way instead" I would appreciate it
immensely.
Thanks
-Toshio Kuratomi <badger@prtr-13.ucsc.edu>
------------------------------
Date: Tue, 08 Jul 1997 16:30:08 -0500
From: Kermit Tensmeyer <kermit@ticnet.com>
Subject: ODBC, Perl, Access and Insert
Message-Id: <33C2B160.31C2ABE2@ticnet.com>
I know that I have done this before. I just can't quite recall ...how?
I want to insert data into a table where one column is a binary long.
In Access it is a memo field. There are limitations about what you
can and can not do with this blob fields. Oracle, Informix, SQL-Server
and DB2.
One thing that one should be able to do is to insert data.
for example $area = sprintf "insert into Dummy (Key, Name, BlobArea)
values (%d, '%s', '%s') ", 14, "David Roth", "big long list of
text...");
$ret = $A->Sql($area);
Yep, I remember there is a problem with a difference between single
quote and
double quote. [Not the problem in perl, but a seperate problem with
ODBC.]
Yep, the ODBC::Sql utilizes the execImmediate command, but no it
doesn't
make a difference.
(yes I really do wish that I had saved that bit of code that I was
working on six months ago....;-( )
any ideas? oh yes the error message complains about the placement of
the quotes..
------------------------------
Date: Thu, 10 Jul 1997 09:21:05 -0500
From: Mark Martinez <mmartinez@techstaff.com>
Subject: Password program....
Message-Id: <33C4EFD1.6EA7@techstaff.com>
Hello, I am new to Perl but can program in
C / C++. I was wondering if any one could help me with
a little problem... I want to Check a Name and Password
before giving out put...
I am using it for the web...
Get Name and Password...DONE
I just need the Password check part...
Even just a little help...Need if goto else
Print Access Denied...Done
Print Database Info...DONE
Also any places to easying learn PERL would be
great, books and WEB SITES.
Thanks for any help,
MArk
------------------------------
Date: Wed, 9 Jul 1997 07:06:42 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: pattern matching problem
Message-Id: <isuvp5.ek.ln@localhost>
Jean-Damien Durand (ddurand@hpplus14.cern.ch) wrote:
: > <tag data="underscore_to_change">some information</tag>
: >
: > I've tried, after setting my $_ variable and seting $* = 0, using:
: > /<.*>?/g;
: > $anytag =~ $&;
: > $& =~ tr/_/./g;
: What about:
: $_ = '<tag data="underscore_to_change">some information</tag>' ;
: tr/_/\./ if /<.*>?/ ; # Result is in $_
^^^^^^^^^^^^^^^
Yes, but it is a possibly incorrect result ;-)
---------------------
#! /usr/bin/perl -w
$_ = '<tag data="underscore_to_change">some_information</tag>' ;
tr/_/\./ if /<.*>?/ ; # Result is in $_
print "$_\n";
---------------------
It will translate underscores _anywhere_ in the string, not only when
inside of a tag...
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: Thu, 10 Jul 1997 09:11:48 -0600
From: mpeppler@mbay.net
To: andrew@spyder.manor.org
Subject: Re: Perl 5.003 -> 5.004_1 migration
Message-Id: <868543620.14723@dejanews.com>
In article <5q0i16$dmq@spyder.manor.org>,
andrew@spyder.manor.org (Andrew Williams) wrote:
>
> I've looked through this group and have not really seen anything pertaining
> to this. . . . anyway, my question is:
>
> We are running many many perl scripts that use DBM, MSQL, the cgi package,
> and sybase. (In addtion to a couple of other packages). Is there anything
> I should watch out for when moving from 5.003 to 5.004_1? Is this a drop
> in replacement for 5.003? Will I have to reinstall packages?
I'm assuming when you say 'sybase' you mean you are useing the
Sybase::DBlib or Sybase::CTlib modules (from sybperl).
If so, then you *may* need to rebuild them. When you do, you will get
some warnings during 'make test' which come from changes in perl 5.004,
but which do not affect the functional behaviour of the modules. However,
if you want to get rid of these warnings you can get sybperl 2.07b from
my homepage (http://www.mbay.net/~mpeppler) which fixes these small
problems.
Michael
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: 10 Jul 1997 13:59:03 GMT
From: deckers@man.ac.uk (A. Deckers)
Subject: Re: PERL Book
Message-Id: <slrn5s9ql2.cji.deckers@nessie.mcc.ac.uk>
In <33C4E723.6AB@bellatlantic.net>,
pgweb@bellatlantic.net <pgweb@bellatlantic.net> wrote:
>Hi,
>
>I have been wanting to learn Perl, so that I will be able to write CGI
>scripts. Anyone have a recommendation as to what book I should use?
Check Tom Christiansen's site. It contains reviews of quite a few books
dealing with Perl:
<URL:http:/www.perl.com/perl/critiques/index.html>
HTH,
Alain
--
Perl information: <URL:http://www.perl.com/perl/>
Perl FAQ: <URL:http://www.perl.com/perl/faq/>
Perl archive: <URL:http://www.perl.com/CPAN/>
>>>>>>>> comp.lang.perl.misc is NOT a CGI group <<<<<<<<<<
------------------------------
Date: 10 Jul 1997 14:07:33 GMT
From: kritzber@ucsub.Colorado.EDU (Blake Kritzberg)
Subject: Perl/Remote Sendmail
Message-Id: <5q2qb5$1l6@lace.colorado.edu>
Hi, all -- this is a weird question, but Perl seems to be
the common thread.
I've written a tiny script that uses sendmail. I need
to port it to NT (retch, gag), but I don't need to use BLAT
(I don't think) because a UNIX box running sendmail
is on the local network. I have the IP address for the sendmali
box.
How can I tell perl that sendmail's on a separate machine?
Thanks so much,
Blake
--
________________________ ___________
LONDON - Former students at two British schools, judged
by government inspectors as failing their pupils, are ------------
suing [the schools] for their poor education. REUTERS B. Kritzberg
------------------------------
Date: Wed, 09 Jul 1997 21:04:01 GMT
From: E.W.Iparraguirre@inter.NL.net (Edgar Walter Iparraguirre)
Subject: Re: Problems running the embed example (interp.c) with Dynamic loading on AIX
Message-Id: <33c3faf7.8878833@news4.inter.NL.net>
On 20 Jun 1997 17:07:27 -0400, radev@news.cs.columbia.edu (Dragomir R.
Radev) wrote:
>I have read the perlembed pages. I was able to run all the examples that
>don't require dynamic loading of modules. When I tried running the examples
>with dynamic loading, I only got core dumps.
> ...
We are having a similar kind of problem, though on AIX-4.1.4.
When compiling Perl (5.004, 5.004_01), if we choose to load Fcntl,
...DBM, etc. dynamically, when running the tests they fail for about
40%. When loading statically all the pass.
At a latter stage we wanted to use PerlTk. The generation and
compiling went allright, but at the moment we run the tests they just
stop with a segmentation fault.
It seems to me that the problem lies on the mixture gcc/xlc and
dynamic loading, probably some flags. We are looking for a solution.
Edgar W. Iparraguirre
E.W.Iparraguirre@inter.nl.net
iparrag1@sic.shell.nl
------------------------------
Date: Thu, 10 Jul 1997 12:01:21 +0900
From: Dave Heffernan <David.Heffernan@ubs.com>
Subject: PUBLIC: Installing FAME extension for Perl
Message-Id: <33C45081.C18BE7E@ubs.com>
Hi,
Has anybody successfully installed fameperl ( 2.0c) on a Solaris
platform (5.5.1) ? We're using FAME ver 7.7
and are having problems with the 'make test' part of the installation...
Thanks in advance,
Dave
------------------------------
Date: 10 Jul 1997 12:05:09 GMT
From: erik@paxp01.mipool.uni-jena.de (Erik Braun)
Subject: Re: Q: Mail::Send
Message-Id: <slrn5s9jvk.oo5.erik@paxp01.mipool.uni-jena.de>
On Wed, 09 Jul 1997 14:31:06 +0200, Dirk Haenelt
<dhaen@eeiwzb.et.tu-dresden.de> wrote:
>~s Important Notice!
You use a strange mail program. Try sendmail:
...
my($fh) = $msg->open('sendmail');
print $fh "$text";
$fh->close;
...
and everything will be fine.
bye, erik
ps: versuch es doch vorher in de.comp.lang.perl. Die Experten freuen sich,
nicht immer mit CGI-Fragen genervt zu werden.
--
erik@minet.uni-jena.de
------------------------------
Date: Thu, 10 Jul 1997 12:10:52 GMT
From: magnus.bodin@tychonides.se (Magnus Bodin)
Subject: Re: Resolving URLs server side
Message-Id: <33c4d0ca.163581407@news1.telenordia.se>
Bruce Pagram <bap1002@hermes.cam.ac.uk> wrote:
>How is it possible to resolve a URL pointing at your Web server into the
>local pathname your server would use to access the actual file? Is there
>some variable that stores the result and can be inspected?
If you are in a perl script, then you ought to know where you are, or?
Or are you writing a webserver? :-)
------------------------------
Date: Tue, 08 Jul 1997 13:50:42 -0400
From: the count <eglamkowski@mathematica-mpr.com>
Subject: reverse chop?
Message-Id: <33C27DF2.578@mathematica-mpr.com>
Is there any trivial way to remove the first character of a string?
Right now I am using:
while (<>) {
@line = split;
print "substr($line[0], 1, length($line[0] - 1))\n";
}
but I feel like there should be an easier way... ;-)
Is there any function like chop that would remove the first
character, as opposed to the last?
------------------------------
Date: Wed, 09 Jul 1997 13:40:35 -0700
From: Geoff Sherman <gssherma@schmelze.corp.hp.com>
Subject: Sockets
Message-Id: <33C3F743.3176@schmelze.corp.hp.com>
Hello all,
I am looking for examples of FULL Perl sockets on the Net. I am trying
to find something that reads in command line data, writes it to a socket
from the client, the server reads the name from the socket, opens the
file with that name, writes the data across the socket, and then have
the client read the socket and print what was in the file. Any help?
Thanks
Geoff Sherman
gssherma@schmelze.corp.hp.com
------------------------------
Date: Wed, 09 Jul 1997 17:01:22 GMT
From: creature.demon@unicall.be (cREATURE dEM0N)
Subject: SSI on apache
Message-Id: <33c2c399.34017625@news.unicall.be>
I want to use SSI on my site, for a banner rotator. But how do i
configure apache to use SSI. My provider uses apache as webserver. But
he does'nt know how to do it.
Someone told me to put as .htacces file in my directory. This is how
my .htaccess file looks :
Options Indexes FollowSymLinks Includes ExecCGI
Options includes
AddType text/x-server-parsed-html .shtml
ErrorDocument 401 /cgi-bin/guardian.cgi?401
ErrorDocument 403 /cgi-bin/guardian.cgi?403
ErrorDocument 404 /cgi-bin/guardian.cgi?404
ErrorDocument 500 /cgi-bin/guardian.cgi?500
I have chmodded 644 the file. But it dont want to do it, he even don't
load the guardian script. Does someone know how to do this ?
------------------------------
Date: Thu, 10 Jul 1997 06:24:20 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Stripping text from a file
Message-Id: <4pg2q5.cj.ln@localhost>
Steve Burton (steveb@nation-net.com) wrote:
: I am very new to perl.
: What i am trying to achieve it for perl to search a text file and find
: "abc" and strip the line that is on and the next line and generate a
: file with what is left.
-------------
#! /usr/bin/perl -w
while (<>) {
if (/abc/) {
<>; # discard the next line
next; # go back to top of while loop
}
print;
}
-------------
This just outputs to STDOUT.
You may also want to read up on the -i command line switch (in the
perlrun man page) to do "in place" edits.
: Thanks
You're welcome.
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: Thu, 10 Jul 1997 11:57:10 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: using array elements in regexps
Message-Id: <33c8cc04.2343320@news.tornado.be>
Shaun O'Shea <lmisosa@eei.ericsson.se> wrote:
>Can anyone tell me if you can use array elements as regexps and if so
>how do I phrase it.
> What I'm trying to do is to take each element in an array in turn and
>use it in a regexp. The following should give you an idea of what I
>mean:
That is simple enough. You can do
$number = '[0-9]+\.?[0-9]*';
if (/($number)/) {
...
}
Make sure that the string is EXACTLY like what you would type directly
in the regexp. e.g. to match backslashes, you need to double them.
A problem exists when you want to replace while retaining
subexpressions, as in
$orig = 'It is ([0-9]+) to ([0-9]+)';
$replace = 'Il est $2 heures moins $1';
s/$orig/eval '"'.$replace.'"'/e;
Although this works (should work), it's not fast, plus, it's not safe as
it can access ANY variable.
HTH,
Bart.
------------------------------
Date: Thu, 10 Jul 1997 09:49:26 -0500
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: using array elements in regexps
Message-Id: <33C4F676.7BC9686@gpu.srv.ualberta.ca>
Shaun O'Shea wrote:
>
> Can anyone tell me if you can use array elements as regexps and if so
> how do I phrase it.
> What I'm trying to do is to take each element in an array in turn and
> use it in a regexp. The following should give you an idea of what I
> mean:
>
> chomp $address[$i] ;#<---This is the element I want to compare
> $srchst = "/".$address[$i];
>
> $srchstr =$srchst."/";
>
> |-> if($srchstr)
> #OR--|
> |-> if (/THIS IS WHERE I WANT THE ARRAY ELEMENT /)
you could use something like:
if (/$address[$i]/) {}
or, if you need to quote metacharacters in the string:
if (/\Q$address[$i]\E/) {}
regards
andrew
------------------------------
Date: Thu, 10 Jul 1997 09:57:15 -0400
From: Recruiter <recruiter@lds.com>
Subject: Web Architect
Message-Id: <33C4EA3B.5127@lds.com>
Logical Design Solutions, a leader in the design and development of
Interactive Business Communications has an immediate full-time opening
in their Morristown, NJ office for a Web Architect.
Job Description:
In this visible role, the ideal candidate will possess experience in
configuration of Internet technologies as part of a multi-tiered
information technology architecture. Keeping up-to-date with
current technology trends is essential, as is the ability to evaluate
appropriate technology components for development and delivery
environments. This individual must also have the ability to integrate
application support technologies with preexisting client IT
infrastructure. Experience with C/C++, Perl, HTML, Java, CGI and
knowledge of Internet protocols and standards is required.
Knowledge of Active X a plus.
Contact:
Technical Recruiter
Logical Design Solutions
Phone: (201) 971-0100
Fax: (201) 971-0103
email: recruiter@lds.com
For further info: http://www.lds.com
------------------------------
Date: Wed, 9 Jul 1997 22:47:10 GMT
From: Steve Gunnell <steveg@ccis.adisys.com.au>
Subject: Re: Y2K and Perl (was Re: Y2K problems??)
Message-Id: <33C414EE.1EA2@ccis.adisys.com.au>
Russ Allbery wrote:
> If you're using the % format strings rather than just running date,
> there's no format string under SunOS /bin/date that will give you the full
> year. Only the last two digits. See the man page for confirmation. And
> using the % escapes is somewhat common in Perl scripts to get the date in
> an easily parsable format.
In Perl you yould be using the localtime() function *NOT* a call to
/bin/date. Have a look at the ctime(3V) man page or directly at the
time.h header for the description of the tm struct. This data set
is what localtime() returns. Note that the tm_year item is the year
*minus* 1900. So in 2001 it will retun 101. This point is not clearly
made in the Perl documentation but is addressed in the FAQ.
So yes you are stuffed if you are using /bin/date on a Sunos 4.1.x
box but you should be using the appropriate Perl function anyway.
Steveg
------------------------------
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 717
*************************************