[11727] in Perl-Users-Digest
Perl-Users Digest, Issue: 5327 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 8 07:17:35 1999
Date: Thu, 8 Apr 99 04:00:17 -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, 8 Apr 1999 Volume: 8 Number: 5327
Today's topics:
[Perl] How to find the Perl FAQ <rootbeer&pfaq*finding*@redcat.com>
Re: convert IP to country of origin: See VisualRoute's <cspry@sghms.ac.uk>
Re: Create hyperlink from a table cell to a file.... (Jonathan Stowe)
Re: free computer12 <removethis.Dru@grange.s-gloucs.sch.uk>
Hash databases <adank@statoil.com>
Help! Installation of Perl on IIS4 <hans.hubin@weborigin.be>
Re: HELP!! ON STRING COMPARING <vvb@NO_SPAMibm.net>
Re: How to pass parameters for perl programs under Acti (Jonathan Stowe)
Perl connection to Excel database <Markus.Reiter@dynamic.de>
Re: Perl IDE/GUI for Linux lvirden@cas.org
Re: perlcc error stuartj3054@my-dejanews.com
question on $ENV{'abc'} <lowbc@privylink.com.sg>
Re: question on $ENV{'abc'} (Bart Lateur)
Run Perl script from within Perl script? (Diego Barros)
stumped on regex <ericsm@shell.iafrica.com>
Re: stumped on regex (Bart Lateur)
Thread renamed to: where to find perl programming tools lvirden@cas.org
Re: using "require example.cgi" on NT <indexfinger@usa.net>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 08 Apr 1999 10:24:01 GMT
From: Tom Phoenix <rootbeer&pfaq*finding*@redcat.com>
Subject: [Perl] How to find the Perl FAQ
Message-Id: <pfaqmessage923567041.3213@news.teleport.com>
Archive-name: perl-faq/finding-perl-faq
Posting-Frequency: weekly
Last-modified: 10 Sep 1998
[ That "Last-modified:" date above refers to this document, not to the
Perl FAQ itself! The last major update of the Perl FAQ was in Summer of
1998; of course, ongoing updates are made as needed. ]
For most people, this URL should be all you need in order to find Perl's
Frequently Asked Questions (and answers).
http://cpan.perl.org/doc/FAQs/
Please look over (but never overlook!) the FAQ and related docs before
posting anything to the comp.lang.perl.* family of newsgroups.
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Beginning with Perl version 5.004, the Perl distribution itself includes
the Perl FAQ. If everything is pro-Perl-y installed on your system, the
FAQ will be stored alongside the rest of Perl's documentation, and one
of these commands (or your local equivalents) should let you read the FAQ.
perldoc perlfaq
man perlfaq
If a recent version of Perl is not properly installed on your system,
you should ask your system administrator or local expert to help. If you
find that a recent Perl distribution is lacking the FAQ or other important
documentation, be sure to complain to that distribution's author.
If you have a web connection, the first and foremost source for all things
Perl, including the FAQ, is the Comprehensive Perl Archive Network (CPAN).
CPAN also includes the Perl source code, pre-compiled binaries for many
platforms, and a large collection of freely usable modules, among its
560_986_526 bytes (give or take a little) of super-cool (give or take
a little) Perl resources.
http://cpan.perl.org/
http://www.perl.com/CPAN/
http://cpan.perl.org/doc/FAQs/FAQ/html/
http://www.perl.com/CPAN/doc/FAQs/FAQ/html/
You may wish or need to access CPAN via anonymous FTP. (Within CPAN,
you will find the FAQ in the /doc/FAQs/FAQ directory. If none of these
selected FTP sites is especially good for you, a full list of CPAN sites
is in the SITES file within CPAN.)
California ftp://ftp.cdrom.com/pub/perl/CPAN/
Texas ftp://ftp.metronet.com/pub/perl/
South Africa ftp://ftp.is.co.za/programming/perl/CPAN/
Japan ftp://ftp.dti.ad.jp/pub/lang/CPAN/
Australia ftp://cpan.topend.com.au/pub/CPAN/
Netherlands ftp://ftp.cs.ruu.nl/pub/PERL/CPAN/
Switzerland ftp://sunsite.cnlab-switch.ch/mirror/CPAN/
Chile ftp://ftp.ing.puc.cl/pub/unix/perl/CPAN/
If you have no connection to the Internet at all (so sad!) you may wish
to purchase one of the commercial Perl distributions on CD-Rom or other
media. Your local bookstore should be able to help you to find one.
Another possibility is to use one of the FTP-via-email services; for
more information on doing that, send mail to <mail-server@rtfm.mit.edu>
(not to me!) with these lines in the body of the message, flush left:
setdir usenet-by-group/news.announce.newusers
send Anonymous_FTP:_Frequently_Asked_Questions_(FAQ)_List
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Comments and suggestions on the contents of this document
are always welcome. Please send them to the author at
<pfaq&finding*comments*@redcat.com>. Of course, comments on
the docs and FAQs mentioned here should go to their respective
maintainers.
Have fun with Perl!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Thu, 8 Apr 1999 11:37:31 +0100
From: "Christopher Spry" <cspry@sghms.ac.uk>
Subject: Re: convert IP to country of origin: See VisualRoute's site
Message-Id: <7ei0te$cpf$1@niobium.hgmp.mrc.ac.uk>
<nguyen.van@imvi.bls.com> wrote in message
news:7eg8g3$gnk$1@nnrp1.dejanews.com...
> I just wonder there is any way to convert IP address to country of origin.
... By the way, is
> there any company doing this kind of work ? ..
See VisualRoute <http://www.visualroute.com/technotes.html#modifydb> which
has some information on this topic.
Best wishes,
--
Christopher Spry
cspry@sghms.ac.uk
------------------------------
Date: Thu, 08 Apr 1999 09:07:16 GMT
From: gellyfish@gellyfish.com (Jonathan Stowe)
Subject: Re: Create hyperlink from a table cell to a file....
Message-Id: <370c7132.4425435@news.dircon.co.uk>
On 8 Apr 1999 02:50:00 GMT, "Sheila Eugenio" <seugenio@man.amis.com>
wrote:
>I have this txt file from an extraction. 15,16, etc are workweeks. Now what
>I will do here is parse the file and present it as neatly as I can by using
>a table. I have done that so far. Now the user wants me to create a
>hyperlink for the NO_WIP/INSUF row of digits under each workweek to
>nowip15.txt, nowip16.txt etc. for more info on the data.
>
>This is a rolling info meaning there's a report every week. I wanted it to
>be automated such that whatever the workweek is, the script can adjust to
>it. I was able to create a hyperlink from a cell. But I cannot create a
>hyperlink let's say to <a href =http://company/revenue/nowip$wk.txt >??</a>
>if it will change from time to time. (I hope you got what I am trying to
>say here) :-)
>
This is given no explanation and no warranty:
while ($line = <DATA>) {
chomp $line;
if ($line =~ /^REVENUE/) {
print "<H3>$line</H3>\n";
print "<H5><b>As of $date, Manila</b></H5>\n<p>";
} elsif ($line =~ /^WIP/) {
print "<TABLE>\n";
@heading = split(/ +/, $line);
foreach $head (@heading) {
print "<th bgcolor=FFCCCC>$head</th>\n";
}
} elsif ($line =~ /^SORT/) {
@sort = split(/ +/, $line);
} else {
my $col_count = 0;
print "<TR>\n";
@array = split(/ +/, $line);
foreach $word (@array) {
print "<td><p align=right>\n";
if ( $heading[$col_count] =~ /\d+/ )
{
print "<A
HREF='nowip${heading[$col_count]}.txt'>\n";
print "$word\n</A>\n";
}
else
{
print "$word\n";
}
print "</TD>\n";
$col_count++;
}
print "</TR>\n";
}
}
print "</TABLE>\n";
__END__
REVENUE PLAN (APRIL)
WIP_POSITION DELINQUENT 15 16
17 18 TOTAL %
NO_WIP/INSUF 92.99 246.00 331.26
684.10 816.88 2171.23 15.05
SORT 11.52 312.78 170.81
330.98 462.07 1288.16 8.93
DIEBANK-FTA 5.06 5.97 33.91
109.08 107.49 261.51 1.81.
/J\
------------------------------
Date: Thu, 8 Apr 1999 10:08:44 +0100
From: "Dru" <removethis.Dru@grange.s-gloucs.sch.uk>
Subject: Re: free computer12
Message-Id: <7ehriq$pol$1@panther.rmplc.co.uk>
Now that's what I call spamming
Dru
Richard Taylor wrote in message <7egtrl$5u4$1@garnet.nbnet.nb.ca>...
>Um, Dell is more than 5 years old.
>webmaster <webmaster@cnet.com> wrote in message
>news:7eg4vf$bsp$9@iceman.tac.net...
>> Free Computer at http://giveaways.arecool.net
>>
>> DELL IS GIVING AWAY 500 FREE PENTIUM 500 Computers to celebrate their 5th
>> anniversary.
>>
>> Hurry and if you are one of the first 500 people you win a new
computer!!!
>>
>
>
------------------------------
Date: Thu, 08 Apr 1999 12:13:57 +0200
From: Asbjorn Dankertsen <adank@statoil.com>
Subject: Hash databases
Message-Id: <370C8165.EE023F34@statoil.com>
Why is space never freed from hash databases? I use the DB_File module,
and have biult several databases. If i delete keys in a database, the
database size does not decrease. Why?
-AD
------------------------------
Date: Thu, 8 Apr 1999 11:06:20 +0200
From: "Hans Hubin" <hans.hubin@weborigin.be>
Subject: Help! Installation of Perl on IIS4
Message-Id: <370c718b@news.uk.ibm.net>
Hello,
I'm trying to install activestate Perl on IIS4, with no luck.
- When I map the .pl extension to c:\perl\bin\perl.exe %s %s, the browser
wants to download the .pl file.
- When I map the .pl extension to c:\perl\bin\perlis.dll, most of the perl
scripts work, except one that doesn't produce output (SSI who logs CGI
variables in a flat file). The logging is correct but I get the following
message at the place where I've inserted the SSI :
HTTP/1.1 200 OK Date: Wed, 07 Apr 1999 11:48:16 GMT Server:
Microsoft-IIS/4.0 Content-type: text/html
'd:\websites\website\nl_home.shtml' script produced no output Content-type:
text/html 'd:\websites\website\nl_home.shtml' script produced no output
What did I do wrong ?
Hans Hubin
_________________________________________________
WebOrigin - Website Development - http://www.weborigin.be
------------------------------
Date: Thu, 8 Apr 1999 12:37:39 +0200
From: "Vincent Vanbiervliet" <vvb@NO_SPAMibm.net>
Subject: Re: HELP!! ON STRING COMPARING
Message-Id: <370c8681@news.uk.ibm.net>
One error I see is that $linkname will contain the number of elements of
@_... When you do a $a=@a, $a will contain the number of elements of @a.
Also, instead of writing the foreach line, it could be better written like:
for $i (0 .. ($ii-1)) {
But it might also be interesting if you tell us what this $linkname has to
be, how your sub is called (i.e. what parameters are provided), what exactly
you want to filter out, etc...
<lufan@hotmail.com> wrote in message news:370CE252.61AD@hotmail.com...
> hi all,
>
> I want to filter out a set of string I don't want
> to write to a file by implementing a solution like this,
>
> - filter.log contains lines of string to FILTER OUT,
> 123abcd
> 1234a
> kdfkdfj
> dfkfdsfd
> ...
> ...
>
> filter.log is read by a program like this
>
> open(linkf,"./$linkfilter_file");
> @filter_a=<linkf>;
> close(linkf);
>
> during this program I doing the comparing,
>
> sub skip_this_link{
>
> my($linkname)=@_;
> $ii = scalar (@filter_a);
> foreach($i=0; $i<$ii
+){
> $filter_name = @filter_a[$i];
> # $filter_name = ~s/[\B|\b|\n|\r|\t|\s*|\0]//g;
> if ($linkname=~/$filter_name/ ){ # <----- trouble is here
> return 1; # matched
> }
> }
>
> return 0; # NOT MATCHED
> }
>
>
> As <--- points,
>
> $linkname=~/$filter_name/ always CAN'T match the linkname that
> contains the filter string even they are identical as print out.
>
> But $filtername=~/$linkname/ works as a part of the work I want.
>
> I wonder if there is any tail char in filter string while
> read from the filter.log, thus the the string comparing does not
> work. Will appreciate if you could provide a solution for this.
>
> THANKS
>
>
> lufan
------------------------------
Date: Thu, 08 Apr 1999 08:28:28 GMT
From: gellyfish@gellyfish.com (Jonathan Stowe)
Subject: Re: How to pass parameters for perl programs under ActivePerl?
Message-Id: <370c67ee.2053846@news.dircon.co.uk>
On Thu, 08 Apr 1999 07:26:10 GMT, agniora@usa.net wrote:
>I am using ActivePerl on WinNT platform. But everytime i have to run a script
>i have to type perl myprog.pl but i need to pass some parameters to my
>program, adding parameters to the above line doesnt work cause it gets taken
>as an argument to the perl program not myprog.pl does anyone know any
>workaround to this?
>
Are you sure ?
I Got :
P:\>perl par.pl this is a test
this
is
a
test
With:
P:\>perl -v
This is perl, version 5.005_02 built for MSWin32-x86-object
(with 1 registered patch, see perl -V for more detail)
Copyright 1987-1998, Larry Wall
Binary build 509 provided by ActiveState Tool Corp.
http://www.ActiveState.com
Built 13:37:15 Jan 5 1999
When I ran:
print join "\n",@ARGV;
So it must be something you are doing - but I didnt bring Doris to
work with me so you'll better post some code ...
/J\
------------------------------
Date: Thu, 08 Apr 1999 12:47:04 +0100
From: Markus Reiter <Markus.Reiter@dynamic.de>
Subject: Perl connection to Excel database
Message-Id: <370C9738.68254157@dynamic.de>
Hello!
We plan to develop an (Unix Webserver-)Intranet search mask that has a
database connection to an Excel Database (presumely on a Windows NT
machine).
Would it be possible to use Perl 5.0 together with the DBI and DBD:ODBC
interface to access data via Perl cgi? I'm not that familiar with Excel
and I don't know if there's a database engine in it and how strong it
is.
Or would it be better to import the Excel database file into MS Access
first and use DBD:ODBC on MS Access which is possible according to the
FAQ?
What would be the best option to establish the connection between the
Unix Webserver and the NT computer with the Excel Database?
Thank you very much,
Markus Reiter.
--
________________________________________________________________
Markus Reiter Tel: +49 89 54216617
Dynamic Software GmbH Fax: +49 89 54216610
Hess-Strasse 56, D-80798 Muenchen Email: Markus.Reiter@dynamic.de
------------------------------
Date: 8 Apr 1999 08:30:43 GMT
From: lvirden@cas.org
Subject: Re: Perl IDE/GUI for Linux
Message-Id: <7ehpfj$6u6$1@srv38s4u.cas.org>
According to Sauro Sgatti <sauro@fol.it>:
:Where I find Perl IDE or GUI on Linux ?
Here's one of which I am aware.
What: C-Forge IDE
Where: <URL: http://www.codeforge.com/>
<URL: http://www.codeforge.com/linux/download.html>
Description: Multi-user integrated development environment with
full project management, edit/compile/debug cycle support,
abstraction of the makefile concept, and support for
C/C++, Oracle ProC/C++, Perl, Tcl, Python, Java, Qt, Pascal,
FORTRAN, Modula-2, and assembler.
Both a free and commercial version of this product is available.
Available on Linix Intel and Alpha platforms.
Updated: 02/1999
Contact: <URL: mailto:consult@codeforge.com>
You might also check to see how much of this product might be of use.
What: Source-Navigator
Where: <URL: http://www.cygnus.com/sn/>
Description: Formerly known as PathFinder, a 15 day free evaluation period
license copy of a restricted (50,000 source line limit) version of
the commercial product.
Code analyzer and reverse engineering tool to give
an understanding of C, C++, Java, Tcl, itcl, FORTRAN, COBOL,and
assembly programs.
Includes code parsers, a symbol hierarchy browser, source code editor,
retriever, code metrics, and more.
CAS-GMBH is the distributor for Germany, Austria, and Switzerland.
Updated: 02/1999
Contact: <URL: mailto:sn-support@cygnus.com>
--
<URL: mailto:lvirden@cas.org> Quote: Saving the world before bedtime.
<*> O- <URL: http://www.purl.org/NET/lvirden/>
Unless explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.
------------------------------
Date: Thu, 08 Apr 1999 08:20:09 GMT
From: stuartj3054@my-dejanews.com
Subject: Re: perlcc error
Message-Id: <7ehork$qga$1@nnrp1.dejanews.com>
In article <7cqk9m$a7m$1@nnrp1.dejanews.com>,
vishalb@my-dejanews.com wrote:
>
> >
> > the perplexing part here is the "Couldn't open !". i don't have any idea
what
> > the compiler is unable to open.
> >
>
> perlcc on win32 is broken. What you are seeing is because it couldnot
> construct a valid temporary filename. It is actually something like
> "Couldnot open $tempfilename!", The fixes required are quite minor,so someone
> on win32 should be able to fix it easily.
>
> cheers,
> vishal
>
> -----------== Posted via Deja News, The Discussion Network ==----------
> http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
>
I have 'fixed' perlcc.bat so that it produces executables :@]
However, they are far from perfect. In particular they screw up hashes :@[
OK, so that makes them pretty useless.
==========================================================
To get perlcc to 'work' on NT (perl 5.005_56) with MS VC++
==========================================================
1) In c:\perl\5.00556\bin\perlcc.bat
after line 310:
# _addstuff
add:
my ($tmpprog);
($tmpprog = $sourceprog) =~ s"(.*)[\/\\](.*)"$2";
$tmpfile = "c:/temp/$tmpprog.tst";
$incfile = "c:/temp/$tmpprog.val";
2) In c:\perl\5.00556\bin\perlcc.bat replace line 294: "$Config{cc}
@Config{qw(ccflags optimize)} $incdir @sharedobject s @args $linkargs";
with: "$Config{cc} @Config{qw(ccflags optimize)} $incdir @sharedobject s
@args /link $linkargs";
3) In c:\perl\5.00556\bin\perlcc.bat
replace line 270:
$libdir = "-L$Config{installarchlib}/CORE";
with:
$libdir = "-LIBPATH:$Config{installarchlib}/CORE";
and replace line 288:
$linkargs = "$flags $libdir $lperl @Config{libs}";
with:
$linkargs = "$flags $libdir perl.lib @Config{libs}";
==========================================================
==========================================================
Example of poor hash handling
==========================================================
C:\src>type hash.pl
#!/usr/local/bin/perl -w
%myhash = (
value1 => 1,
value2 => 2
);
print "value1=$myhash{'value1'}\n";
print "value2=$myhash{'value2'}\n";
# END OF hash.pl
C:\src>perl hash.pl
value1=1
value2=2
C:\src>perlcc hash.pl
--------------------------------------------------------------------------------
Compiling hash.pl:
-----------------------------------------------------------------------------
---
Making C(hash.pl.c) for hash.pl! c:\perl\5.00556\bin\MSWin32-x86\perl.exe
-Ic:\perl\5.00556\lib/MSWin32-x86 -Ic:\ perl\5.00556\lib
-Ic:\perl\site\5.00556\lib -I. -MO=CC,-ohash.pl.c hash.pl hash.pl syntax OK
Prescan Saving methods Compiling C(hash) for hash.pl!
c:\perl\5.00556\bin\MSWin32-x86\perl.exe -Ic:\perl\5.00556\lib/MSWin32-x86
-Ic:\ perl\5.00556\lib -Ic:\perl\site\5.00556\lib -I. c:/temp/hash.pl.tst
cl.exe -Od -MD -DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -Od -MDd
-Ic:\perl\5.0 0556\lib\MSWin32-x86/CORE -o hash hash.pl.c /link -nologo
-nodefaultlib -releas e -machine:x86
-LIBPATH:c:\perl\5.00556\lib\MSWin32-x86/CORE perl.lib oldnames. lib
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib sh
ell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib wsock32.lib mpr.lib
winm m.lib version.lib odbc32.lib odbccp32.lib msvcrt.lib Command line
warning D4025 : overriding '/MD' with '/MDd' hash.pl.c hash.pl.c(86) :
warning C4047: 'initializing' : 'char ' differs in levels of ind irection
from 'struct op *' hash.pl.c(87) : warning C4047: 'initializing' : 'char '
differs in levels of ind irection from 'struct op *' hash.pl.c(88) : warning
C4047: 'initializing' : 'char ' differs in levels of ind irection from
'struct op *' hash.pl.c(89) : warning C4047: 'initializing' : 'char ' differs
in levels of ind irection from 'struct op *' hash.pl.c(90) : warning C4047:
'initializing' : 'char ' differs in levels of ind irection from 'struct op *'
hash.pl.c(91) : warning C4047: 'initializing' : 'char ' differs in levels of
ind irection from 'struct op *' hash.pl.c(97) : warning C4047: 'initializing'
: 'char ' differs in levels of ind irection from 'struct op *' hash.pl.c(97)
: warning C4047: 'initializing' : 'char ' differs in levels of ind irection
from 'struct op *' hash.pl.c(343) : warning C4133: '=' : incompatible types -
from 'struct sv *' to 'struct av *'
C:\src>hash.exe
value1=value1=
value2=value2=
This is not a problem with printing alone, since
c:\src>type a.pl
$a="Hello";
print "ANSWER:$a\n";
works (after perlcc a.pl):
C:\src>a.exe
ANSWER:Hello
while
c:\src>type b.pl
%a = ( key1 => Hello );
$a = %a{'key1'};
print "ANSWER:$a\n";
produces:
C:\src>b.exe
ANSWER:0
All of these examples work as expected with perlcc on Solaris 2.6 and
SunOS4.1.3.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 8 Apr 1999 16:47:30 +0800
From: "Marc" <lowbc@privylink.com.sg>
Subject: question on $ENV{'abc'}
Message-Id: <7ehqgd$f9f$1@newton.pacific.net.sg>
Hi,
I am using perl for win32 on a win98 platform.
I was wondering ... how come when I try to get the environment variable
using $ENV{'abc'} in my script. It returns nothing.
I have check the registry with regedit and the 'abc' entry is there.
Where can I go to adjust the environment setting or what should I do?
Would appreciate any help.
Thanks.
Regards,
Marc
------------------------------
Date: Thu, 08 Apr 1999 09:22:14 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: question on $ENV{'abc'}
Message-Id: <370d7513.9395909@news.skynet.be>
Marc wrote:
>I am using perl for win32 on a win98 platform.
>I was wondering ... how come when I try to get the environment variable
>using $ENV{'abc'} in my script. It returns nothing.
>I have check the registry with regedit and the 'abc' entry is there.
I doubt that %ENV uses the registry. Instead, it gives the DOS
(compatible) environment variables. I think. :-)
Bart.
------------------------------
Date: Thu, 08 Apr 1999 10:24:47 GMT
From: alien@netspace.net.au (Diego Barros)
Subject: Run Perl script from within Perl script?
Message-Id: <370c83b7.4167943@news.netspace.net.au>
How can I run a Perl script from within a running Perl script?
Regards,
Diego Barros
------------------------------
Date: 8 Apr 1999 10:05:21 GMT
From: Eric Smythe <ericsm@shell.iafrica.com>
Subject: stumped on regex
Message-Id: <7ehv11$25dg$1@nnrp01.iafrica.com>
Hi
I cannot find a regex that will successfully match the prices
in the file below. To work it needs to create an array that
consists of : @array=($priceA, $stringA, $priceB, $stringB, \
$priceC, $stringC ...$stringN)
.. where $stringX is the stuff inbetween the two prices.
I have marked the prices near the beginning of the sample below
to show what needs to be matched. Digits followed by `mm' or
an `s' are _not_ prices
Thanx for any help
---GRAPEFRUIT: 15 kg cntrs FL U.S. One Star Ruby 36s 12.08-14.27 48s
^^^^^^^^^^^
12.08-14.27 56s .27 Ruby Red 48s 11.53 56s .43-.53 SP
^^^^^^^^^^ ^^^ ^^^^^^
Star Ruby 36s 10.98-12.62 White 48s 10.98-12.62 TU Star Ruby 48s 5.49-8.23
White 48s 5.49-8.23
---LEMONS: 15-16 kg cntrs SP Class I 90s 9.33-10.43 100s 10.15-10.98 120s
10.15-10.98 140s 9.88
---MISC CITRUS: ctns MR Clementine Ortanique 60s 7.41-8.51 75s 8.78-9.33 90s
10.43-11.53 108s 10.43-11.53 SP Clementine 60s 12.08-13.17 80s 12.08-13.17
---APPLES: per kg FR CLASS I Golden Delicious 70-75mm .77-.88 75-80mm .88-.99
Granny Smith 75-80mm .77-.93 GM CLASS I Jonagold 70-80mm .52-.60 80-90mm
.52-.60 Elstar 65-70mm .71-.85 Cox Orange 65-70mm .36-.38 70-80mm .77-.82
IT CLASS I Golden Delicious 70-75mm .66-.69 75-80mm .66-.80 Granny Smith
70-80mm .66-.80 Braeburns 70-75mm 1.18-1.29 75-80mm 1.18-1.29 12.5 kg cntrs
US Pink Lady 64s 18.11-21.96 72s 18.11-21.96 80s 18.11-21.96 18 kg cntrs FR
CLASS I Golden Delicious 88s 13.17-15.37 100s 13.17-15.37 113s 13.17-15.37
Granny Smith 88s 13.17-14.27 100s 13.17-14.27 113s 13.17-14.27
---AVOCADOS: 4 kg cntrs IS Hass 18s 7.14 Reed 12s 7.41-8.51 18s 7.14-7.41 KE
---PEARS: per kg NL Conference .88-.93 12.5 kg cntrs CL Packham Triumph 90s
12.08-13.17 SF Packham Triumph 96s 10.43-11.53 15 kg cntrs CL Red Sensation
80s 9.74-10.98 18 kg cntrs AG Williams 110s 15.37-18.11
---PINEAPPLES: ctns 1 lyr CR 5s 7.96-8.78 fine qual 18.11-19.76 8s 8.51-9.33
fine qual 18.11-19.76 9s fine qual 17.02-18.11
---PLUMS: 5 kg cntrs CL Angeleno 7.68-8.23 5.25 kg cntrs SF Songold 6.59-8.23
Kessleman 6.04-6.59
---GRAPES: 18 lb ctns SF Thompson Seedless 9.83 5 kg cntrs CL
Thompson Seedless 13.52 Flame Seedless 7.37
---KIWIFRUIT: 10 kg cntrs IT Hayward 27s 4.10
---MANGOES: 4 kg cntrs SF Various Varieties 6s 8.19
---NECTARINES: 2.5 kg cntrs SF Various Yellow Flesh Varieties 9.42
---PAPAYA: 4 kg cntrs BR 9s 11.47
---PEACHES: 2.5 kg cntrs CL Various Yellow Flesh Varieties 9.01
---PEARS: per lb UK Conference .29 12 kg cntrs BL Conference 11.06
---PLUMS: 5 kg cntrs CL Laroda 8.19
---GRAPEFRUIT: MARKET RED 27S & 8 5-LB MSHSKS LOWER, OTHERS ABOUT STEADY.
4/5 buctns FL Red 27s 10.00-11.50 mostly 10.50-11.00 32s 10.00 36s 7.50-8.50
40s 7.00-8.00 mostly 7.50 48s 6.50 56s 6.50 White 27s 9.50-10.00
occ 6.50 36s 7.00 40s 6.50-7.50 8 5-lb mshsks FL Red 48 sz 9.50-11.00
mostly 9.50-10.50 White 48 sz 8.00-11.00 mostly 8.50-10.50
---LEMONS: MARKET HIGHER. ctns CA Shprs 1st Grade 140s 16.75-18.00
mostly 17.00-18.00 165s 16.75-18.50 mostly 18.00 200s 14.00-16.75
mostly 15.00-15.50 Shprs Choice 75s 11.00 95s 11.00-12.00 occ 9.50 115s
10.50-13.00 mostly 11.50 140s 12.50-14.00 mostly 13.50-14.00 165s 11.00-14.00
mostly 13.00-14.00 200s 11.00-12.50 mostly 12.00-12.50 235s 10.50
---LIMES: MARKET HIGHER. 10 lb ctns MX Seedless Type 36s 12.00-12.50 42s 11.25
54s 10.75-11.50 mostly 11.00-11.50 63s 12.00 40 lb ctns MX Seedless Type
150s 40.00-42.50 mostly 42.00 175s 40.00 200s 42.00 few 37.00 230s 42.00
some 36.00-37.00 250s 42.00
---MISC CITRUS: MARKET 68S HIGHER, OTHERS ABOUT STEADY. 1/2 ctns CA
Blood Orange 68s 26.50 10 lb ctns FL Kumquats lge 20.00
---ORANGES: MARKET CA HIGHER, FL LOWER, OTHERS ABOUT STEADY. ctns CA
Shprs 1st Grade Navel 48s 22.00 56s 24.00 88s 22.50 Shprs Choice Navel 56s
20.00-21.00 72s 20.00-21.00 88s 18.00-19.00 4/5 buctns FL Valencia 48s
12.00 56s 11.00-12.50 80s 10.00-12.50 mostly 10.00-11.00 100s 9.00-10.50
125s 8.50-10.50 mostly 8.50-9.50 ctns 8 5-lb flmbgs FL Valencia 11.50-13.00
mostly 11.50-12.50 ctns 10 4-lb flmbgs FL Valencia 11.00-13.00
---TANGERINES: MARKET 100-150S HIGHER, 180S LOWER, OTHERS ABOUT STEADY.
4/5 buctns FL Honey 80s 18.50 100s 17.00 120s 15.50 150s 14.50-17.00
mostly 15.00-17.00 180s 13.75-15.00 mostly 14.00-15.00
---BLUEBERRIES: MARKET ABOUT STEADY. flts 12 1/2-pt cups with lids CL med
42.00-45.00 mostly 42.00-43.00 flts 12 4.4-oz cups with lids FL med 34.00
---MISC BERRIES: MARKET GU LOWER, OTHERS ABOUT STEADY.
flts 12 1/2-pt bkts with lids CL AIR Blackberries 23.50 GU AIR Blackberries
21.00 flts 12 5.6-oz cups with lids MX AIR Blackberries 22.00
---RASPBERRIES: MARKET MX HIGHER, CL LOWER, OTHERS ABOUT STEADY.
flts 12 6-oz cups with lids MX AIR Red 40.00 flts 12 5.5-oz cups with lids
CL AIR Red 24.00-27.00 mostly 26.00-27.00 flts 12 5.6-oz cups with lids GU
AIR Red med 22.50
---STRAWBERRIES: MARKET FL LOWER, CA 12 -PT HIGHER, OTHERS ABOUT STEADY.
flts 12 1-pt bkts CA lge 17.00-19.00 one label 25.50 FL med-lge 7.50-8.50
mostly 7.50 flts 8 1-lb cntrs with lids CA med 16.50 one label 25.50 FL med
12.50-14.75 mostly 12.50-13.50
---CANTALOUPS: MARKET DR, GU & HD 15S HIGHER, HD 12 & 18S SHARPLY LOWER,
OTHERS ABOUT STEADY. 1/2 ctns DR 12s 17.00 18s 14.00-16.00 GU 9s 18.50 12s
13.00 15s 15.00-15.75 18s 14.00-17.50 mostly 14.00-16.00 few 12.50 HD 9s
16.00 12s 13.00 15s 15.25 18s 14.00 MX 12s 14.50 15s 14.50-15.50 18s
14.50
---HONEYDEWS: MARKET HIGHER. 2/3 ctns CR 8s 9.00 GU 5s 13.50 6s 10.50 PN 5s
13.50 6s 12.00 8s 11.50-12.50 9s 11.00
---WATERMELONS: MARKET 18-24 LB LOWER, OTHERS ABOUT STEADY. ctns CR
Red Seedless 3s 18.00 MX Various Red Meat Varieties 3s 18.00 4s 16.00-20.00
mostly 18.00-20.00 one label 23.50 Red Seedless 4s 20.50 one label
30.50 per melon MX Various Red Meat Varieties 18-24 lb avg 4.50
---APPLES: MARKET ABOUT STEADY. CONTROLLED ATMOSPHERE STORAGE ctns trypk NY
U.S. ExFcy Red Delicious 125s 10.50 Red Rome 80s 15.00 88s 15.00 100s 15.00
WA WAExFcy Red Delicious 56s 12.50-13.00 64s 13.50 72s 13.50 80s 13.50
88s 13.50 100s 13.00-13.50 113s 13.50 125s 13.50-14.75 Golden Delicious
56s 13.50 64s 15.50 72s 15.50 88s 15.50 100s 15.50 113s 13.00
Granny Smith 64s 16.50-17.50 72s 16.50 80s 16.50-17.50 88s 16.50-18.00
mostly 16.50-17.50 100s 16.50-17.50 125s 16.75 Fuji 48s 24.00 80s 24.00
88s 24.00 100s 20.00 Gala 80s 28.50 88s one label 33.50 100s 23.00 113s
16.00 U.S. ExFcy Granny Smith 72s 17.00 80s 17.00 88s 17.00 100s 17.50
WAFcy Red Delicious 56s 10.50-11.50 64s 10.50-11.50 72s 10.50-11.50 80s
10.50-11.50 88s 10.50-11.50 113s 11.00-11.50 125s 12.50-13.00
Golden Delicious 64s 11.50 72s 11.50 80s 11.00-12.50 88s 11.50 100s 11.50
113s 11.50 125s 11.50-12.50 ctns 12 3-lb flmbgs NY U.S. ExFcy Red Delicious
2 1/2" min 10.00 Red Rome 2 1/2" min 11.50 WA WAExFcy Red Delicious
2 1/2" min 14.50-15.00 Golden Delicious 2 1/2" min 14.50-16.50 Gala
2 1/2" up 19.00-19.75 U.S. ExFcy Granny Smith 2 1/2" up 16.00-18.50
mostly 16.00 ctns 8 5-lb flmbgs WA WAExFcy Red Delicious 2 1/2" up 14.50-15.00
---PEACHES: MARKET 26-28 & 40S HIGHER, OTHERS ABOUT STEADY. ctns 1 lyr trypk CL
Various Yellow Flesh Varieties 26s 18.50 28s 18.50 ctns/lugs 2-lyr trypk CL
Various Yellow Flesh Varieties 40s 18.50 50s 18.50 60s 16.50
---PEARS: MARKET ABOUT STEADY. CONTROLLED ATMOSPHERE STORAGE 4/5 buctns OR
U.S. One D'Anjou 80s 26.50 Bosc 80s 28.50 ORFcy D'Anjou 90s 18.50-19.00
100s 17.50-18.00 110s 17.50-18.00 120s 17.00-18.00 135s 17.00 Bosc 90s
22.00 100s 21.00 Red D'Anjou 90s 23.00
---PINEAPPLES: MARKET HD 14S HIGHER, HI 5S LOWER, OTHERS ABOUT STEADY.
ctns 1 lyr CR golden ripe 5s 24.00-25.00 6s 25.00 HD 7s 8.25 HI golden ripe
5s 24.00-25.00 AIR 6s 11.00 7s 12.00-13.00 ctns 2 lyr CR 10s 14.00-15.00
12s 14.00-15.00 occ 11.50 golden ripe 9s 24.00 HD 12s 13.50 occ
11.50 14s 13.00-14.00
---PLANTAINS: MARKET ABOUT STEADY. 50 lb ctns IMPORT 17.00-18.00 SOME
14.50
---PLUMS: MARKET 70S LOWER, OTHERS ABOUT STEADY. 20 lb ctns CL
Various Varieties 50 sz 14.00 60 sz 12.50-14.50 70 sz 14.00-14.50 80 sz
13.50-14.50 ctns/lugs 2-lyr trypk CL Various Varieties 60s 11.00-12.50
mostly 11.00-12.00 70s 11.00-12.50 mostly 11.00-12.00 80s 12.00
------------------------------
Date: Thu, 08 Apr 1999 10:31:15 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: stumped on regex
Message-Id: <370c8428.13256807@news.skynet.be>
Eric Smythe wrote:
>I cannot find a regex that will successfully match the prices
>in the file below. To work it needs to create an array that
>consists of : @array=($priceA, $stringA, $priceB, $stringB, \
>$priceC, $stringC ...$stringN)
>.. where $stringX is the stuff inbetween the two prices.
Er... may I reverse those? It seems like the "60s" stuff precedes the
prices.
>I have marked the prices near the beginning of the sample below
>to show what needs to be matched. Digits followed by `mm' or
>an `s' are _not_ prices
>
>---GRAPEFRUIT: 15 kg cntrs FL U.S. One Star Ruby 36s 12.08-14.27 48s
> ^^^^^^^^^^^
>12.08-14.27 56s .27 Ruby Red 48s 11.53 56s .43-.53 SP
>^^^^^^^^^^ ^^^ ^^^^^^
>Star Ruby 36s 10.98-12.62 White 48s 10.98-12.62 TU Star Ruby 48s 5.49-8.23
>White 48s 5.49-8.23
>---APPLES: per kg FR CLASS I Golden Delicious 70-75mm .77-.88 75-80mm .88-.99
>Granny Smith 75-80mm .77-.93 GM CLASS I Jonagold 70-80mm .52-.60 80-90mm
Try something like:
@result = /([\d.\-.]+(?:mm|s)) +([\d.\-]+)/g;
Bart.
------------------------------
Date: 8 Apr 1999 08:21:50 GMT
From: lvirden@cas.org
Subject: Thread renamed to: where to find perl programming tools
Message-Id: <7ehouu$6la$1@srv38s4u.cas.org>
Courtesy Cc to author as requested...
According to Jin Shunyao <jinsy@iname.com>:
:Does there have any tool that can manage perl source code like cscope
:for language C?
Unfortunately, your subject line is going to generate a series of answers
quite irrelevant to your request. So if you don't mind, I replaced it
in hopes that someone might actually read this article and answer the question
you asked rather than the question they think you asked...
For the 3 or so people who end up reading this, the cscope mentioned by
Jin is a Unix tool (that ships with Solaris) that provides a curses interface
to a ctags like database. In the database are all the references to all the
variables, procedures, included files, etc. the user wishes to 'browse'.
Cscope then allows one to type in a name and will show the user where the
name appears in the source code tagged. The user then gets a chance to
'scroll' through the references and have cscope drop you into an editor
to see the line in context. The user can do 'replace this name with a
second name' and selectively apply the replace. The user can search for
'strings' as well (for cases where one wants to change comments, or just
see where a word is documented, used in quotes, etc.).
cscope is NOT an IDE in the sense that normally sends unix perl programmers
into spasms. Instead, think of it as a source code browser.
In theory, a perl script could generate a file in the format expected by
cscope and cscope could then be used to browse...
--
<URL: mailto:lvirden@cas.org> Quote: Saving the world before bedtime.
<*> O- <URL: http://www.purl.org/NET/lvirden/>
Unless explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.
------------------------------
Date: Thu, 08 Apr 1999 07:58:27 GMT
From: "IndexFinger.com" <indexfinger@usa.net>
Subject: Re: using "require example.cgi" on NT
Message-Id: <DkZO2.473$zE3.12521@typhoon.nycap.rr.com>
> And if you posted the error someone might be able to tell you what the
> problem is. Most probably that the directory it is in isn't in @INC.
Here is the require code called by admin.cgi:
require 'config.cgi';
Here is the error message:
Can't locate config.cgi in @INC at D:\home\nt133249\bigtalker\admin.cgi line
11.
--
==================================================
BigTalker - http://www.bigtalker.com
Bulletin board software - faster than the UBB
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 5327
**************************************