[18529] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 697 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Apr 14 09:05:47 2001

Date: Sat, 14 Apr 2001 06: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: <987253511-v10-i697@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sat, 14 Apr 2001     Volume: 10 Number: 697

Today's topics:
    Re: <defunct> problem with perl cgi DBI/mysql/apache <gellyfish@gellyfish.com>
        A perl 'which' function? <paul@zillywilly.com>
    Re: A perl 'which' function? <joe+usenet@sunstarsys.com>
    Re: Beta Testers/Perl Hackers (Tad McClellan)
    Re: Beta Testers/Perl Hackers (The Mosquito ScriptKiddiot)
        RE: Beta Testers/Perl Hackers <jamesfreeman@MailAndNews.com>
        Elisa <jklunder@xs4all.nl>
        FAQ .: Every post to the comp.lang.perl.misc newsgroup  <faq@denver.pm.org>
    Re: File Upload <ron@savage.net.au>
    Re: Large File Help <Jodyman@usa.net>
    Re: Laziness, Impatience and Hubris  :-) <webmaster@webdragon.unmunge.net>
    Re: Laziness, Impatience and Hubris  :-) <webmaster@webdragon.unmunge.net>
    Re: Laziness, Impatience and Hubris  :-) <gellyfish@gellyfish.com>
        problem opening RC4 encrypted file - test.cgi (0/1) KilerCris@Mail.com
    Re: problem opening RC4 encrypted file - test.cgi (0/1) <cliff@rayman.com>
        problem opening RC4 encrypted file - test.cgi (1/1) KilerCris@Mail.com
    Re: problem opening RC4 encrypted file - test.cgi (1/1) (Logan Shaw)
    Re: RegEx novice (Logan Shaw)
    Re: RegEx novice <bart.lateur@skynet.be>
    Re: RegEx novice (Gwyn Judd)
    Re: RegEx novice <bart.lateur@skynet.be>
    Re: use of uninitialised value in pattern matching? (Gwyn Judd)
        Win32 command.com error <collin@crosslink.net>
    Re: Win32 command.com error <Jodyman@usa.net>
    Re: Win32 command.com error (Jay Tilton)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: 14 Apr 2001 09:52:32 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: <defunct> problem with perl cgi DBI/mysql/apache
Message-Id: <9b96l0$jaa$2@neptunium.btinternet.com>

EvE <eve74@mailandnews.com> wrote:
> Hi,
> 
> I hope I'm in the right groups, I'm apologize if I'm not.
> 
> At this moment my complete web-site is running on 
> linux/apache/perl/DBI/mysql 
> and seems to work fine. But when I take a look at the running processes with 
> top, I see that often cgi scripts become <defunct> for a few seconds 
> although 
> the page is appearing fine on my browser.

<snip>

> == top =======================================================
>   PID USER     PRI  NI  SIZE  RSS SHARE STAT  LIB %CPU %MEM   TIME COMMAND
> 24696 httpd     18   0     0    0     0 Z       0 40.3  0.0   0:00 tst 
> <defunct
> 24676 f1db       6   0  1052 1052   864 R       0 10.0  0.2   0:00 top
> 24256 httpd      6   0 10060 9.8M  9084 S       0  2.2  1.9   0:00 httpd
> ==============================================================
> 
> Within a second the defunct proces is gone. Sometimes I also see one of the 
> httpd process as <defunct> for the same amount of time.
> 
> Can anybody tell me what is going on and how to solve this? I have tried 
> different fetch-methods but that does not seem te be the issue here. I also 
> tried to find same kind of problems via google.com (old deja) but cannot 
> find 
> any solution.
> 
> I hope somebody can help me out because I do not know if my curent hoster 
> likes the behaviour of my current scripts.
> 

Its almost certainly not a major problem - a process will show as <defunct>
until its parent process has called wait() on it to retrieve its exit
status - if the parent process (the main http process) is relatively heavily
loaded and there are a large number of child httpd processes then it may
take a few seconds for it get round to doing this.   Of course if the
zombie (<defunct>) process is hanging around for a long time or for ever
then it could indicate a greater problem.

I have noticed that some programs that use DBI may hang around for a little
longer if they have to wait themselves for a database server process to
shut down - this might also be a contributing factor.

/J\
-- 
Jonathan Stowe                      |
<http://www.gellyfish.com>          |      This space for rent
                                    |


------------------------------

Date: Sat, 14 Apr 2001 00:15:40 -0700
From: paul <paul@zillywilly.com>
Subject: A perl 'which' function?
Message-Id: <3AD7F91C.691F7708@zillywilly.com>

Hello,

Is there a simple one-liner that returns which module was loaded,
similar to the *nix 'which' command?  For example, if I want to find
this out now, I do:

$ perl -d -e 'use DBD::mysql;'

 ...then, at the debugger prompt, type:

v

 ...and search through the output for the module I'm interested in:

<snip>
'DBD/mysql.pm' => '2.0416 from
/opt/local/ashare/lib/perl5/site_perl/5.6.0/sun4-solaris/DBD/mysql.pm'
<snip>

Thanks,
Paul.


------------------------------

Date: 14 Apr 2001 07:12:26 -0400
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: A perl 'which' function?
Message-Id: <m3lmp33fc5.fsf@mumonkan.sunstarsys.com>

paul <paul@zillywilly.com> writes:

> Hello,
> 
> Is there a simple one-liner that returns which module was loaded,
> similar to the *nix 'which' command?  For example, if I want to find
> this out now, I do:
> 
> $ perl -d -e 'use DBD::mysql;'
> 
> ...then, at the debugger prompt, type:
> 
> v
> 
> ...and search through the output for the module I'm interested in:
> 
> <snip>
> 'DBD/mysql.pm' => '2.0416 from
> /opt/local/ashare/lib/perl5/site_perl/5.6.0/sun4-solaris/DBD/mysql.pm'
> <snip>

Take a look at the %INC hash:

  % perl -MDBD::mysql -e 'printf "%16s => %s\n", each %INC for keys %INC'

-- 
Joe Schaefer     "Only presidents, editors and people with tapeworm have the
                              right to use the editorial 'we'."
                                               -- Mark Twain


------------------------------

Date: Sat, 14 Apr 2001 00:16:59 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Beta Testers/Perl Hackers
Message-Id: <slrn9dfjpr.i2f.tadmc@tadmc26.august.net>


[ Please put your comments *following* the quoted text that you
  are commenting on.

  Please do not quote an entire article.

  Please do not quote .sigs.

  Thank you.
]


james freeman <jamesfreeman@MailAndNews.com> wrote:

>What is posting jeopardy style?


It is called that after the TV game show, because that style has
the questions *before* the answer (in reverse chronological order).

   http://www.geocities.com/nnqweb/nquote.html


>What references did I lose?


The 

   References:

news header is supposed to contain the messageID of previous
messages that it refers to (ie. quotes).

It breaks threading the articles when you (or your "newsreader")
do not fill it in correctly.



-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


------------------------------

Date: 14 Apr 2001 07:02:36 GMT
From: anotherway83@aol.com (The Mosquito ScriptKiddiot)
Subject: Re: Beta Testers/Perl Hackers
Message-Id: <20010414030236.00830.00000298@ng-fc1.aol.com>

>use   lib sub {($\) = split /\./ => pop; print $"};
>eval "use Just" || eval "use another" || eval "use Perl" || eval "use
>Hacker";

ms/mrs abigail <insert lastname here>, i've gotta admit, ur signatures kick
major ass

peace


The Mosquito ScriptKiddiot
Championing the Cause of Mosquitoes in Technology


------------------------------

Date: Sat, 14 Apr 2001 08:47:37 -0400
From: james freeman <jamesfreeman@MailAndNews.com>
Subject: RE: Beta Testers/Perl Hackers
Message-Id: <3B042A00@MailAndNews.com>

>===== Original Message From tadmc@augustmail.com =====

>james freeman <jamesfreeman@MailAndNews.com> wrote:
>
>>What is posting jeopardy style?
>
>It is called that after the TV game show, because that style has
>the questions *before* the answer (in reverse chronological order).
>
>   http://www.geocities.com/nnqweb/nquote.html

Thanks for the link it was very useful.

>>What references did I lose?
>
>The References:
>
>news header is supposed to contain the messageID of previous
>messages that it refers to (ie. quotes).
>
>It breaks threading the articles when you (or your "newsreader")
>do not fill it in correctly.
>

I am using an online newsreader as my ISP does not support newsgroups. 
That's 
what you get when you live in the sticks :-(

As far as I can see I do not have the option to include references but note 
that the threading of this thread seems to appear intact?? Could anyone 
reccomend an online newsreader that properly supports references?

Off topic, etiquette related

Question: When someone has been kind enough to post a reply, to which a 
resonse to the group is to be posted, is it considered bad form to send a CC 
of this response directly to the person who has replied to let them know you 
have read their reply and appreciate their time and effort or do you not CC 
and just let them read it on the group if they want?

Cheers

James



------------------------------

Date: Sat, 14 Apr 2001 14:18:55 +0200
From: "Jan Klunder" <jklunder@xs4all.nl>
Subject: Elisa
Message-Id: <9b9fsj$m6b$1@news1.xs4all.nl>

Because of the continuing interest in Elisa and Domain Orientation we have
improved the facilities for the visitors of the Elisa website
 http://www.xs4all.nl/~jklunder ) to share their views and opinions with
other visitors.

Jan Klunder







------------------------------

Date: Sat, 14 Apr 2001 12:17:05 GMT
From: PerlFAQ Server <faq@denver.pm.org>
Subject: FAQ .: Every post to the comp.lang.perl.misc newsgroup consumes the time and
Message-Id: <5dXB6.959$T3.193098240@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.

+
Every post to the comp.lang.perl.misc newsgroup consumes the time and
effort of readers all over the world who pay for their Internet access
just as you do. That's OK, because mutual support is what USENET is
all about. But it only works if posters check out other resources
first!

Please make an effort to find the answer to your question on your own
before posting. The resources below will help you.

BEFORE you post to this newsgroup, look at the following checklist:

1. The latest stable release of Perl is 5.6.0.  The latest maintenance
release of the 5.004 track is 5.004_05, for the 5.005 track is
5.005_03.  You can download them from
	http://www.cpan.org/src/
(look in ftp://ftp.perl.com/perl/ for a list of FTP-based mirrors)

2. comp.lang.perl.misc is for questions on the Perl language.  Try
comp.infosystems.www.authoring.cgi for questions on the CGI part of
CGI scripts.  The two leading blocks of reusable code for CGI purposes
are CGI.pm, at
	http://www.genome.wi.mit.edu/ftp/pub/software/WWW/cgi_docs.html
and cgi-lib.pl, at
	http://cgi-lib.berkeley.edu
You might also want to check out libwww-perl at
	http://www.linpro.no/lwp/
If you are having problems with a CGI script, look through
	http://language.perl.com/CPAN/doc/FAQs/cgi/idiots-guide.html

3. Are you using the following?
	#!/usr/bin/perl -w
	use diagnostics;
	use strict;
"-w" turns on all sorts of warnings about probable errors (see the
perldiag manpage), "use diagnostics" causes the "-w" warnings to be
explained in greater detail (with the explanations from the perldiag
manpage), and "use strict" generates compile and run-time errors for
certain unsafe variable, reference and subroutine constructs (see the
strict manpage)

4. Are you checking the return values from the functions built in to
perl?  Most of the file and system functions set $! and have return
values that you can test thus:
	open(PASSWD, "</etc/passwd") or
		die "error opening /etc/passwd: $!\n";
$! will contain an error message that will give you more information
on where your program is going wrong.  The perlfunc man page will give
you more information on the return values from functions.

5. Have you read the Perl FAQ?  Many questions on sockets programming,
an important and common problem with Solaris, text manipulation and
the jargon of perl are answered in the FAQ.  As well as being posted
regularly to comp.lang.perl.misc, the FAQ is on the web at:
	http://language.perl.com/faq/
 
6. Have you read the man pages?  Here are some subjects and the man
pages to look in:
	Objects		perltoot, perlref, perlmod, perlobj, perltie
	Data Structures	perlref, perllol, perldsc
	Modules		perlmod, perlsub
	Regexps		perlre, perlfunc, perlop
			http://www.perl.com/CPAN/doc/FMTEYEWTK/index.html
			(not a man-page but still useful)
	Moving to perl5	perltrap, perl
	Linking w/C	perlxstut, perlxs, perlcall, perlguts, perlembed
The man page for "perltoc" provides a crude table of contents for the
perl man page set.

7. Have you looked at http://www.perl.com ?  This is a great
online reference, with documentation, pointers to modules in the
Comprehensive Perl Archive Network (CPAN), articles on the inner
workings of many bits of Perl, and more.

7.5. Have you checked to see if a Perl module satisfies your needs?
Many reusable modules are available for immediate download and use.
See http://www.perl.com/CPAN/modules/00modlist.long.html for details.

8. Have you tried archives of Usenet?  http://www.dejanews.com/
maintains an archive of postings to Usenet dating from March, 1995.
Be sure to include "Perl" in your search.

9. The latest version of the "Camel Book" ("Programming Perl"),
updated for version 5.6.0, is available from your bookstore or from
http://www.ora.com/

10. Remember, USENET newsgroups are based on the idea of mutual aid.
USENET only works if we put as much into it as we get out of it.  Good
luck with your Perl work.

-Nathan Torkington, Perl mini-FAQ maintainer
- 

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 comming 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.

If you are not able to find this or other Perl documentation from
your installation you may access it via the web by following the
appropriate links from one of the addresses listed below.

    http://theoryx5.uwinnipeg.ca/mod_perl/cpan-search
    http://www.perldoc.com
    http://www.cpan.org
    http://www.perl.com

Answers to questions about LOTS of other stuff, mostly not related to
Perl, can be found at

    news:news.answers

and in the many thousands of other useful Usenet news groups.

Please note that the FAQ text posted by this server has been modified
from that distributed in the stable Perl release.  It has 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 is available on request.

The perlfaq manual pages contain the following copyright notice.

  AUTHOR AND COPYRIGHT

    Copyright (c) 1997-1999 Tom Christiansen and Nathan
    Torkington.  All rights reserved.

    When included as an integrated part of the Standard
    Distribution of Perl or of its documentation (printed or
    otherwise), this work is covered under Perl's Artistic
    License.  For separate distributions of all or part of
    this FAQ outside of that, see the perlfaq manpage.

    Irrespective of its distribution, all code examples here
    are public domain.  You are permitted and encouraged to
    use this code and any derivatives thereof in your own
    programs for fun or for profit as you see fit.  A simple
    comment in the code giving credit to the FAQ would be
    courteous but is not required.

This work is provided in the hope that it will be useful but does
not represent a commitment of any kind on the part of the contributers,
authors or their agents.
-- 
    This space intentionally left blank


------------------------------

Date: Sat, 14 Apr 2001 20:18:50 +1000
From: "Ron Savage" <ron@savage.net.au>
Subject: Re: File Upload
Message-Id: <eEUB6.1490$EQ3.46207@ozemail.com.au>

See below.
--
Cheers
Ron  Savage
ron@savage.net.au
http://savage.net.au/index.html

> > why do you call those tutorials when there is no explanatory text?

> [...]
>
> I rest my case.  It's not a tutorial.  It's a script archive, and it
> doesn't look good.

My grovelling apologies for failing to be infallible.




------------------------------

Date: Sat, 14 Apr 2001 05:04:37 -0400
From: "Jody Fedor" <Jodyman@usa.net>
Subject: Re: Large File Help
Message-Id: <9b93t1$bju$1@plonk.apk.net>

"Jonathan Stowe" <gellyfish@gellyfish.com> wrote in message
> Jody Fedor <Jodyman@usa.net> wrote:
> > I have a large file, about 540Mbs.  The first 3018 bytes are garbage
> > but the records I would like to extract are now every 1087 bytes
> > after the first 3018 bytes.
[snip]
>
> Something like this (typed straight in as I dont have your data) :
>
> open(FILE,'thefile') || die "Cant open - $!\n";
>
> my $record;
> binmode FILE;
>
> read(FILE,$record,3018); # read and throw away the first 3018 bytes
>
> while(read(FILE,$record,1087) == 1087)
> {
>   # process the record probably using unpack or substr
> }


hmmm,  never used bin mode but it sounds like it will do the trick,
appreciate your time getting back so soon.  Thanks
Jonathan!

Jody




------------------------------

Date: 14 Apr 2001 05:13:00 GMT
From: "Scott R. Godin" <webmaster@webdragon.unmunge.net>
Subject: Re: Laziness, Impatience and Hubris  :-)
Message-Id: <9b8m8s$l88$0@216.155.32.47>

In article <m1k84olt93.fsf@halfdome.holdit.com>,
 merlyn@stonehenge.com (Randal L. Schwartz) wrote:

 |         THIS IS NOT A HELP DESK.
 |         THIS IS A COMMUNITY POTLUCK.
 |         DON'T WHINE BECAUSE SOMEONE DIDN'T BRING ICE CREAM.
 |         DON'T BOGART THE POTATO SALAD.
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I'm still going to make this into T-shirts if I ever get the opportunity 
to spend some time a a Perl conference where you will be either a member 
or just an interested participant. :D 

 |         BRING SOMETHING OCCASIONALLY, YOU BUM.  EVEN CHIPS.
 |         DON'T WHINE WHEN SOMEONE SAYS WE DON'T HAVE TABLE SERVICE.
 |

-- 
unmunge e-mail here:
#!perl -w
print map {chr(ord($_)-3)} split //, "zhepdvwhuCzhegudjrq1qhw"; 
# ( damn spammers. *shakes fist* take a hint. =:P )


------------------------------

Date: 14 Apr 2001 05:16:49 GMT
From: "Scott R. Godin" <webmaster@webdragon.unmunge.net>
Subject: Re: Laziness, Impatience and Hubris  :-)
Message-Id: <9b8mg1$l88$1@216.155.32.47>

In article <3AD723AF.EF28072C@mail.uca.edu>,
 Cameron Dorey <camerond@mail.uca.edu> wrote:

 | And you know what they say
 | about people who don't study history...

*sigh* Brother, you ain't jokin'.

-- 
unmunge e-mail here:
#!perl -w
print map {chr(ord($_)-3)} split //, "zhepdvwhuCzhegudjrq1qhw"; 
# ( damn spammers. *shakes fist* take a hint. =:P )


------------------------------

Date: 14 Apr 2001 09:42:13 GMT
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Laziness, Impatience and Hubris  :-)
Message-Id: <9b961l$jaa$1@neptunium.btinternet.com>

Karl Young <karlyoung@unconscious.co.uk> wrote:
>                                                          .... people are
> capable of ignoring the posts if they bother them.

Er, right, this seems to be a facility lacking in some of the 'whining
newbies' and their supporters in this thread.  Are you saying this should
only be practiced by the regular posters to this group ?

/J\
-- 
Jonathan Stowe                      |
<http://www.gellyfish.com>          |      This space for rent
                                    |


------------------------------

Date: Sat, 14 Apr 2001 05:31:19 GMT
From: KilerCris@Mail.com
Subject: problem opening RC4 encrypted file - test.cgi (0/1)
Message-Id: <3ad7ded7.1278816@news>

I am using Crypt::RC4 to encrypt files,  The file is opened,
encrypted, and saved properly, but when I try to open it again through
perl for decryption, perl stops reading it in the middle of a line. I
can open the encrypted file just fine in my editor.

I am debugging this at http://kilercris.cjb.net/proj/debug  ...all the
files are there..this is driving me insain. Anyone have any idea about
how I could get the entire contents of the encrypted file into a
string. I"ve tried using read() but I get the same problem.


------------------------------

Date: Sat, 14 Apr 2001 06:13:02 GMT
From: ___cliff rayman___ <cliff@rayman.com>
Subject: Re: problem opening RC4 encrypted file - test.cgi (0/1)
Message-Id: <3AD7EA3D.5E408D60@rayman.com>

checkout:
perldoc -f sysread

this function can read any file on unix.  u may still
need to use binmode if u are on windoze.


-- 
_____cliff_rayman_____cliff_@_rayman_._com_____

KilerCris@Mail.com wrote:
> 
> I am using Crypt::RC4 to encrypt files,  The file is opened,
> encrypted, and saved properly, but when I try to open it again through
> perl for decryption, perl stops reading it in the middle of a line. I
> can open the encrypted file just fine in my editor.
> 
> I am debugging this at http://kilercris.cjb.net/proj/debug  ...all the
> files are there..this is driving me insain. Anyone have any idea about
> how I could get the entire contents of the encrypted file into a
> string. I"ve tried using read() but I get the same problem.


------------------------------

Date: Sat, 14 Apr 2001 05:31:19 GMT
From: KilerCris@Mail.com
Subject: problem opening RC4 encrypted file - test.cgi (1/1)
Message-Id: <3ad7e056.1661525@mail>

begin 644 test.cgi
M(R$O=7-R+V)I;B]P97)L#0IU<V4@4D,T.PT*)&ME>2`](")C,&,P8S`B.PT*
M<')I;G0@(D-O;G1E;G0M='EP93H@=&5X="]H=&UL7&Y<;B([#0H-"@T*;W!E
M;BA415-41DE,12PB=&5S=&9I;&4N='AT(BD[#0I`9F-O;G1?87)R(#T@/%1%
M4U1&24Q%/CL-"B1F8V]N="`]("(B.PT*9F]R96%C:"`D;&EN92`H0&9C;VYT
M7V%R<BD@>R1F8V]N="`N/2`D;&EN93M]#0IC;&]S92A415-41DE,12D[#0H-
M"B1F8V]N="`](%)#-"@D:V5Y+"1F8V]N="D[#0H-"F]P96X@*$]55$9)3$4L
M(CYE;F-R>7!T960N='AT(BD[#0IP<FEN="!/551&24Q%("1F8V]N=#L-"F-L
M;W-E*$]55$9)3$4I.PT*#0IO<&5N("A#2$LL(F5N8W)Y<'1E9"YT>'0B*3L-
M"B1F8V]N=#UJ;VEN*"<G+#Q#2$L^*3L-"G!R:6YT("1F8V]N=#L-"F-L;W-E
&*$-(2RD[
`
end


------------------------------

Date: 14 Apr 2001 01:05:16 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: problem opening RC4 encrypted file - test.cgi (1/1)
Message-Id: <9b8pas$8va$1@charity.cs.utexas.edu>

In article <3ad7e056.1661525@mail>,  <KilerCris@Mail.com> wrote:
>begin 644 test.cgi
>M(R$O=7-R+V)I;B]P97)L#0IU<V4@4D,T.PT*)&ME>2`](")C,&,P8S`B.PT*

I'm having a problem opening your post.  You uuencoded it.
That's a great way to get nobody to read it, since you
can't tell what it's about at a glance, and most people
have better things to do with their time than speculatively
uuencode things just in case they're interesting.

  - Logan
-- 
my  your   his  her   our   their   _its_
I'm you're he's she's we're they're _it's_


------------------------------

Date: 14 Apr 2001 01:02:53 -0500
From: logan@cs.utexas.edu (Logan Shaw)
Subject: Re: RegEx novice
Message-Id: <9b8p6d$8td$1@charity.cs.utexas.edu>

In article <usMB6.6504$Pj2.558706@newsread1.prod.itd.earthlink.net>,
dkh <projectobjects@earthlink.net> wrote:
>I want to do a match in order to validate a phrase.

What does "validate a phrase" mean?  Is a phrase a string?

>Something like Bart responded with except for validation instead.
>If  the phrase is (<word>[_- ]<word>[_- ]<word>) then I do not want it to be
>true for (<word>[_- ]<word>)
>even though it is a subset of (<word>[_- ]<word>[_- ]<word>)

Assuming your notation is essentially a regular expression, then how is
<word>[_- ]<word> a subset of <word>[_- ]<word>[_- ]<word> ?

It would seem that they are disjoint sets to me, since the first only
matches strings with two occurrences of word, and the second only
matches strings with three.  (This is assuming we're talking about
regular regular expressions, instead of Perl regular expressions, since
Perl regular expressions are sort of implicitly prefixed and suffixed
with ".*" by default.)

  - Logan
-- 
my  your   his  her   our   their   _its_
I'm you're he's she's we're they're _it's_


------------------------------

Date: Sat, 14 Apr 2001 08:47:59 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: RegEx novice
Message-Id: <9e3gdt0c9nvu6vbmui8omut7in4j0mgn3a@4ax.com>

Logan Shaw wrote:

>It would seem that they are disjoint sets to me, since the first only
>matches strings with two occurrences of word, and the second only
>matches strings with three.

If something contains three occurrences of "word", it also contains two
occurrences of "word". The OP wants a way to exclude those, and get ONLY
those groups of 2 that are not part of a group of 3.

Lookahead doesn't really work, because if you do:

	/(?!$three)$two/

it can still match right after the first occurrence of /<word>[_- ]/.
The hole contents matched by /$three/ should be skipped.

-- 
	Bart.


------------------------------

Date: Sat, 14 Apr 2001 10:25:09 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: RegEx novice
Message-Id: <slrn9dg9c3.63g.tjla@thislove.dyndns.org>

I was shocked! How could Bart Lateur <bart.lateur@skynet.be>
say such a terrible thing:
>Logan Shaw wrote:
>
>>It would seem that they are disjoint sets to me, since the first only
>>matches strings with two occurrences of word, and the second only
>>matches strings with three.
>
>If something contains three occurrences of "word", it also contains two
>occurrences of "word". The OP wants a way to exclude those, and get ONLY
>those groups of 2 that are not part of a group of 3.
>
>Lookahead doesn't really work, because if you do:
>
>	/(?!$three)$two/
>
>it can still match right after the first occurrence of /<word>[_- ]/.
>The hole contents matched by /$three/ should be skipped.

How about a combination of look-ahead and look-behind?

/(?<!$word)$word$word(?!$word)/

This will match a string with two occurances of $word, neither followed
or preceded by a single occurance of $word.

$word up.

-- 
Gwyn 'too legit' Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
A girl of the Enterprise crew
Refused every offer to screw.
	But a Vulcan named Spock
	Crawled under her smock,
And now she is eating for two.


------------------------------

Date: Sat, 14 Apr 2001 11:02:12 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: RegEx novice
Message-Id: <3jbgdt0mdgh4t9n84uedm7t852eht5fsnm@4ax.com>

Gwyn Judd wrote:

>How about a combination of look-ahead and look-behind?
>
>/(?<!$word)$word$word(?!$word)/
>
>This will match a string with two occurances of $word, neither followed
>or preceded by a single occurance of $word.

Only possible if $word is a fixed length pattern. Variable length
lookbehind still doesn't work.

-- 
	Bart.


------------------------------

Date: Sat, 14 Apr 2001 06:50:57 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: use of uninitialised value in pattern matching?
Message-Id: <slrn9dfsqf.5ha.tjla@thislove.dyndns.org>

I was shocked! How could slok <slok00@yahoo.com>
say such a terrible thing:
>error is at the "if" statements... any idea how to resolve this?

You don't actually say which if statement so I assume it is both. You
need to bind the match operator to a variable. By default it is bound to
$_ however you never set that variable to anything. You probably want to
do:

if ($argv =~ m/some pattern/)
# etc

-- 
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
A bore is someone who persists in holding his own views after we have
enlightened him with ours.


------------------------------

Date: Sat, 14 Apr 2001 04:07:47 -0400
From: "Collin E Borrlewyn" <collin@crosslink.net>
Subject: Win32 command.com error
Message-Id: <3ad805a1$0$4463@dingus.crosslink.net>

Recently I've moved myself from an old comp to a newer one and have
reinstalled ActiveState because of it. My other comp did not (and does not)
have this problem.

Basically, any time I try to use perldoc (like "perldoc perlvar" or
"perldoc -q sorting", though not "perldoc -h") I get the message:

Invalid COMMAND.COM
Enter correct name of Command Interpreter <eg, C:\COMMAND.COM>
>>

Command.com exists and seems to be functional in every way. Specifying the
C:\COMMAND.COM at the prompt just causes a reprompt.

The same error occurs when I attempt to use the system() function in any
script (indeed, this may be the only thing that casuses the error).

So, what gives? How can I fix it?




------------------------------

Date: Sat, 14 Apr 2001 06:01:52 -0400
From: "Jody Fedor" <Jodyman@usa.net>
Subject: Re: Win32 command.com error
Message-Id: <9b97fn$d3n$1@plonk.apk.net>

"Collin E Borrlewyn" <collin@crosslink.net> wrote in message
news:3ad805a1$0$4463@dingus.crosslink.net...
> Recently I've moved myself from an old comp to a newer one and have
> reinstalled ActiveState because of it. My other comp did not (and does
not)
> have this problem.

Did you install Dcom95 or Dcom98 before installing Active States Perl?

Could be your problem.

Jody




------------------------------

Date: Sat, 14 Apr 2001 10:27:39 GMT
From: tiltonj@erols.com (Jay Tilton)
Subject: Re: Win32 command.com error
Message-Id: <3ad819da.148324528@news.erols.com>

On Sat, 14 Apr 2001 04:07:47 -0400, "Collin E Borrlewyn"
<collin@crosslink.net> wrote:

>Basically, any time I try to use perldoc (like "perldoc perlvar" or
>"perldoc -q sorting", though not "perldoc -h") I get the message:
>
>Invalid COMMAND.COM
>Enter correct name of Command Interpreter <eg, C:\COMMAND.COM>
>>>

This is not really a Perl problem, but a MSDOS/Win problem.  The same
thing will likely happen if you use other command-line apps.  Google
would be a more appropriate place to look for the answer.

With the obligatory note on OT posting out of the way, the error is
happening because of a version conflict on COMMAND.COM.

>Command.com exists and seems to be functional in every way. Specifying the
>C:\COMMAND.COM at the prompt just causes a reprompt.

This will happen if the one in C:\ is not byte-for-byte identical to
the one whose resident portion has been loaded into memory.  Type in
the same path/filespec as the 'MS-DOS Prompt.PIF' you're using to
acess the command prompt, probably C:\WINDOWS\COMMAND.COM.

If the problem clears, change (or add) the "SHELL=" line in CONFIG.SYS
so it points to the right place.

If the problem persists, check Google or your preferred search engine
for more help.

>The same error occurs when I attempt to use the system() function in any
>script (indeed, this may be the only thing that casuses the error).

You nailed it.  Perldoc itself is really a Perl program that happens
to use external commands.


------------------------------

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 697
**************************************


home help back first fref pref prev next nref lref last post