[13590] in Perl-Users-Digest
Perl-Users Digest, Issue: 1000 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 6 12:05:45 1999
Date: Wed, 6 Oct 1999 09:05:24 -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: <939225924-v9-i1000@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Wed, 6 Oct 1999 Volume: 9 Number: 1000
Today's topics:
[OFFTOPIC] Tad's Back! WAS:Regexp/Interpolation questio <sariq@texas.net>
Re: [OFFTOPIC] Tad's Back! WAS:Regexp/Interpolation que <uri@sysarch.com>
Re: Before I leave, one more comment. (Mark W. Schumann)
buffers and serial ports <jerry@ajc.com>
Re: Caliing method by reference with arrow operator (Greg Bacon)
Checking for processes mazachan@yahoo.com
Re: checking for string in multiple line scalar (Tad McClellan)
Command line script vs modules/subroutines (Ric Hotchkiss)
DBD:MySQL install problems. <kangas@anlon.com>
Font question kh@prontomail.com
Re: fork & NT Perl <theglauber@my-deja.com>
Re: fork & NT Perl <dan@tuatha.sidhe.org>
Re: how does her butt taste? (Greg Bacon)
Re: HTML to ASCII (John Porter)
inserting new character <r42317@email.sps.mot.com>
Re: Killfiles <kperrier@blkbox.com>
Re: Need help with using "format" for String <aqumsieh@matrox.com>
perl 4.0.1.8 build 3 Patch level 36 (Alexandre Amelin)
Perl Libraries <robert@bos.nl>
Re: Perl Libraries (Anno Siegel)
Re: Perl Libraries (Bill Moseley)
Re: Perl Libraries (M.J.T. Guy)
Perl WildCards ??? HELP <aecraigNOaeSPAM@ingr.com.invalid>
Re: Perl WildCards ??? HELP <uri@sysarch.com>
Re: Perl WildCards ??? HELP (Larry Rosler)
Re: Perl WildCards ??? HELP <kangas@anlon.com>
Re: Perl WildCards ??? HELP <msalter@bestweb.net>
Re: Perl WildCards ??? HELP <sariq@texas.net>
Perlscript/DBI/ASP Internal Error <fx77@dial.pipex.com>
Please HELP with JPL jbell@263.net
Re: print (join ':',@y)," missing\n" (Was: bug or featu (Tad McClellan)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 06 Oct 1999 09:14:26 -0500
From: Tom Briles <sariq@texas.net>
Subject: [OFFTOPIC] Tad's Back! WAS:Regexp/Interpolation question
Message-Id: <37FB5942.164A05C7@texas.net>
Tad McClellan wrote:
>
<snipped a post by Tad>
So who won the newsgroup pool? :)
- Tom
------------------------------
Date: 06 Oct 1999 11:13:43 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: [OFFTOPIC] Tad's Back! WAS:Regexp/Interpolation question
Message-Id: <x7puysr07s.fsf@home.sysarch.com>
>>>>> "TB" == Tom Briles <sariq@texas.net> writes:
TB> Tad McClellan wrote:
>>
TB> <snipped a post by Tad>
TB> So who won the newsgroup pool? :)
i don't know about you but i emailed a reply to him last night. do i win
for that?
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: 6 Oct 1999 09:17:26 -0400
From: catfood@apk.net (Mark W. Schumann)
Subject: Re: Before I leave, one more comment.
Message-Id: <7tfi56$mgu@junior.apk.net>
In article <XnSH3.159$AH1.189811@news.abs.net>,
Eric Seiler <Webmaster@copscorp.com> wrote:
>The business that I am in is not dependent on myself acquiring a programmer.
>Finding one in this situation would be a great advantage, but I can just
>wait for my current revenue stream to broaden to the point where I can
>justify hiring a programmer.
This really does sound like a project that needs to be self-funded by
your company. Right now you can't afford to do it, and that's fine.
Wait until you can.
------------------------------
Date: Wed, 06 Oct 1999 14:25:01 GMT
From: Jerry Lipsky <jerry@ajc.com>
Subject: buffers and serial ports
Message-Id: <37FB5BDE.7A1D4BAD@ajc.com>
Hi,
I've written perl code that captures incoming data on a serial port.
It seems to work fine except I just discovered there's a buffer of data
hanging around that the code doesn't see until more data pushes it
through. Anybody know where, in a solaris 2.6 system, this might be
occurring and how do I get around it?
Here's the code. The x'01 is "start-of-data" while the x'04 is
"end-of-data".
do
{
$file_text .= $buffer;
$buffer = <FEED>;
} until ( $buffer =~ /\04/o) ;
Thanks for any advice,
Jerry Lipsky
Atlanta Journal & Constitution
jerry@ajc.com
------------------------------
Date: 6 Oct 1999 15:04:45 GMT
From: gbacon@ruby.itsc.uah.edu (Greg Bacon)
Subject: Re: Caliing method by reference with arrow operator
Message-Id: <7tfoed$4gv$5@info2.uah.edu>
In article <939208052.322601@stalker.alfacom.net>,
"Igor V. Solodovnikov" <siv@helpco.kiev.ua> writes:
: Is it possible to call method if i have only a reference to it?
Yup.
#! /usr/bin/perl -w
use strict;
{
package Foo;
my $count = 0;
sub new {
my $class = shift;
bless { COUNT => $count++ } => $class;
}
sub count {
$_[0]->{COUNT};
}
}
package main;
my @foos = (Foo->new, Foo->new, Foo->new);
for (@foos) {
my $meth = $_->can('count');
if ($meth) {
print "$_->\$meth() = ", $_->$meth(), "\n";
}
else {
print "$_ can't count. :-(\n";
}
}
Enjoy,
Greg
--
She hates testicles, thus limiting the men she can admire to Democratic
candidates for president.
-- John Greenway, "The American Tradition",
on feminist Elizabeth Gould Davis
------------------------------
Date: Wed, 06 Oct 1999 14:49:07 GMT
From: mazachan@yahoo.com
Subject: Checking for processes
Message-Id: <7tfngt$s3j$1@nnrp1.deja.com>
Hi, I am fairly new to perl and I was wondering, is there a way to
continuously check for processes that are running without making a
system call to "ps" and just putting it into a loop? I am looking for a
more efficient way of doing this. Thanks.
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 6 Oct 1999 06:46:52 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: checking for string in multiple line scalar
Message-Id: <sa9ft7.peh.ln@magna.metronet.com>
Fokko Wesselius (fokko.wesselius@ict.nl) wrote:
: I have a question. Is there a easy way to check for a string inside a scalar
: which has multiple line's.
Yes.
You do it the same way as you would if it was a single line!
"multiple lines" does not change the approach...
------------------------
#!/usr/bin/perl -w
use strict;
my $text = "
gdfgdfgdfgdfg\n
dfg\n
string\n
dfg\n
dfg\n
string\n
dsdfsdfsd\n"; # why the blank lines between each line?
my $cnt=0;
$cnt++ while $text =~ /string/g;
print "found string: $cnt times !\n";
$text = 'gdfgdfgdfgdfg dfg string dfg dfg string dsdfsdfsd';
$cnt=0;
$cnt++ while $text =~ /string/g;
print "found string: $cnt times !\n";
------------------------
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 6 Oct 1999 13:35:53 GMT
From: inhotch@sdrc.com (Ric Hotchkiss)
Subject: Command line script vs modules/subroutines
Message-Id: <7tfj7p$2kn@nfs0.sdrc.com>
I am new to perl and am trying to convert a bunch of ksh scripts to perl. A lot
of these scripts are utilities called by many others, but can also be used
alone on the command line. I am trying to optimize the performance on WinNT, so
am trying to eliminate as many new processes as possible. Using zsh/ksh and gnu
exe's on WinNT is very slow, my first perl test conversion is 10x faster.
The main question I have about perl: is there a way to create a script that can
be used on the command line and also used in another perl script (without
invoking another perl process (i.e. system or ``)), or will I have to create
the utilities as modules and write wrapper scripts for command line use?
Thanx.
Ric
--
]---------------------------------------------------------------------------
] Ric Hotchkiss (513)576-2924 (ric.hotchkiss@sdrc.com)
] The views expressed here do not necessarily represent those of my employer
] BTW Eric Riis Hotchkiss is an anagram for: sickest Irish choir
------------------------------
Date: Wed, 06 Oct 1999 09:58:59 -0500
From: Kangas <kangas@anlon.com>
Subject: DBD:MySQL install problems.
Message-Id: <37FB63B3.E5322723@anlon.com>
I installed the MySQL server and client using the RPM's. I go tthe DBI
installed but when it comes to the mSQL/MySQL installation it is asking
me for the MySQL.h file. I grabed it from the tar.gz file. I created the
'include' directory and stuck it in there. The next question asks for
the libmysqlclient.a or libmysqlclient.so file and these are not in the
installed directory or in the MySQL.version.src.rpm file that I
downloaded.
I tried to run the install for the mysql.stuff.src.rpm but nothing
happened. I was hoping that it would install the source files. I managed
to grab and gunzip the src.tar.gz file and copied the source into my
install directory but this accomplished nothing but filing up my drive
and getting the mysql.h file for me.
1.) Is it ok to find these files and plug'em in?
2.) Where do I find the libmysqlclient.so file?
Thanks
--
Michael Kangas
kangas@anlon.com
------------------------------
Date: Wed, 06 Oct 1999 12:59:05 GMT
From: kh@prontomail.com
Subject: Font question
Message-Id: <7tfh2h$n1r$1@nnrp1.deja.com>
I need to develop a page for my company's intranet. The Graphic
Designers want something à la www.eyewire.com/type/viewer, where they
enter text, select a font (from the corporate collection) and instantly
receive a sample of the text in their font. I can see that Eyewire has
created a graphic image of the text sample.
What direction should I proceed in? Has anyone seen something
similar/remotely close that I could modify to my own ends?
Thanks in advance
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 06 Oct 1999 13:33:28 GMT
From: The Glauber <theglauber@my-deja.com>
Subject: Re: fork & NT Perl
Message-Id: <7tfj38$onn$1@nnrp1.deja.com>
In article <ZkHK3.20$tL2.1617@newshog.newsread.com>,
scott@aravis.softbase.com (Scott McMahan) wrote:
[...]
> I would like to see how anyone could write a working fork() call in
NT --
> when there's a Perl version that supports it *NATIVELY*, not via a
UNIX
> runtime emulation system, I will be the first to download the code and
> see what they did.
Believe it or not, this is scheduled for one of the next Perl releases,
as part of a colaboration between Activestate and the Evil Empire.
From what i heard, they will use threads and the "multiplicity" feature
(which enables several interpreters to coexist in the same
application). I'm guessing that they will create a new thread,
duplicate the current interpreter and all its state (variables, etc,
and start a new interpreter on a separate thread. (just a guess)
I wouldn't want to be coding this, but i'll be one of the first to
download it when it's done!
glauber
--
Glauber Ribeiro
theglauber@my-deja.com
"Opinions stated are my own and not representative of Experian"
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 06 Oct 1999 14:01:55 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: fork & NT Perl
Message-Id: <nDIK3.6158$S32.15232@news.rdc1.ct.home.com>
The Glauber <theglauber@my-deja.com> wrote:
> From what i heard, they will use threads and the "multiplicity" feature
> (which enables several interpreters to coexist in the same
> application). I'm guessing that they will create a new thread,
> duplicate the current interpreter and all its state (variables, etc,
> and start a new interpreter on a separate thread. (just a guess)
Yup, this is more or less what's on tap. It's not actually all that difficult.
Most of the work's already been done with the thread and multiplicity support.
The interesting bits will be the variable sharing--I'm not sure if Sarathy's
planned on doing a deep copy of the symbol tables and scratchpads, or is going
to go for a 'copy-on-write' scheme. COW's got a significantly lower overhead,
but there are issues either way.
It should defintely be a fun piece of code, for reasonably deranged values
of 'fun'... :-)
Dan
------------------------------
Date: 6 Oct 1999 14:55:29 GMT
From: gbacon@ruby.itsc.uah.edu (Greg Bacon)
Subject: Re: how does her butt taste?
Message-Id: <7tfnt1$4gv$4@info2.uah.edu>
In article <dMwK3.797$ry3.8292@news.rdc1.ne.home.com>,
"George Jempty" <jb4mt@verbatims.com> writes:
: If I'm in their killfile I probably didn't want to hear any of their BS
: anyway but thanks anyway
The "is in the killfile of" relationship is not symmetric.
Greg
--
Beauty is in the eye of the beer holder...
------------------------------
Date: Wed, 06 Oct 1999 15:54:03 GMT
From: jdporter@min.net (John Porter)
Subject: Re: HTML to ASCII
Message-Id: <slrn7vms4p.oc6.jdporter@min.net>
In article <slrn7vl52n.b94.dha@panix7.panix.com>, David H. Adler wrote:
>In article <37fa17dd_1@newsread3.dircon.co.uk>, Jonathan Stowe wrote:
>>In comp.lang.perl.misc John Porter <jdporter@min.net> wrote:
>>>
>>> You think? I'm guessing Logo.
>>
>>That would explain why they couldnt go up stairs ;-}
>
>They must have ported then, as they can, now...
Hmm. I wonder if there is a 3-d version of Logo.
--
John Porter
------------------------------
Date: Wed, 06 Oct 1999 14:44:09 +0800
From: Noira Hadi <r42317@email.sps.mot.com>
Subject: inserting new character
Message-Id: <37FAEFB9.4A360B14@email.sps.mot.com>
I have data as below:
A
B
B
D
A
B
D
I format them to have:
A,B,B,D
A,B,D
The question is how do I format them so that I can have:
A,B,B,D
A,B,C,D
Regards,
hadi
------------------------------
Date: 06 Oct 1999 10:59:27 -0500
From: Kent Perrier <kperrier@blkbox.com>
Subject: Re: Killfiles
Message-Id: <2F13EF520359D6A7.9E9CDC84985F18E3.874BD34549879589@lp.airnews.net>
spamfree@metropolis.net.au (Henry Penninkilampi) writes:
>
> Anyone care to put in a word or two in support of killfiling people?
>
Well, there can be people out there who can cause your blood pressure
to rise just be seeing their name or email address in the list of posters
in a news group. IMO, killfiling people can make your life easer.
Kent
--
They were killing machines. I wanted to be them so bad.
-- Jamie Zawinski
http://www.jwz.org/gruntle/grave.html
------------------------------
Date: Wed, 6 Oct 1999 10:57:02 -0400
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: Need help with using "format" for String
Message-Id: <x3yemf87d1d.fsf@tigre.matrox.com>
pejman@pejman.com writes:
> Now I need to do exactly the same, but instead of writing
> the result into stdout, I want to have it as a $string.
I would use sprintf().
HTH,
--Ala
------------------------------
Date: Wed, 06 Oct 1999 17:38:38 +0200
From: aamelin@mmm.com (Alexandre Amelin)
Subject: perl 4.0.1.8 build 3 Patch level 36
Message-Id: <37FB6CFE.ADAE2902@mmm.com>
Hi,
I'm looking for this version for Windows.
I need to use it for Tivoli integrations.
Some body knows where I can find it.
Thanks,
Hal.
Opinions expressed herein are my own and may not represent those of my employer.
------------------------------
Date: Wed, 06 Oct 1999 16:18:37 +0200
From: Robert Korteweg <robert@bos.nl>
Subject: Perl Libraries
Message-Id: <37FB5A3D.5304AA58@bos.nl>
How do i put a location of a librarie in my perl scripts
for example the library GD.pm is used in my script but its directory
isn't one of the standard directorys its
/sites/www/scripts.bos.nl/cgi-bin/lib/
Robert Korteweg
------------------------------
Date: 6 Oct 1999 14:53:01 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Perl Libraries
Message-Id: <7tfnod$co7$1@lublin.zrz.tu-berlin.de>
Robert Korteweg <robert@bos.nl> wrote in comp.lang.perl.misc:
>How do i put a location of a librarie in my perl scripts
>
>for example the library GD.pm is used in my script but its directory
>isn't one of the standard directorys its
>/sites/www/scripts.bos.nl/cgi-bin/lib/
use lib '/sites/www/scripts.bos.nl/cgi-bin/lib/';
That's one way to do it.
Anno
------------------------------
Date: Wed, 6 Oct 1999 08:00:50 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: Perl Libraries
Message-Id: <MPG.12650400f078196a9897dc@206.184.139.132>
Robert Korteweg (robert@bos.nl) seems to say...
> How do i put a location of a librarie in my perl scripts
>
> for example the library GD.pm is used in my script but its directory
> isn't one of the standard directorys its
> /sites/www/scripts.bos.nl/cgi-bin/lib/
perldoc lib
This should be put into the FAQ ;)
--
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.
------------------------------
Date: 6 Oct 1999 16:04:02 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Perl Libraries
Message-Id: <7tfrti$pak$1@pegasus.csx.cam.ac.uk>
Bill Moseley <moseley@best.com> wrote:
>Robert Korteweg (robert@bos.nl) seems to say...
>> How do i put a location of a librarie in my perl scripts
>>
>> for example the library GD.pm is used in my script but its directory
>> isn't one of the standard directorys its
>> /sites/www/scripts.bos.nl/cgi-bin/lib/
>
>perldoc lib
>
>This should be put into the FAQ ;)
But it already is:
perlfaq8: How do I keep my own module/library directory?
Mike Guy
------------------------------
Date: Wed, 06 Oct 1999 07:49:37 -0700
From: ingr <aecraigNOaeSPAM@ingr.com.invalid>
Subject: Perl WildCards ??? HELP
Message-Id: <000b8d9b.ee94fa6b@usw-ex0101-001.remarq.com>
I am certainly a Perl scripting novice and am in need of some
assistance, URGENTLY !!!
What I have is an ASCII file that I need to sort through roughly 340
000 rows, of which randomly spaced throughout are rows of data that I
am trying to pull out and place into a new ASCII file. Each row of
data in my input ASCII file has about 100 characters in it (both
numeric and alphabetic). The data that I need to pull out is entire
lines of data that contain the value of '1200', somewhere within the
row of data.
My problem is that I am unable to figure out what I can use as a
wildcard character to indicate to the Perl Script that the '1200' value
occurs within the row somewhere, with other data in front and behind
the value. I need to find these whole rows containing '1200' and
extract the whole row to another, new ASCII file. I don't know what to
use as wildcards, my thoughts were that I could specify something to
the effect of '*1200*', but this does not compute. I have also tried,
with no sucessful results, '_1200_', '.1200.', '&1200&', '$&1200$&' and
'%1200%', but to no avail.
I am VERY eager to resolve this issue and move on, and therefore would
appreciate ANY support or input that anyone could provide me with.
Thanks...
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
------------------------------
Date: 06 Oct 1999 11:18:30 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Perl WildCards ??? HELP
Message-Id: <x7n1twqzzt.fsf@home.sysarch.com>
>>>>> "i" == ingr <aecraigNOaeSPAM@ingr.com.invalid> writes:
i> I am certainly a Perl scripting novice and am in need of some
i> assistance, URGENTLY !!!
usenet is the wrong place to post for urgent needs.
i> My problem is that I am unable to figure out what I can use as a
i> wildcard character to indicate to the Perl Script that the '1200' value
i> occurs within the row somewhere, with other data in front and behind
i> the value. I need to find these whole rows containing '1200' and
i> extract the whole row to another, new ASCII file. I don't know what to
i> use as wildcards, my thoughts were that I could specify something to
i> the effect of '*1200*', but this does not compute. I have also tried,
i> with no sucessful results, '_1200_', '.1200.', '&1200&', '$&1200$&' and
i> '%1200%', but to no avail.
where did you get the idea that perl uses wildcards? those tries of
yours are very silly looking and very offbase. perl uses regular
expressions. read the document perlre or get a decent book on perl which
will show you how to write one.
and if the problem is just getting the lines with 1200 out, use grep.
remarq and deja, dumb and dumber.
(sorry abigail, i know you are condemned to use remarq)
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Wed, 6 Oct 1999 08:19:23 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Perl WildCards ??? HELP
Message-Id: <MPG.126508486adca2a498a044@nntp.hpl.hp.com>
In article <000b8d9b.ee94fa6b@usw-ex0101-001.remarq.com> on Wed, 06 Oct
1999 07:49:37 -0700, ingr <aecraigNOaeSPAM@ingr.com.invalid> says...
...
> What I have is an ASCII file that I need to sort through roughly 340
> 000 rows, of which randomly spaced throughout are rows of data that I
> am trying to pull out and place into a new ASCII file. Each row of
> data in my input ASCII file has about 100 characters in it (both
> numeric and alphabetic). The data that I need to pull out is entire
> lines of data that contain the value of '1200', somewhere within the
> row of data.
Assuming your terms 'row' and 'line' are interchangeable:
/1200/ and print OUT while <IN>;
Needless to say, there are more verbose ways of writing that. :-)
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 06 Oct 1999 10:31:15 -0500
From: Kangas <kangas@anlon.com>
Subject: Re: Perl WildCards ??? HELP
Message-Id: <37FB6B43.7FE682B5@anlon.com>
here is a snippet of code that I am writing from the hip but should give you the
idea of what I think that you are looking for.
open(FILE, "your.filename");
@original = <FILE>;
close(FILE);
open(COPY, ">1200.matches.file");
foreach(@original) {
if($_ =~ /1200/g) {
$dataBefore1200 = $`;
$dataAfter1200 = $';
print COPY "the variables you want printed and in whatever format here.";
}
}
close(COPY);
hope this is what your looking for :o)
ingr wrote:
> I am certainly a Perl scripting novice and am in need of some
> assistance, URGENTLY !!!
>
> What I have is an ASCII file that I need to sort through roughly 340
> 000 rows, of which randomly spaced throughout are rows of data that I
> am trying to pull out and place into a new ASCII file. Each row of
> data in my input ASCII file has about 100 characters in it (both
> numeric and alphabetic). The data that I need to pull out is entire
> lines of data that contain the value of '1200', somewhere within the
> row of data.
>
> My problem is that I am unable to figure out what I can use as a
> wildcard character to indicate to the Perl Script that the '1200' value
> occurs within the row somewhere, with other data in front and behind
> the value. I need to find these whole rows containing '1200' and
> extract the whole row to another, new ASCII file. I don't know what to
> use as wildcards, my thoughts were that I could specify something to
> the effect of '*1200*', but this does not compute. I have also tried,
> with no sucessful results, '_1200_', '.1200.', '&1200&', '$&1200$&' and
> '%1200%', but to no avail.
>
> I am VERY eager to resolve this issue and move on, and therefore would
> appreciate ANY support or input that anyone could provide me with.
>
> Thanks...
>
> * Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
> The fastest and easiest way to search and participate in Usenet - Free!
--
Michael Kangas
Anlon Systems, Inc.
kangas@anlon.com
------------------------------
Date: Wed, 06 Oct 1999 15:35:39 GMT
From: Mike Salter <msalter@bestweb.net>
Subject: Re: Perl WildCards ??? HELP
Message-Id: <Pine.BSF.4.05.9910061130170.5882-100000@monet.bestweb.net>
Assuming the '1200' is a word, try below,
otherwise use pattern /.*1200.*/
-------------------------
#!/usr/bin/perl
$FNAME = "t1200";
open FNAME or die 'oops';
while (<FNAME>) {
if (/\b1200\b/) {
print;
}
}
close FNAME;
On Wed, 6 Oct 1999, ingr wrote:
> Date: Wed, 06 Oct 1999 07:49:37 -0700
> From: ingr <aecraigNOaeSPAM@ingr.com.invalid>
> Newsgroups: comp.lang.perl.misc
> Subject: Perl WildCards ??? HELP
>
> I am certainly a Perl scripting novice and am in need of some
> assistance, URGENTLY !!!
>
> What I have is an ASCII file that I need to sort through roughly 340
> 000 rows, of which randomly spaced throughout are rows of data that I
> am trying to pull out and place into a new ASCII file. Each row of
> data in my input ASCII file has about 100 characters in it (both
> numeric and alphabetic). The data that I need to pull out is entire
> lines of data that contain the value of '1200', somewhere within the
> row of data.
>
> My problem is that I am unable to figure out what I can use as a
> wildcard character to indicate to the Perl Script that the '1200' value
> occurs within the row somewhere, with other data in front and behind
> the value. I need to find these whole rows containing '1200' and
> extract the whole row to another, new ASCII file. I don't know what to
> use as wildcards, my thoughts were that I could specify something to
> the effect of '*1200*', but this does not compute. I have also tried,
> with no sucessful results, '_1200_', '.1200.', '&1200&', '$&1200$&' and
> '%1200%', but to no avail.
>
> I am VERY eager to resolve this issue and move on, and therefore would
> appreciate ANY support or input that anyone could provide me with.
>
> Thanks...
>
>
> * Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
> The fastest and easiest way to search and participate in Usenet - Free!
>
>
>
------------------------------
Date: Wed, 06 Oct 1999 10:40:36 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: Perl WildCards ??? HELP
Message-Id: <37FB6D74.D845589C@texas.net>
ingr wrote:
>
> The data that I need to pull out is entire
> lines of data that contain the value of '1200', somewhere within the
> row of data.
>
Well, if I understand your lengthy explanation,
perldoc perlre
But that's so obvious, I *must* be missing something...
- Tom
------------------------------
Date: Wed, 06 Oct 1999 15:14:20 +0100
From: Technical Services - UK Link <fx77@dial.pipex.com>
Subject: Perlscript/DBI/ASP Internal Error
Message-Id: <37FB593C.37A8C1F6@dial.pipex.com>
Greetings.
I have installed the ActivePerl (www.activestate.com)
application on our IIS4 Server but seem to experience a very
curious problem with the Perl DBI module. I attempt to
access remote data from an Oracle 7.3 database (HP-UX) and
this does work, retrieving data via an SQL query.
However, this works only _ONCE_, i.e. the script displays
the resultset but when it is executed again, the entire
script is sent to the browser page with a message:
---
{...entire script is displayed here...}
error '80004005'
Internal Error
?
---
When I reboot the server and try the page again, it seems to
work, _ONCE_ only before the errors begin to appear again.
Would anybody be able to offer me some advice about how to
get around this problem?
Cheers,
Mamood.
P.S. The code is as follows:
<%@Language=PerlScript%><%
use DBI;
use CGI qw(:standard :html3);
use CGI::Carp qw(fatalsToBrowser);
my $cgi = new CGI('');
$Response->write($cgi->start_html(-"title"=>"A",
-"bgcolor"=>"#ffffff",
-"link"=>"#0080ff",
-"vlink"=>"#0080ff"));
my $host = "ABC";
my $sid = "DEF";
#This works once-only!
my $dbh = DBI->connect( 'dbi:Oracle:',
"auser/apass\@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=$host)(PORT=1521))(CONNECT_DATA=(SID=$sid)))");
$Response->write("<table>");
# Display all query field names.
while (@row_ary = $sth->fetchrow_array) {
$Response->write(Tr( map { td({-"bgcolor"=>"blue"}, $_)} @row_ary ));
}
$Response->write("</table>");
$sth->finish;
$dbh->disconnect;
$Response->write($cgi->end_html);
%>
------------------------------
Date: Wed, 06 Oct 1999 15:17:41 GMT
From: jbell@263.net
Subject: Please HELP with JPL
Message-Id: <7tfp64$ti9$1@nnrp1.deja.com>
Hi,
I was trying to use JPL on both windows and Unix
so first I bought the Perl Resource Kit from Oreilly.
But on the documentation, it didn't mention JPL at all.
Where can I find the Win32 JPL?
Also, Can I download the unix version of JPL from the web
or I have to buy the PERL Resource Kit /Unix Edition from
Oreilly to get it. It seems it comes with PERL 5.005_54
but at www.perl.com it also says it's only available with
the resource Kit.
Please Help!
---
JB
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Wed, 6 Oct 1999 05:18:02 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: print (join ':',@y)," missing\n" (Was: bug or feature?)
Message-Id: <a44ft7.q5h.ln@magna.metronet.com>
John Lin (johnlin@chttl.com.tw) wrote:
: Matthew Bafford <*@dragons.duesouth.net> wrote
: > Alexander Knack <ak@dasburo.de> wrote
: > : why does the following not work?
: > : $x = '23.24.25';
: > : @y = split '.', $x;
: > : print (join " ", @y), "\n";
: >
: > There are actually two bugs in that program.
: > You should be running perl with -w.
: I've got the warning and the surprising result, which I don't understand.
^^^^^^^^^^^^^^^
So, then you should go look it up in perldiag.pod, where *all*
of the messages that perl might issue are documented.
-----------------
=item %s (...) interpreted as function
(W) You've run afoul of the rule that says that any list operator followed
by parentheses turns into a function, with all the list operators arguments
found inside the parentheses. See L<perlop/Terms and List Operators (Leftward)>.
-----------------
: @y=(23,24,25);
: print (join ":", @y)," missing\n";
: Warnings:
: print (...) interpreted as function
: Useless use of a constant in void context
: Does it warn that in
: print join ...
: 'join' is interpreted as function, not a filehandle?
No, it doesn't say join() is interpreted as a function.
It says print() is interpreted as a function.
You are concentrating on the wrong function.
print (1, 2), " missing\n";
would generate the same message...
: Then why is the string " missing\n" in void context?
Perl parses that as:
print((join ":", @y))," missing\n";
^ ^
print() is a "list operator followed by parentheses".
So it expects _all_ of its arguments to be inside of the parentheses...
... so the
," missing\n"
part is sitting there all alone (i.e. in a void context)
The correct way to write the print() is:
print((join ":", @y)," missing\n");
^ ^
So that all of print()'s arguments really _are_ inside the parentheses.
Alternatively, if you avoid having an open parentheses following
the "print" keyword, you avoid running afoul of the above
mentioned rule:
print +(join ":", @y)," missing\n";
In short, it is a precedence problem, as explained in the
latest TPJ article: "Just the FAQs: Precedence Problems"
(cannot give a URL 'cause the scum-sucking EarthWeb folks
have it password protected...
)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 V9 Issue 1000
**************************************