[19216] in Perl-Users-Digest
Perl-Users Digest, Issue: 1411 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jul 30 21:05:36 2001
Date: Mon, 30 Jul 2001 18:05:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <996541511-v10-i1411@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 30 Jul 2001 Volume: 10 Number: 1411
Today's topics:
ANNOUNCE: Spreadsheet::WriteExcel 0.33 (John McNamara)
Automated data entry in perl <shino_korah@yahoo.com>
Re: Automated data entry in perl <mbudash@sonic.net>
Re: Automated data entry in perl (Tad McClellan)
Re: Bug in fcntl support in 5.6??? <bart.lateur@skynet.be>
Re: Cleaning replacing the value of a constant <godzilla@stomp.stomp.tokyo>
Re: Emal Options Robustness <paul.johnston@dsvr.co.uk>
Re: Entire File Contents from Command line <paul.johnston@dsvr.co.uk>
Re: Escaped period! Someone apprehend it! (Joe McMahon)
FAQ: How can I expand variables in text strings? <faq@denver.pm.org>
Help with an array and foreach <ryan@bong.net>
Re: Help with an array and foreach <holland@origo.ifa.au.dk>
Re: Help with an array and foreach <jeff@vpservices.com>
Re: Help with an array and foreach <godzilla@stomp.stomp.tokyo>
Re: Help with an array and foreach <ren@tivoli.com>
Re: Help with an array and foreach <bcaligari@fireforged.com>
Re: How do I make sure I get all form fields and values <rachel@lspace.org>
more on parsing SGML file (Shang-Lin Chen)
Re: negative lookahead <nospam-abuse@ilyaz.org>
Re: negative lookahead (Craig Berry)
Re: negative lookahead (Randal L. Schwartz)
Re: negative lookahead <bart.lateur@skynet.be>
PERL binaries for version 5.005_03 <vsen@atrenta.com>
Re: PERL binaries for version 5.005_03 (Joe McMahon)
Re: PERL binaries for version 5.005_03 <bart.lateur@skynet.be>
Re: PERL binaries for version 5.005_03 <bcaligari@fireforged.com>
Re: PERL binaries for version 5.005_03 <bart.lateur@skynet.be>
Re: PERL binaries for version 5.005_03 (Joe McMahon)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 30 Jul 2001 22:31:14 GMT
From: jmcnamara@cpan.org (John McNamara)
Subject: ANNOUNCE: Spreadsheet::WriteExcel 0.33
Message-Id: <tmboo378u0ab4c@corp.supernews.com>
======================================================================
ANNOUNCE
Spreadsheet::WriteExcel version 0.33 has been uploaded to CPAN.
======================================================================
NAME
Spreadsheet::WriteExcel - Write formatted text and numbers to a
cross-platform Excel binary file.
======================================================================
CHANGES
Added (hopefully) easier mechanism to add format properties.
Added more page setup options: repeat rows and columns, hide
gridlines, print area, fit to pages and page breaks.
Added more examples.
======================================================================
DESCRIPTION
The Spreadsheet::WriteExcel module can be used create a cross-
platform Excel binary file. Multiple worksheets can be added to a
workbook and formatting can be applied to cells. Text, numbers,
formulas and hyperlinks can be written to the cells.
The Excel file produced by this module is compatible with Excel 5,
95, 97 and 2000.
The module will work on the majority of Windows, UNIX and
Macintosh platforms. Generated files are also compatible with the
Linux/UNIX spreadsheet applications OpenOffice, Gnumeric and XESS.
The generated files are not compatible with MS Access.
This module cannot be used to read an Excel file. See
Spreadsheet::ParseExcel or look at the main documentation for some
suggestions. This module cannot be uses to write to an existing
Excel file.
======================================================================
SYNOPSIS
To write a string, a formatted string, a number and a formula to
the first worksheet in an Excel workbook called perl.xls:
use Spreadsheet::WriteExcel;
# Create a new Excel workbook
my $workbook = Spreadsheet::WriteExcel->new("perl.xls");
# Add a worksheet
$worksheet = $workbook->addworksheet();
# Add and define a format
$format = $workbook->addformat(); # Add a format
$format->set_bold();
$format->set_color('red');
$format->set_align('center');
# Write a formatted and unformatted string
$col = $row = 0;
$worksheet->write($row, $col, "Hi Excel!", $format);
$worksheet->write(1, $col, "Hi Excel!");
# Write a number and a formula using A1 notation
$worksheet->write('A3', 1.2345);
$worksheet->write('A4', '=SIN(PI()/4)');
======================================================================
REQUIREMENTS
This module requires Perl 5.005 (or later) and Parse::RecDescent:
http://search.cpan.org/search?dist=Parse-RecDescent
======================================================================
INSTALLATION
Method 1
Download the zipped tar file from one of the following:
http://search.cpan.org/search?dist=Spreadsheet-WriteExcel
http://theoryx5.uwinnipeg.ca/mod_perl/cpan-search?idinfo=154
ftp://ftp.funet.fi/pub/languages/perl/CPAN/authors/id/J/JM/JMCNAMARA/
Unzip the module as follows or use winzip:
tar -zxvf Spreadsheet-WriteExcel-0.xx.tar.gz
The module can be installed using the standard Perl procedure:
perl Makefile.PL
make
make test
make install # You may need to be root
make clean # or make realclean
Windows users without a working "make" can get nmake from:
ftp://ftp.microsoft.com/Softlib/MSLFILES/nmake15.exe
Method 2
If you have CPAN.pm configured you can install the module as
follows:
perl -MCPAN -e "install 'Spreadsheet::WriteExcel'"
Method 3
ActivePerl users can use PPM as follows:
C:\> ppm
PPM> set repository tmp
http://homepage.eircom.net/~jmcnamara/perl
PPM> install Spreadsheet-WriteExcel
PPM> quit
C:\>
If this fails try the following:
PPM>install
http://homepage.eircom.net/~jmcnamara/perl/Spreadsheet-WriteExcel.ppd
If you wish to perform a local PPM install you can get the files
from:
http://homepage.eircom.net/~jmcnamara/perl/Spreadsheet-WriteExcel.ppd
http://homepage.eircom.net/~jmcnamara/perl/Spreadsheet-WriteExcel-0.xx-PPM.tar.gz
======================================================================
AUTHOR
John McNamara (jmcnamara@cpan.org)
--
------------------------------
Date: Mon, 30 Jul 2001 15:48:00 -0700
From: "terminalsplash" <shino_korah@yahoo.com>
Subject: Automated data entry in perl
Message-Id: <9k4o70$fre@news.or.intel.com>
Hi
Is it possible to enter data to a web page automatically, using perl
script or anything else?
Thanks in advance
Shino
------------------------------
Date: Tue, 31 Jul 2001 00:05:34 GMT
From: Michael Budash <mbudash@sonic.net>
Subject: Re: Automated data entry in perl
Message-Id: <mbudash-92FC5F.17054030072001@news.sonic.net>
In article <9k4o70$fre@news.or.intel.com>, "terminalsplash"
<shino_korah@yahoo.com> wrote:
> Hi
>
> Is it possible to enter data to a web page automatically, using perl
> script or anything else?
>
> Thanks in advance
> Shino
>
>
type:
perldoc lwp
at your unix web server's command prompt
hth-
--
Michael Budash ~~~~~~~~~~ mbudash@sonic.net
------------------------------
Date: Mon, 30 Jul 2001 19:49:03 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Automated data entry in perl
Message-Id: <slrn9mbsjf.ea7.tadmc@tadmc26.august.net>
terminalsplash <shino_korah@yahoo.com> wrote:
>
> Is it possible to enter data to a web page automatically, using perl
>script
Yes.
http://search.cpan.org/doc/GAAS/libwww-perl-5.53_94/lib/LWP/UserAgent.pm
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Tue, 31 Jul 2001 00:07:03 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Bug in fcntl support in 5.6???
Message-Id: <tmtbmtkk24nh59l46u6711pvgj1daajsuj@4ax.com>
Bernie Cosell wrote:
>lockfile(filename) or die "Couldn't lock!" ;
>
>print "Say when --- " ;
><STDIN> ;
>exit ;
>
>use Fcntl ;
>
>sub lockfile
>{
> open(FH, "+<$_[0]") or die("Error opening $_[0]: $!"), return undef ;
> my $wrlock = pack("SSLLI", F_WRLCK, 0,0,0,0) ;
> fcntl (FH, F_SETLKW, $wrlock)
> or warn("Error locking: $!\n"), return undef;
> return 1;
>}
Note that this can only lock one file at a time, because your FH is
global.
--
Bart.
------------------------------
Date: Mon, 30 Jul 2001 15:36:04 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Cleaning replacing the value of a constant
Message-Id: <3B65E154.DB927B50@stomp.stomp.tokyo>
Bernie Cosell wrote:
(snipped)
> In my other thread [on problems with fcntl file locking] I discovered that
> in my Perl installation, the constant F_SETLKW has the wrong value
Perhaps the wrong value based on system specific variables.
> [probably all the fcntl locking-constants do,
They work ok on Solaris / UNIX at least those I have tested
which does not include your F_SETLKW constant.
> so I'd like to 'correct' that. I tried:
> use Fcntl;
> use constant F_SETLKW => 7 ;
> it didn't work and I'm not all that surprised.
Nor am I surprised.
This may or may not help you. I am running a Win32 box which
does not allow file locking. However, I was able to pull a
few tricks and gleen some information.
Using this syntax and fcntl.pm as is, this is, unmodified,
I receive this error message below:
syntax:
use Fcntl;
use constant F_SETLKW;
message:
"Your vendor has not defined Fcntl macro F_SETLKW, used at test1.pl line 6."
After modifying fcntl.pm for F_SETLKW, I am able to import
into main:: and produce a print, which is snipped a lot here:
FD_CLOEXEC
AutoLoader::
STDOUT
etc ...
F_SETLKW7
etc ...
F_SETLKW
etc ...
F_SETLKW64
etc ...
main::
As you can see, F_SETLKW is successfully imported although I cannot
do any further testing being on a Win32 box.
This is what I did. At line 95 - 96 in fcntl.pm this is found:
95 F_SETLKW
96 F_SETLKW64
This was modified to read:
95 F_SETLKW7
96 F_SETLKW64
You should find this somewhere between lines 90 to 100, inclusive
in your copy of fcntl.pm for modification. Unfortunately, I cannot
determine what number is correct not being able to run this module
on a Win32 box. I tagged on "7" and took a chance. However, this
modification will at least import F_SETLWK into your main package.
Perhaps you can run some tests, run some experiments, and determine
how to define this macro to work on your machine.
Godzilla!
--
This is my test script for printing main:: after
my modification of the fcntl module,
#!perl
print "Content-type: text/plain\n\n";
use Fcntl;
use constant F_SETLKW;
foreach $key_name (keys %main::)
{ print "$key_name \n"; }
exit;
------------------------------
Date: Mon, 30 Jul 2001 13:41:45 +0100
From: Paul Johnston <paul.johnston@dsvr.co.uk>
Subject: Re: Emal Options Robustness
Message-Id: <3B655609.7A4CC51@dsvr.co.uk>
Hi,
> A) Using SMTP to connect directly to the remote MX.
I wrote some code to do this, as part of a web sign-up form. I wanted
the page that came back to them to either say "mail successfully
delivered" or to explain the problem. If you pass the message off to a
smarthost - even on on the local machine - you lose the immediate error
path and rely on bounce messages.
Paul
------------------------------
Date: Mon, 30 Jul 2001 13:21:50 +0100
From: Paul Johnston <paul.johnston@dsvr.co.uk>
Subject: Re: Entire File Contents from Command line
Message-Id: <3B65515E.C6681A79@dsvr.co.uk>
Hi,
> Im trying to let a variable eat the contents of a entire file from the command line
> Whats the shortest way to do this?
The shorted pure perl way I know is this:
use FileHandle;
..
@file = (new FileHandle "filename")->getlines();
Pedants note that this does close the file!
Paul
------------------------------
Date: 30 Jul 2001 18:01:02 -0400
From: mcmahon@tribal.metalab.unc.edu (Joe McMahon)
Subject: Re: Escaped period! Someone apprehend it!
Message-Id: <9k4leu$2fu$1@tribal.metalab.unc.edu>
In article <KhZ67.3944$LP2.416970@bgtnsc06-news.ops.worldnet.att.net>,
Jay <ReplyToTheGroup@DoNotEmailMe.Com> wrote:
>
>Now what I wanted was it to accept numbers which can be either whole numbers
>or decimal numbers(hence the period)...
Take a look at Regexp::Common on CPAN.
#!/usr/bin/perl -w
use Regexp::Common;
while (<STDIN>) {
print "$1" if /($RE{num}{real}|$RE{num}{int})/;
}
--- Joe M.
--
perl -w
print((split //,"\nechle etn sJutaohrPr akr")
[map{splice @_,@_/$^F,$^W}(@_=$%..$^F*$=/5)])
------------------------------
Date: Tue, 31 Jul 2001 00:19:18 GMT
From: PerlFAQ Server <faq@denver.pm.org>
Subject: FAQ: How can I expand variables in text strings?
Message-Id: <aQm97.2$Ivk.171086848@news.frii.net>
This message is one of several periodic postings to comp.lang.perl.misc
intended to make it easier for perl programmers to find answers to
common questions. The core of this message represents an excerpt
from the documentation provided with every Standard Distribution of
Perl.
+
How can I expand variables in text strings?
Let's assume that you have a string like:
$text = 'this has a $foo in it and a $bar';
If those were both global variables, then this would suffice:
$text =~ s/\$(\w+)/${$1}/g; # no /e needed
But since they are probably lexicals, or at least, they could be, you'd
have to do this:
$text =~ s/(\$\w+)/$1/eeg;
die if $@; # needed /ee, not /e
It's probably better in the general case to treat those variables as
entries in some special hash. For example:
%user_defs = (
foo => 23,
bar => 19,
);
$text =~ s/\$(\w+)/$user_defs{$1}/g;
See also ``How do I expand function calls in a string?'' in this section
of the FAQ.
-
Documents such as this have been called "Answers to Frequently
Asked Questions" or FAQ for short. They represent an important
part of the Usenet tradition. They serve to reduce the volume of
redundant traffic on a news group by providing quality answers to
questions that keep coming up.
If you are some how irritated by seeing these postings you are free
to ignore them or add the sender to your killfile. If you find
errors or other problems with these postings please send corrections
or comments to the posting email address or to the maintainers as
directed in the perlfaq manual page.
Answers to questions about LOTS of stuff, mostly not related to
Perl, can be found by pointing your news client to
news:news.answers
or to the many thousands of other useful Usenet news groups.
Note that the FAQ text posted by this server may have been modified
from that distributed in the stable Perl release. It may have been
edited to reflect the additions, changes and corrections provided
by respondents, reviewers, and critics to previous postings of
these FAQ. Complete text of these FAQ are available on request.
The perlfaq manual page contains the following copyright notice.
AUTHOR AND COPYRIGHT
Copyright (c) 1997-1999 Tom Christiansen and Nathan
Torkington. All rights reserved.
This posting is provided in the hope that it will be useful but
does not represent a commitment or contract of any kind on the part
of the contributers, authors or their agents.
04.34
--
This space intentionally left blank
------------------------------
Date: Mon, 30 Jul 2001 22:24:12 GMT
From: "Ryan Gralinski" <ryan@bong.net>
Subject: Help with an array and foreach
Message-Id: <g8l97.60549$d26.495201@news1.wwck1.ri.home.com>
Hi, i have a foreach loop like this
foreach $cover (@covers)
{
}
What i need to know, is how can i start this loop
at $start element of the array
f.e instead of starting at $covers[0] start at $covers[1000]
Ryan
------------------------------
Date: 31 Jul 2001 00:42:25 +0200
From: Steve Holland <holland@origo.ifa.au.dk>
Subject: Re: Help with an array and foreach
Message-Id: <w47elqykpim.fsf@origo.ifa.au.dk>
"Ryan Gralinski" <ryan@bong.net> writes:
> Hi, i have a foreach loop like this
> foreach $cover (@covers)
> {
> }
> What i need to know, is how can i start this loop
> at $start element of the array
> f.e instead of starting at $covers[0] start at $covers[1000]
The quick and dirty anwser is to use a while loop instead of
foreach. For example, the following will start at the 4th element of
the array @x.
#! /usr/local/bin/perl -TW
use strict;
my @x = (1,2,3,4,5);
my $i = 3;
while ($i <= $#x ) {
print "\@x[$i] = @x[$i]\n";
$i++;
}
=====================================================================
To find out who and where I am look at:
http://www.nd.edu/~sholland/index.html
Spammers: Please send spam to: abuse@aol.com and abuse@yahoo.com
=====================================================================
perl -e '$i="\124a\153e\040o\156e\040d\157w";$o="\040\157n\040t\150e\040w\141l\154$/";$O=$i."\156\040\141n\144\040\160a\163s\040i\164\040\141r\157u\156d";$i=$|;$I=$=/$=;$l="\040\142o\164t\154e\163\040\157f\040b\145e\162";while(){$_=($i==$%)?"N":"N-$i";$i++;$_="$_$l$o$_$l$/$O$/N-$i$l$o$/";print;sleep$I}'
------------------------------
Date: Mon, 30 Jul 2001 15:47:37 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: Help with an array and foreach
Message-Id: <3B65E409.1F9C688D@vpservices.com>
Ryan Gralinski wrote:
>
> Hi, i have a foreach loop like this
>
> foreach $cover (@covers)
> {
> }
>
> What i need to know, is how can i start this loop
> at $start element of the array
> f.e instead of starting at $covers[0] start at $covers[1000]
Loop over the numbers of the index, not the contents of the array. The
range operator .. will produce a list of numbers between your starting
point (1000) and your ending point (in this example all the way to the
end of the array):
foreach my $index(1000..$#covers) {
print $cover[$index];
# or whatever
}
--
Jeff
------------------------------
Date: Mon, 30 Jul 2001 16:18:29 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Help with an array and foreach
Message-Id: <3B65EB45.11FE9BAB@stomp.stomp.tokyo>
Ryan Gralinski wrote:
> i have a foreach loop like this
> foreach $cover (@covers)
> {
> }
> What i need to know, is how can i start this loop
> at $start element of the array
> f.e instead of starting at $covers[0] start at $covers[1000]
Due due to perl core automation, you cannot do this
with a foreach loop; it starts at element zero. There
is no trick I know of to do this. Perhaps others know.
There are many ways to do this, without a foreach loop.
Some methods are inefficient, such as shift () to remove
elements. A little more efficient would be to slice your
array and foreach loop this slice. Most likely, your best
choice is a simple for iteration.
A cautionary note on my test script below my signature.
If you are going to shift, unshift, push or pop during
your processing, move my $#Array outside my iteration.
$start_at = 3;
$end_at = $#Array;
for ($iterate = $start_at; $iterate <= $end_at; $iterate++)
You cannot successfully use $#Array inside an iteration if
you will be changing the number of elements contained.
This $end_at variable can be set to whatever, if you wish
to mimic slice behavior.
I have never investigated this, perhaps there is a perl core
default variable which can be changed to modify the start
point for a foreach loop.
I don't cotton much to your email address; it sends a poor message.
Shouldn't your address be, ganjaman@bong.net ?
Godzilla!
--
TEST SCRIPT:
____________
#!perl
print "Content-type: text/plain\n\n";
@Array = qw (zero one two three four five six);
$start_at = 3;
for ($iterate = $start_at; $iterate <= $#Array; $iterate++)
{ print "This is element $iterate: $Array[$iterate]\n"; }
exit;
PRINTED RESULTS:
________________
This is element 3: three
This is element 4: four
This is element 5: five
This is element 6: six
------------------------------
Date: 30 Jul 2001 17:38:02 -0500
From: Ren Maddox <ren@tivoli.com>
Subject: Re: Help with an array and foreach
Message-Id: <m38zh6kppx.fsf@dhcp9-161.support.tivoli.com>
On Mon, 30 Jul 2001, ryan@bong.net wrote:
> Hi, i have a foreach loop like this
>
> foreach $cover (@covers)
> {
> }
>
>
> What i need to know, is how can i start this loop
> at $start element of the array
> f.e instead of starting at $covers[0] start at $covers[1000]
There are several ways depending on what you are really trying to do.
(In fact, depending on that there may be an entirely different
solution.)
foreach my $cover (@covers[1000..$#covers]) { ... $cover ... }
foreach my $i (1000..$#covers) { ... $covers[$i] ... }
for (my $i = 1000; $i < @covers; $i++) { ... $covers[$i] ... }
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: Tue, 31 Jul 2001 01:13:56 -0000
From: "B. Caligari" <bcaligari@fireforged.com>
Subject: Re: Help with an array and foreach
Message-Id: <9k4pek01kjn@enews3.newsguy.com>
"Ryan Gralinski" <ryan@bong.net> wrote in message
news:g8l97.60549$d26.495201@news1.wwck1.ri.home.com...
> Hi, i have a foreach loop like this
>
> foreach $cover (@covers)
> {
> }
>
>
> What i need to know, is how can i start this loop
> at $start element of the array
> f.e instead of starting at $covers[0] start at $covers[1000]
for (my $i = $start; $i <= $#covers; $i++) {
print("$covers[$i]\n");
}
------------------------------
Date: Mon, 30 Jul 2001 23:21:38 +0100
From: Rachel Coleman <rachel@lspace.org>
Subject: Re: How do I make sure I get all form fields and values?
Message-Id: <u0nbmtkuuhqjjcii2hv0ie8u52o32esdem@4ax.com>
On Thu, 26 Jul 2001 22:53:37 -0500, "M Hunt" <mhunt5@nospam.net>
wrote:
>I'm writing out a CSV file which contains all the names and values submitted
>from a form. My question is: for checkboxes and/or fields that were not
>answered, I get nothing back. This considered, how do I maintain the
>integrity of my fields in the CSV. What I need to do is somehow append a ",
>NULL" or something when fields are not filled in. This gets difficult when
>nothing is returned; with a checkbox for example.
>
>Also, I just saw in another thread where someone was saying that I can't
>even count on the form fields being returned in a particular order. How is
>this typically handled -- anyone with a code sample or something?
Assuming the form you mention is from a web page, use CGI and untaint
all your variables (you *are* using taint on cgi scrips?)
e.g. (incomplete and untested, meant as an example)
#!/usr/bin/perl -wT
use CGI;
use strict;
my $q = CGI->new();
my ( $var_a ) = $q->param('var_a') =~ /^(\d)+$/;
... etc for $var_b, $var_c etc
Then
my $csv = "$var_a, $var_b, $var_c, ...";
You may of course have more tests you wish to carry out before writing
the CSV file, and perhaps insist on more information before you allow
the user to think they are finished. But I hope this gives you a
start.
Best wishes,
Rachel
------------------------------
Date: 30 Jul 2001 16:14:42 -0700
From: schen@caltech.edu (Shang-Lin Chen)
Subject: more on parsing SGML file
Message-Id: <ced2ab2d.0107301514.6d044808@posting.google.com>
In my SGML file, I use tags that specify when an argument is repeated,
as in:
<arg choice="req" rep="repeat">repeated_arg=<replaceable>val</replaceable></arg>.
I want to add an ellipsis (...) after "val" before removing the SGML
tags so that the final output will be:
repeated_arg=val... .
I read all the data from the SGML file into a string called $data and
then used regular expressions to format $data. I tried the regular
expression:
$data =~ s/(<\s*arg[\w\s\"=]*[\"]?\s*repeat\s*[\"]?[\w\s\"=]*>)([\w\W]*)(<s*replaceable\s*>)([\w\W]*)(\W+replaceable\s*>)/$1$2$3$4\.\.\.$5/gi;
to add the ellipsis, but the ellipsis was added in front of the last
</replaceable> tag in the file, not the correct </replaceable> tag. To
clarify what I mean, there was another arg statement later in the SGML
file:
<arg choice="opt">other_arg=<replaceable>value</replaceable></arg>.
After being formatted, $data contained:
repeated_arg = val
and
other_arg=value...
instead of what I originally wanted. The regular expression seemed to
have skipped to the later </replaceable> tag. How can I fix this
problem?
------------------------------
Date: Mon, 30 Jul 2001 22:39:42 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: negative lookahead
Message-Id: <9k4nne$1j9p$1@agate.berkeley.edu>
[A complimentary Cc of this posting was sent to
mike
<rafalam@cadmus.com>], who wrote in article <bcffa3aa.0107300511.7dadb4b8@posting.google.com>:
> I want to match a string that starts with "aaa" and ends with "bbb" as
> long as the is no "zzz" between aaa and bbb.
>
> My attempt:
>
> $mystring =~ m/aaa.*?(?!zzz)bbb/si;
This is not possible to do (correctly ;-) with the current REx engine.
My "onion rings" proposal would code it as
(?<> aaa .*? bbb
&&! zzz
)
Ilya
------------------------------
Date: Mon, 30 Jul 2001 23:05:37 -0000
From: cberry@cinenet.net (Craig Berry)
Subject: Re: negative lookahead
Message-Id: <tmbq21qnor5d3e@corp.supernews.com>
mike (rafalam@cadmus.com) wrote:
: I want to match a string that starts with "aaa" and ends with "bbb" as
: long as the is no "zzz" between aaa and bbb.
/^aaa(?!.*zzz).*bbb$/
--
| Craig Berry - http://www.cinenet.net/~cberry/
--*-- "Brute force done fast enough looks slick."
| - William Purves
------------------------------
Date: 30 Jul 2001 16:15:58 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: negative lookahead
Message-Id: <m1wv4q100h.fsf@halfdome.holdit.com>
>>>>> "Ilya" == Ilya Zakharevich <nospam-abuse@ilyaz.org> writes:
>> I want to match a string that starts with "aaa" and ends with "bbb" as
>> long as the is no "zzz" between aaa and bbb.
Ilya> This is not possible to do (correctly ;-) with the current REx engine.
So this isn't "correctly"?
/aaa((?!zzz).)*?bbb/s
Sure, it's inching a character at a time, but it does the job.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Tue, 31 Jul 2001 00:04:52 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: negative lookahead
Message-Id: <8itbmt89u7daa13s6aur6m1smk8b3stqm5@4ax.com>
Craig Berry wrote:
>mike (rafalam@cadmus.com) wrote:
>: I want to match a string that starts with "aaa" and ends with "bbb" as
>: long as the is no "zzz" between aaa and bbb.
>
> /^aaa(?!.*zzz).*bbb$/
Nope. That won't match anything in
aaa====bbb==zzz
either.
The problem is that the lookbehind should be restricted to inside the
candidate for the match.
--
Bart.
------------------------------
Date: Mon, 30 Jul 2001 15:50:33 -0700
From: Vishwanath Sen <vsen@atrenta.com>
Subject: PERL binaries for version 5.005_03
Message-Id: <3B65E4B8.A7CC727F@atrenta.com>
Hi Friends,
Can someone please point me to the web-site from where I can download
binaries for Perl version 5.005_03 for platforms - Solaris, HPUX and
Linux ? Any hint or suggestions would be greatly appreciated.
Thanks in Advance,
- Vishwanath Sen.
------------------------------
Date: 30 Jul 2001 18:57:49 -0400
From: mcmahon@tribal.metalab.unc.edu (Joe McMahon)
Subject: Re: PERL binaries for version 5.005_03
Message-Id: <9k4opd$3cu$1@tribal.metalab.unc.edu>
------------------------------
Date: Tue, 31 Jul 2001 00:09:14 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: PERL binaries for version 5.005_03
Message-Id: <8qtbmt479bca4uchc1u71a2qi4vq5mgcgl@4ax.com>
Vishwanath Sen wrote:
> Can someone please point me to the web-site from where I can download
>binaries for Perl version 5.005_03 for platforms - Solaris, HPUX and
>Linux ? Any hint or suggestions would be greatly appreciated.
Check the ports section on CPAN.
<http://www.cpan.org/ports/index.html>
--
Bart.
------------------------------
Date: Tue, 31 Jul 2001 01:16:44 -0000
From: "B. Caligari" <bcaligari@fireforged.com>
Subject: Re: PERL binaries for version 5.005_03
Message-Id: <9k4pjs01krt@enews3.newsguy.com>
"Vishwanath Sen" <vsen@atrenta.com> wrote in message
news:3B65E4B8.A7CC727F@atrenta.com...
> Hi Friends,
>
> Can someone please point me to the web-site from where I can download
> binaries for Perl version 5.005_03 for platforms - Solaris, HPUX and
> Linux ? Any hint or suggestions would be greatly appreciated.
>
http://www.perl.com/pub/a/language/info/software.html
links to the source, and references to binaries
------------------------------
Date: Tue, 31 Jul 2001 00:18:00 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: PERL binaries for version 5.005_03
Message-Id: <p6ubmtse49lv7900jvpmam6i59v2ekh3pl@4ax.com>
Bart Lateur wrote:
>> Can someone please point me to the web-site from where I can download
>>binaries for Perl version 5.005_03 for platforms - Solaris, HPUX and
>>Linux ? Any hint or suggestions would be greatly appreciated.
>
>Check the ports section on CPAN.
>
> <http://www.cpan.org/ports/index.html>
I should have been clearer. You'll find links to the latest perl
binaries here. But if you go to the directories from the URL's where you
can get them from, you'll likely find more there, including older
versions.
Just as a test, I followed one of those links. And where did it bring
me? Here:
<http://people.netscape.com/richm/nsPerl/>
Lo and behold: 5.005_03 for all of Linux, Solaris, HPUX are available.
--
Bart.
------------------------------
Date: 30 Jul 2001 19:03:21 -0400
From: mcmahon@tribal.metalab.unc.edu (Joe McMahon)
Subject: Re: PERL binaries for version 5.005_03
Message-Id: <9k4p3p$3p4$1@tribal.metalab.unc.edu>
[apologies for the empty post previously ... ]
In article <3B65E4B8.A7CC727F@atrenta.com>,
Vishwanath Sen <vsen@atrenta.com> wrote:
> Can someone please point me to the web-site from where I can download
>binaries for Perl version 5.005_03 for platforms - Solaris, HPUX and
>Linux ? Any hint or suggestions would be greatly appreciated.
You'll probably be best off building it yourself on the desired platforms.
Hoewever, if you can't (Solaris) or don't want to (Linux), I suggest trying
rpmfind.com for Linux (if you're using Debian, you can convert the RPMs to
.deb files with alien), and www.sunfreeware.com for Solaris.
--- Joe M.
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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.
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 V10 Issue 1411
***************************************