[8662] in Perl-Users-Digest
Perl-Users Digest, Issue: 2279 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 9 01:07:19 1998
Date: Wed, 8 Apr 98 22:00:23 -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, 8 Apr 1998 Volume: 8 Number: 2279
Today's topics:
Re: A puzzling problem (Greg Bacon)
BIG RENAME QUESTION??? <mark@imp.net>
Re: dbi/dbd/oracle on NTs4 (John D Groenveld)
Re: FAQ question (Abigail)
Re: greediness problem matching date expressions? help (Greg Bacon)
Re: HELP !!! - Templates within Perl <BILL@assist.org>
Re: Help w/rename pleez... <sowmaster@juicepigs.com>
Re: Help w/rename pleez... <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Info Regarding Perl 5.005 <achoy@us.oracle.com>
Re: Oddities in bitwise string |, &, ^ <rootbeer@teleport.com>
Re: perl for Oracle database interface (John D Groenveld)
Re: PID, fork(), exec() question again... (Jason Gloudon)
Re: Running Perl CGI in a Personal Web Server. <rcdick@radiks.net>
s/// in same file. <grimoire@oaktree.net>
Re: s/// in same file. (David Oswald)
Re: s/// in same file. (Jason Gloudon)
Re: search operator question <rootbeer@teleport.com>
Re: serpinski gasket almost-1-liner needs polishing (Tom Rokicki)
Re: serpinski gasket almost-1-liner needs polishing (Tom Rokicki)
Re: UNIX, system(), and text that isn't output. (Jason Gloudon)
Re: UNIX, system(), and text that isn't output. <eugene@vertical.net>
Why am I getting this regexp error? <chfwahoo@entropy.muc.muohio.edu>
Re: Why am I getting this regexp error? <jdf@pobox.com>
Re: Why am I getting this regexp error? <danboo@negia.net>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 9 Apr 1998 01:23:50 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: A puzzling problem
Message-Id: <6gh7v6$g31$1@info.uah.edu>
[Posted and mailed]
In article <6ggvo2$rql$1@coranto.ucs.mun.ca>,
schipper@morgan.ucs.mun.ca (W Schipper) writes:
: But I am having a problem that I can't find a solution for, and so ask
: for your collective advice. A number of headers (most notoriously
: the ones that begin "Received: ..." are followed by several additional
: lines that begin with a tab or a series of spaces to look like indents.
: Here is what I tried to do:
Don't reinvent the wheel! Someone has already solved your problem.
Have a look at
http://www.perl.com/CPAN/modules/by-module/Mail/
and retrieve the latest MailTools distribution. The Mail::Header
module within that distribution is especially useful for grabbing
specific headers.
Hope this helps,
Greg
--
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF
------------------------------
Date: Thu, 9 Apr 1998 00:01:13 -0400
From: "Mark Polakow" <mark@imp.net>
Subject: BIG RENAME QUESTION???
Message-Id: <6ghiaf$at2$1@viper.america.net>
$file="c:/webshare/test/ad.zip";
$newname="c:/webshare/test/addd.zip";
rename ("$file","$newname") or die "$!";
print "Content-type: text/html\n\n";
print ($root.$file,$newname);
This works fine and renames like it should when executed from the
commandline but returns
'C:\WEBSHARE\CGI-PERL\rename.pl' script produced no output
when run from cgi - called from a browser can anyone help me out here I am
stumped (doesn't take much)??
Thanks alot in advance for any help.
------------------------------
Date: 8 Apr 1998 23:57:17 -0400
From: groenvel@cse.psu.edu (John D Groenveld)
Subject: Re: dbi/dbd/oracle on NTs4
Message-Id: <6ghgut$r6h$1@tholian.cse.psu.edu>
With VC5, I've built perl5.004_04, DBI, DBD::Oracle with very little
effort.
John
groenveld@acm.org
------------------------------
Date: 9 Apr 1998 00:52:37 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: FAQ question
Message-Id: <6gh64l$5ga$1@client3.news.psi.net>
Louie ($louie@visca.com) wrote on MDCLXXXI September MCMXCIII in
<URL: news:352bd6e7.2240892@news.jet.es>:
++ Greetings:
++
++ Here's my script, which uses the "simple-minded" approach for removing
++ HTML tags suggested in Perlfaq9:
++
++ "(?:[^>'"]*|(['"]).*?\1)* matches null string many times at
++ html2txt.pl line 9."
++
++ Is there a fix for this?
Yes. Its mentioned in the lines right below the given regex!
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=new Math::BigInt+qq;$^F$^W783$[$%9889$^F47$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W98$^F76777$=56;;$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V%$^U;$^V/=$^U}while$^V!=$^W'
------------------------------
Date: 9 Apr 1998 01:36:45 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: greediness problem matching date expressions? help
Message-Id: <6gh8nd$g31$2@info.uah.edu>
[Posted and mailed]
In article <352BF61C.B4EAF1C2@emrtc.nmt.edu>,
Josh England <nagare@emrtc.nmt.edu> writes:
: I am having a problem matching dates which roll-over past the year
: 2000. I have a perl program which builds a regular expression for the
: date range as follows:
[snip regex]
Is there a particular reason you're using a regular expression?
The Date::Parse module (part of Graham Barr's TimeDate distribution)
will take a date and return it in Unix time (seconds since the epoch)
which you can hand to localtime and test the appropriate elements of
the resulting list to see whether it's in your desired range.
For example:
use Date::Parse;
my $date = 'Tue Apr 3 07:27:55 2018';
my $time = str2time $date;
die "weird date `$date'" unless defined $time;
my($sec,$min,$hour,$mday,$mon,$year) = localtime $time;
## range checking on $mon, $mday, and $year
Hope this helps,
Greg
--
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF
------------------------------
Date: Wed, 08 Apr 1998 09:39:42 -0700
From: WILLIAM L COOPER <BILL@assist.org>
Subject: Re: HELP !!! - Templates within Perl
Message-Id: <352BA84D.83A836E7@assist.org>
I have been using Mark-Jason Dominus 's template module to create HTML pages
with great success. See
http://gold.ldis.com/~larry/perl/modules/Template.pm.html
The general idea is to embed escapes to perl code between {} in the HTML.
This allows us to prototype a static page using an HTML tool and then for
example, replace a static form with a call on a perl subroutine to generate
the form using dynamic data. The HTML template is kept in a separate file
along with the other HTML pages.
Bill Cooper
bill@assist.org
maurice@hevanet.com wrote:
> > I'm looking for a way of using HTML templates within Perl CGI-scripts,
> > so I can isolate HTML-code (for script-output) from the script-source.
> > The problem is that the (html-)output contains some variables, which are
> > used inside the script.
> >
> > Do you know how to do this (if there is any way of using templates
> > within Perl) ?
>
> Check out YAWP:
>
> http://olympia2.adhost.com/~maurice/
>
> It was designed for this purpose and is very Perlish.
>
> - Maurice
>
> -----== Posted via Deja News, The Leader in Internet Discussion ==-----
> http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Wed, 08 Apr 1998 20:16:16 -0400
From: Bob Trieger <sowmaster@juicepigs.com>
To: Mark Polakow <mark@imp.net>
Subject: Re: Help w/rename pleez...
Message-Id: <352C1350.143D@juicepigs.com>
Mark Polakow wrote:
>
> This is a petty newbee question but I can't seem to rename my files, this
> isn't working:
>
> rename ($root$file, $rename) or die print "Unable to re-name, $!";
>
> I am using Perl for win32 and other file functions such as unlink have
> worked fine. I have tried with " and with ' and I am at a loss! Thanks in
> advance for any help.
perldoc -f die
HTH
--
Bob Trieger | Titanic: big boat, bigger
sowmaster@juicepigs.com | iceberg, big deal
------------------------------
Date: Wed, 8 Apr 1998 19:59:34 -0700
From: "Creede Lambard" <$_=qq!fearless\@NOSPAMio.com!;y/A-Z//d;print>
Subject: Re: Help w/rename pleez...
Message-Id: <6ghdid$95s@bgtnsc02.worldnet.att.net>
You don't need print with die.
You also don't say what $root, $file and $rename are set to. Assuming those
values make a valid path to a file when concatenated, I would change the
line below to the following:
$oldname = $root . $file;
print "Renaming $oldname to $rename\n";
rename ($oldname, $rename) or die "Can't rename file: $!";
This will more than likely give you an idea of what's going wrong.
--- Creede Lambard
Minister of Irregular Expressions
Programming Republic of Perl
Mark Polakow wrote in message <6gh2h4$s82$1@viper.america.net>...
>This is a petty newbee question but I can't seem to rename my files, this
>isn't working:
>
>rename ($root$file, $rename) or die print "Unable to re-name, $!";
>
>I am using Perl for win32 and other file functions such as unlink have
>worked fine. I have tried with " and with ' and I am at a loss! Thanks in
>advance for any help.
>
>
------------------------------
Date: Wed, 08 Apr 1998 19:25:42 -0700
From: Allen Choy <achoy@us.oracle.com>
Subject: Info Regarding Perl 5.005
Message-Id: <352C31A6.FD24D790@us.oracle.com>
Anyone know what kind of features will be available in perl 5.005?
Thanks--allen
------------------------------
Date: Wed, 8 Apr 1998 17:00:24 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Tom Rokicki <rokicki@cello.hpl.hp.com>
Subject: Re: Oddities in bitwise string |, &, ^
Message-Id: <Pine.GSO.3.96.980408165729.20192e-100000@user2.teleport.com>
On 8 Apr 1998, Tom Rokicki wrote:
> Subject: Oddities in bitwise string |, &, ^
They may be odd, but here's the scoop. (Forgive the things that look like
X<this>, which are POD markup.) If you find bitwise ops behaving in other
undocumented ways, please let me know. Hope this helps!
+=head2 Bitwise String Operators
+
+Bitstrings of any size may be manipulated by the bitwise operators
+(C<~ | & ^>).
+
+If the operands to a binary bitwise op are strings of different sizes,
+B<or> and B<xor> ops will act as if the shorter operand had additional
+zero bits on the right, while the B<and> op will act as if the longer
+operand were truncated to the length of the shorter.
+
+ # ASCII-based examples
+ print "j p \n" ^ " a h"; # prints "JAPH\n"
+ print "JA" | " ph\n"; # prints "japh\n"
+ print "japh\nJunk" & '_____'; # prints "JAPH\n";
+ print 'p N$' ^ " E<H\n"; # prints "Perl\n";
+
+If you are intending to manipulate bitstrings, you should be certain that
+you're supplying bitstrings: If an operand is a number, that will imply
+a B<numeric> bitwise operation. You may explicitly show which type of
+operation you intend by using C<""> or C<0+>, as in the examples below.
+
+ $foo = 150 | 105 ; # yields 255 (0x96 | 0x69 is 0xFF)
+ $foo = '150' | 105 ; # yields 255
+ $foo = 150 | '105'; # yields 255
+ $foo = '150' | '105'; # yields string '155' (under ASCII)
+
+ $baz = 0+$foo & 0+$bar; # both ops explicitly numeric
+ $biz = "$foo" ^ "$bar"; # both ops explicitly stringy
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 8 Apr 1998 23:53:43 -0400
From: groenvel@cse.psu.edu (John D Groenveld)
Subject: Re: perl for Oracle database interface
Message-Id: <6ghgo7$r5q$1@tholian.cse.psu.edu>
http://www.perl.org/CPAN/modules/00modlist.long.html#7)DatabaseInter
You are correct that oraperl, the Perl4 extension is dead, though an emulation
module for DBI/DBD::Oracle exists.
John
groenveld@acm.org
------------------------------
Date: Thu, 09 Apr 1998 03:23:42 GMT
From: jgloudon@manitoba.bbn.com (Jason Gloudon)
Subject: Re: PID, fork(), exec() question again...
Message-Id: <slrn6iofkt.ntq.jgloudon@manitoba.bbn.com>
Michael Shavel <mshavel@erols.com> wrote:
.
.
>exec("$c . &") or die "Exec Failed:$!";
The & should not be here.
& makes the shell do the same fork and exec to start a background process,
so it creates a third process (and PID) that $c runs in.
Having already started a new child process running in the background using fork
you just want the shell to replace the child process with $c:
exec $c or die "Exec Failed:$!";
--
Jason Gloudon
------------------------------
Date: Wed, 8 Apr 1998 18:47:36 -0500
From: "Rich Dickeson" <rcdick@radiks.net>
Subject: Re: Running Perl CGI in a Personal Web Server.
Message-Id: <6gh288$2k4$1@news.radiks.net>
I second Yair question.. I am having the same problems.. I even downloaded
the new 4.0 personal web server from the NT option pact.. but it still does
me no good.. In O'Reilly Website I can direct a specific language to run a
file extension,, so CGI is ran by Perl5 etc...
Can anyone shed somelight on Frontpage 98 and Perl Scripts!!
Thanks All
Yair Schaffer wrote in message <35262117.1958@actcom.co.il>...
>Hi,
>
> I have Perl5 running on my pc.
> and also front page98 and microsoft personal web server runnig.
>
> What should I do to run a perl CGI in the server ?
> (I mannaged running a C cgi but I get a server Error when
> trying to address a perl CGI)
>
>
>Tanx
> yair.
------------------------------
Date: Wed, 8 Apr 1998 21:28:50 -0500
From: Grimoire <grimoire@oaktree.net>
Subject: s/// in same file.
Message-Id: <Pine.LNX.3.95.980408205800.16793A-100000@harmony.oaktree.net>
Alright, I am wanting to open a file, search for a string, replace and
have the replacement be saved in the original file. The sample code I
tried was:
---------------------------------------------------
#!/usr/bin/perl -w
print "file: ";
chomp($file = <>);
print "string: ";
chomp($string = <>);
print "replace: ";
chomp($replace = <>);
open(FILE, $file) || die "error opening $file: $!";
while(<FILE>){
s/$string/$replace/gi;
}
close(FILE);
---------------------------------------------------
With this code, as most of you the are good with perl will know
that it will in fact complete the s/$string/$replace/gi...though, it will
not save the change in the same file. So, when I open the file...it does
not have the new string replacement. Could anyone help me out with this?
"""
(o o)
-------------------------------.uU O Uu.--------------------------------
I'm thinking of changing my name to 'Snafu Fubar'.
--------------------------------/ /-\ \---------------------------------
-- --
------------------------------
Date: Thu, 09 Apr 1998 03:00:28 GMT
From: doswald@xmission.com (David Oswald)
Subject: Re: s/// in same file.
Message-Id: <352c3865.74263285@news.xmission.com>
On Wed, 8 Apr 1998 21:28:50 -0500, Grimoire <grimoire@oaktree.net>
wrote:
>Alright, I am wanting to open a file, search for a string, replace and
>have the replacement be saved in the original file. The sample code I
>tried was:
>---------------------------------------------------
>#!/usr/bin/perl -w
>
>print "file: ";
>chomp($file = <>);
>print "string: ";
>chomp($string = <>);
>print "replace: ";
>chomp($replace = <>);
>open(FILE, $file) || die "error opening $file: $!";
>while(<FILE>){
> s/$string/$replace/gi;
>}
>close(FILE);
>---------------------------------------------------
> With this code, as most of you the are good with perl will know
>that it will in fact complete the s/$string/$replace/gi...though, it will
>not save the change in the same file. So, when I open the file...it does
>not have the new string replacement. Could anyone help me out with this?
You have a few problems:
1. You're not opening an outfile. The file you are opening is
being opened as a read file.
2. Even if you were opening an outfile, you're not locking it.
3. You're not writing to any file.
4. You didn't read (or retain) the documentation.
What you'll probably want to do is open a temporary outfile. You can
not make changes in the middle of an existing file, so you'll need to
either read in the entire file and re-write it out, or you'll need to
write an outfile and then replace the infile with the finished
outfile.
Personally, I kind of like the temporary outfile approach because it
doesn't assume that the infile will be small enough to fit entirely in
memory.
Dave
------------------------------
Date: Thu, 09 Apr 1998 03:27:52 GMT
From: jgloudon@manitoba.bbn.com (Jason Gloudon)
Subject: Re: s/// in same file.
Message-Id: <slrn6iofsm.ntq.jgloudon@manitoba.bbn.com>
Grimoire <grimoire@oaktree.net> wrote:
>Alright, I am wanting to open a file, search for a string, replace and
>have the replacement be saved in the original file. The sample code I
>tried was:
How do I change one line in a file/delete a line in a
file/insert a line in the middle of a file/append to the
beginning of a file?
Try looking for this question in `man perlfaq5`.
--
Jason Gloudon
------------------------------
Date: Wed, 8 Apr 1998 17:03:13 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Jeremy Hough <jeremyhough@hotmail.com>
Subject: Re: search operator question
Message-Id: <Pine.GSO.3.96.980408170142.20192f-100000@user2.teleport.com>
On Wed, 8 Apr 1998, Jeremy Hough wrote:
> I've read the information in Perlop about the /egimosx options for the
> search operator, however I do not understand them completely. Would
> someone please refer me to a document which explains these?
I don't think there is one. Besides, it would be better to fix perlop to
do its job! :-) In what way do you find it lacking?
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 8 Apr 1998 19:49:54 -0700
From: rokicki@cello.hpl.hp.com (Tom Rokicki)
Subject: Re: serpinski gasket almost-1-liner needs polishing
Message-Id: <6ghd0i$s69@cello.hpl.hp.com>
$s=' 'x 39 .'*';$s=' 'x 79|substr' '.$s^$s,1,79while print"$s\n";
------------------------------
Date: 8 Apr 1998 20:08:34 -0700
From: rokicki@cello.hpl.hp.com (Tom Rokicki)
Subject: Re: serpinski gasket almost-1-liner needs polishing
Message-Id: <6ghe3i$so0@cello.hpl.hp.com>
Try this variation (using a screen one character narrower) for what happens
when the gasket bounces off the edge. What is the period?
$s=' 'x39 .'*';$s=' 'x78|substr' '.$s^$s,1,78while print"$s\n";
------------------------------
Date: Thu, 09 Apr 1998 00:06:30 GMT
From: jgloudon@manitoba.bbn.com (Jason Gloudon)
Subject: Re: UNIX, system(), and text that isn't output.
Message-Id: <slrn6io433.mp8.jgloudon@manitoba.bbn.com>
Nathaniel Meyers <Nathaniel.Meyers@ucop.edu> wrote:
.
.
>Sometimes UNIX commands write to the screen and this is not regular
>output (usually error or status messages). For instance 'ls gooby' will
>result in 'gooby: No such file or directory'. This isn't "output" and
>so far as I know it can not be captured or forced off. So what is this
>sort of text refered as and how do you force it to not occur?
.
Each UNIX process normally starts with 3 "files", Standard input, output
and error. Standard error is where error messages normally get sent. Each
of these can be redirected independetly of the other.
.
>Here's my problem. I want to write a cgi script that in its execution
>does a system command but the system command (the pgp example) writes
>the @#&% "Creating output file" line which causes the web server out and
>give a server error message every single time.
What you want is to redirect (or even permanently close) stderr.
If you look at `man perlfunc` for the entry for open FILEHANDLE you will see
the code for your script to do this itself, or alternatively you can ask
the shell to redirect it for you by using
system("command 1>/dev/null 2>&1");
--
Jason Gloudon
------------------------------
Date: Wed, 08 Apr 1998 22:14:48 -0500
From: Eugene Sotirescu <eugene@vertical.net>
To: Nathaniel Meyers <Nathaniel.Meyers@ucop.edu>
Subject: Re: UNIX, system(), and text that isn't output.
Message-Id: <352C3D27.743FA1EB@vertical.net>
As you say, this is very much a UNIX question.
To start with, you should pick up some UNIX book and read about the files
that are opened for every command (standard input, standard output and
standard error) and their file descriptors (0 or STDIN, 1 or STDOUT, 2 or
STDERR).
Then read about redirection, and specifically about redirecting to
/dev/null.
I believe you should have your answer then.
If not, you can post to the CGI or UNIX newsgroups.
(Please don't take this in a bad way: given your question, you'd need to
know about these things to understand the answer; and there's nothing Perl
specific in your question).
Eugene
Nathaniel Meyers wrote:
> This is a stupid UNIX question and I'm angry at myself for not knowing
> the answer but sheesh...
>
> Sometimes UNIX commands write to the screen and this is not regular
> output (usually error or status messages). For instance 'ls gooby' will
> result in 'gooby: No such file or directory'. This isn't "output" and
> so far as I know it can not be captured or forced off. So what is this
> sort of text refered as and how do you force it to not occur?
>
> This doesn't just occur when there is an error. Using PGP to encrypt a
> file ('pgpe -r meyers@wahoo.sjsu.edu file1 -o file.pgp') writes a
> "Creating ouput file" line to the screen.
>
> Here's my problem. I want to write a cgi script that in its execution
> does a system command but the system command (the pgp example) writes
> the @#&% "Creating output file" line which causes the web server out and
> give a server error message every single time.
>
> Is there anyway to tell perl (or UNIX) to ignore these comments?
>
> Nathaniel Meyers
> Nathaniel.Meyers@ucop.edu
------------------------------
Date: 8 Apr 98 23:18:51 -0500
From: "Christopher D. Bain" <chfwahoo@entropy.muc.muohio.edu>
Subject: Why am I getting this regexp error?
Message-Id: <1998Apr8.231851.905@nntp.muohio.edu>
I am writing a perl script, and I got this error:
</: unmatched () in regexp at /home/chfwahoo/bin/webspell line 140.
Line 140 is
$newfile =~ /<$match>$after$/s;
I've never gotten an error like this before, and I can't find any help anywhere else. I am manipulating an html file if that
helps at all. Any help on why I am getting this error would be greatly appreciated. Thanx
-Chris
--
*--------------/\--------------===--------------/\--------------*
"How is ED-U-CA-TION supposed to make me feel smarter?"
-Homer J. Simpson
Christopher D. Bain Miami University, Oxford, OH
email: baincd@muohio.edu WWW: http://www.muohio.edu/~baincd
chfwahoo@muc.muohio.edu
*--------------\/--------------===--------------\/--------------*
------------------------------
Date: 09 Apr 1998 00:30:25 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: "Christopher D. Bain" <chfwahoo@entropy.muc.muohio.edu>
Subject: Re: Why am I getting this regexp error?
Message-Id: <3efnimtq.fsf@mailhost.panix.com>
[posted and mailed to cited author]
"Christopher D. Bain" <chfwahoo@entropy.muc.muohio.edu> writes:
> I am writing a perl script, and I got this error:
> </: unmatched () in regexp at /home/chfwahoo/bin/webspell line 140.
> Line 140 is
> $newfile =~ /<$match>$after$/s;
It looks like there are some regex metacharacters in either or both of
$match and $after when that match is performed. You'll want to use
the quotemeta operator, typically spelled in its doublequotish form,
like so:
/<\Q$match\E>\Q$after\E$/s;
Your code sample raises a question: Why are you throwing away the
result of that match? Are you using the $& variable, or its
mischievous twin brothers $` and $' ?
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
------------------------------
Date: Thu, 09 Apr 1998 00:39:53 -0400
From: Dan Boorstein <danboo@negia.net>
To: chfwahoo@muc.muohio.edu
Subject: Re: Why am I getting this regexp error?
Message-Id: <352C5119.667F90F5@negia.net>
Christopher D. Bain wrote:
>
> I am writing a perl script, and I got this error:
>
> </: unmatched () in regexp at /home/chfwahoo/bin/webspell line 140.
>
> Line 140 is
>
> $newfile =~ /<$match>$after$/s;
>
i think you need to look into the values of $match and $after. it is
likely that one of these contains some parenthetical weirdness.
remember that the characters returned from the interpolation are used
in forming the regex. \Q (quotemeta) should be useful here.
cheers,
dan boorstein
------------------------------
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 2279
**************************************