[10331] in Perl-Users-Digest
Perl-Users Digest, Issue: 3924 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 7 21:07:56 1998
Date: Wed, 7 Oct 98 18:00:22 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 7 Oct 1998 Volume: 8 Number: 3924
Today's topics:
Re: Any List of Win32 Error Codes ? <Savage.Ron.RS@bhp.com.au>
Re: Are there any "perl.newbie" group or forum? (Craig Berry)
Re: Back button in Perl? <aravind@genome.wi.mit.edu>
Re: Capturing command output in Perl <baliga@synopsys.com>
Re: eq on if statement causing problems with string (brian d foy)
Re: foreach peculiarities (brian d foy)
Re: How to get a particular string in a file ? (Andre L.)
Looking for a shopping cart <kjcox@vii.com>
Re: Making the date look good <garry@america.net>
Monitoring memory use/Running out of memory <amorgan@vsol.com>
Re: multi-line comments <jdf@pobox.com>
Re: NEEDED: A good perl programer to... (David Formosa)
Re: NEEDED: A good perl programer to... (Craig Berry)
Parsing records from one text file to another <marx@nonspam.idiom.com>
Re: Perl Robots <rcpowerpro@geocities.com>
PERL, C++ Software Test Engineer-Chandler, AZ <paulg3@home.com>
Re: Pizza Hut advertises for CPAN (Craig Berry)
Re: Question/Logging Scripts (brian d foy)
Re: Reading all lines from datafile (Craig Berry)
Re: reg-exp: "Buy!!!" -> "Buy!" ? <alex@kawo2.rwth-aachen.de>
Re: reg-exp: "Buy!!!" -> "Buy!" ? (Larry Rosler)
Re: reg-exp: "Buy!!!" -> "Buy!" ? (Charles DeRykus)
regular expressions <gossfam@wolfenet.com>
Re: regular expressions <rootbeer@teleport.com>
Re: regular expressions (Craig Berry)
Re: regular expressions (Larry Rosler)
Re: return code (Charles DeRykus)
Re: Runtime evaluation of required modules (Sitaram Chamarty)
Re: send geroge reese (was Re: Call for Participation: <zenin@bawdycaste.org>
Re: Timing An LWP get request (John Moreno)
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 7 Oct 1998 23:02:48 GMT
From: "Ron Savage" <Savage.Ron.RS@bhp.com.au>
Subject: Re: Any List of Win32 Error Codes ?
Message-Id: <01bdf247$382b3f00$77ea1286@steelres-pcm657.resmel.bhp.com.au>
I only know 1:
Win32::GetShortPathName($longName)
retuns undef for directores which do no exist.
Please keep us informed about your discoveries.
--
Ron Savage
Home (preferred): rpsavage@ozemail.com.au
Office: Savage.Ron.RS@bhp.com.au
http://www.ozemail.com.au/~rpsavage
Eisen Chao <echao@interaccess.com> wrote in article
<6vg2f4$o0t$1@supernews.com>...
>
> To All:
>
>
> Any one out there know where a list of all the returned error
> codes from Win32 modules like NetResources is ? I'm getting
> some non-zero error codes but I have no idea what they mean.
>
>
> Thanks in advance,
>
>
> Eisen
>
------------------------------
Date: 7 Oct 1998 22:33:19 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Are there any "perl.newbie" group or forum?
Message-Id: <6vgq7f$bcm$1@marina.cinenet.net>
madame philosophe (mp@mkt2mkt.com) wrote:
: Well it seems that
:
: 1. I shouldn't start a newsgroup
:
: 2. You guys aren't as mean as once thought.
Rats, we'll have to try harder. :)
: 3. Though snide, can be reasonable.
When backed to the wall and given no other option, yes, sometimes.
: 4. Have given me a better understanding what on earth the problem is.
:
: What I don't understand is this:
:
: If someone is posting a "dumb" question (If there is such a thing),
: why not just ignore it? Treat it like spam?
I do treat it like spam. I instantly turn a spam mail/post into a complaint
to the source's ISP emailed via abuse.net. Ignoring problems hoping
they'll go away doesn't work well in an anarchic community like the net.
We, each of us, *are* the police force, the fire department, the trash
collectors. If we don't do the job, there's no 'authority' that will do
it for us.
I do not wish clpm to be overrun by FAQs; thus, I take active steps to
avoid this happening.
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| "Ripple in still water, when there is no pebble tossed,
nor wind to blow..."
------------------------------
Date: Wed, 07 Oct 1998 20:25:01 -0400
From: Aravind Subramanian <aravind@genome.wi.mit.edu>
Subject: Re: Back button in Perl?
Message-Id: <361C065D.A755032A@genome.wi.mit.edu>
#*****************************************************************************#
# display_dismiss_button
#*****************************************************************************#
# Displays a dismiss button that uses javascript to use the
# browsers cache to regress
# regression level needs to be passed in as a param
# query is the CGI object
sub display_dismiss_button {
my ($query, $level) = @_;
# Need to start a form for the Dismiss button
# This form does not need to be linked with any other that might exist
# on the page it is displayed on
print $query->start_form;
print "<CENTER><TABLE class=butdef><TR>\n";
print "<TD class=butdef>" . $query->button(-name=>'Dismiss',
-onClick=>"history.go($level)") . "</TD>\n";
print "</TR></TABLE></CENTER>\n";
print $query->end_form;
print "<!- END DISMISS BUTTON ->\n";
}
#*************************************#
Brian Enderle wrote:
> I wish to include a 'Back' button in my webpage. The webpage is created
> 'on-the-fly' by a cgi script (perl). I would like to be able to have
> the user press the 'Back' button and be taken back one page, just as if
> he had pressed the browser's 'Back' button. I have tried using the
> javascript snippet:
>
> <A HREF="javascript:history.go(-1)"><INPUT TYPE=button
> VALUE="Back"></A>
>
> but it doesn't work. Is there a way to call a javascript routine from
> within a cgi script?
>
> Thank you in advance for any help and please dierect responses to my
> e-mail.
>
> thank you,
> Brian Enderle
> www.pcgamex.com
------------------------------
Date: Wed, 07 Oct 1998 17:17:27 -0700
From: Yogish Baliga <baliga@synopsys.com>
To: wkchiu <wkchiu@yahoo.com>
Subject: Re: Capturing command output in Perl
Message-Id: <361C0497.7F877AAD@synopsys.com>
Use
$output = `ping.exe .....`;
PS: Do not use Single quotes instead use back quote...
-- Baliga
wkchiu wrote:
> I am writing a perl script in NT which runs the PING.EXE command to check a
> node (using system() or win32::create() ??) and examine the reply of
> PING.EXE to see whether the node is alive or dead. My question is how can I
> capture the output of PING.EXE in perl script to carry out the processing ?
>
> wkchiu.
------------------------------
Date: Wed, 07 Oct 1998 19:48:11 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: eq on if statement causing problems with string
Message-Id: <comdog-ya02408000R0710981948110001@news.panix.com>
Keywords: from just another new york perl hacker
In article <x3y3e90qic3.fsf@tigre.matrox.com>, Ala Qumsieh <aqumsieh@tigre.matrox.com> posted:
>> John Porter <jdporter@min.net> wrote:
>>
>> > 0. Always, *Always*, *ALWAYS* check the result of open().
>> > There is never, NEVER a situation in which you can safely
>> > neglect to check the result of open().
even when it's just an example? (just kidding Tom... ;)
>What if there wasn't enough disk space?
open doesn't know how much space you are going to need.
what's your point? (especially considering that Kevin's
counterexample didn't write to a file).
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers needs volunteers! <URL:http://www.pm.org/to-do.html>
------------------------------
Date: Wed, 07 Oct 1998 19:43:52 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: foreach peculiarities
Message-Id: <comdog-ya02408000R0710981943520001@news.panix.com>
Keywords: from just another new york perl hacker
In article <x3y1zokqhsc.fsf@tigre.matrox.com>, Ala Qumsieh <aqumsieh@tigre.matrox.com> posted:
>foreach takes a LIST .. not an ARRAY! (be sure you make a distinction
>between lists and arrays ... sometimes this is crucial!)
what are you talking about? what do you think happens when an array
is in an argument list? remember - "this is crucial".
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers needs volunteers! <URL:http://www.pm.org/to-do.html>
------------------------------
Date: Wed, 07 Oct 1998 20:07:29 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: How to get a particular string in a file ?
Message-Id: <alecler-0710982007290001@dialup-744.hip.cam.org>
In article <361B2ED8.AFE5543C@iuplo.univ-ubs.fr>, "Nicolas.Tual"
<Nicolas.Tual@iuplo.univ-ubs.fr> wrote:
> I begin in the art of Perl.
> I have to get a string from the following file :
>
> /COM
> /NOPR
> NBLOCK, 6
> (3.8,6e16.9)
> 1 0 0.5 0.000000000004 0.000000000005
> 2 0 0.4 0.000000000001 0.8
>
> The string I want to get is (3.8,6e16.9) which depends on the file I'm
> working on ( for example, it can be on line 4, 5, 6... or be (3.9...).
The problem is to know exactly what distinguishes the desired line from
all others.
If -- and only if -- it is safe to assume that what we want is "the first
occurrence of a line beginning with a ( and ending with a )", then:
while (<FILE>) {
($string) = /^(\(.*\))$/ and last;
}
# $string is now '(3.8,6e16.9)'.
If you prefer the values without the parentheses, then:
while (<FILE>) {
($string) = /^\((.*)\)$/ and last;
}
# $string eq '3.8,6e16.9'.
Good reading suggestion: perlre, the Perl regexp manual, and the FAQ.
HTH,
Andre
------------------------------
Date: Wed, 07 Oct 1998 11:51:03 -0600
From: "Kerry J. Cox" <kjcox@vii.com>
Subject: Looking for a shopping cart
Message-Id: <361BAA06.6FAE8329@vii.com>
Howdy,
I have several customers who would like to have shopping carts on their
sites. I have been poking around using several free ones and not so
free ones, but have not found anything to suit my tastes. I could write
something, but have walked into this job with the customers needing
something immediately.
Could someone recommend a shopping cart program that runs anywhere from
$0- $300 and that uses either comma or pipe delimited flat files, from
which I can take MS Access database files, or Excel spreadsheet files
and pipe them into the program for easy updates of the program? Any
recommendations would be appreciated.
Thank you very much.
KJ
--
.-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-.
| Kerry J. Cox Vyzynz International Inc. |
| kjcox@vii.com Systems Administrator |
| (801) 596-7795 http://vii.com |
`-------------------------------------------------'
------------------------------
Date: Thu, 08 Oct 1998 00:59:16 GMT
From: "Garry T. Williams" <garry@america.net>
Subject: Re: Making the date look good
Message-Id: <361C0EBB.46BA2AE0@america.net>
Deva Seetharam wrote:
>
> Try this :
> $x=localtime(time);
> print "$x\n";
>
> Output is
> Wed Oct 7 00:03:31 1998
> Hope that helps.
> Deva
But that doesn't answer the question, of course. See Time::Local.
-Garry Williams
> brettr wrote:
>
> > How can I convert something like this "10/06/98 06:41:13 CDT" into something
> > like this "Tuesday, October 06, 1998"?
------------------------------
Date: Wed, 07 Oct 1998 16:40:58 -0700
From: Adam Morgan <amorgan@vsol.com>
Subject: Monitoring memory use/Running out of memory
Message-Id: <361BFC09.9242555D@vsol.com>
I am using Perl 5.0 Patchlevel 4 subversion 4 on Solaris 2.5.1.
I have a program that says it runs out of memory, but when monitoring it
using top it doesn't seem to get above 10meg with 100 meg free. It
doesn't appear to consume the free memory while it grows to 10 meg
either. I have run the same program with the same data previously and
there has been no problem with it. Does anyone know how to monitor
memory use in Perl? Has anyone come across this sort of problem before?
I am using a number of hash tables in the program which I undefine
periodically to try to conserve memory.
Thanks for your time,
Adam.
------------------------------
Date: 08 Oct 1998 01:12:59 +0200
From: Jonathan Feinberg <jdf@pobox.com>
To: mjd@op.net (Mark-Jason Dominus)
Subject: Re: multi-line comments
Message-Id: <m3k92cotj8.fsf@joshua.panix.com>
mjd@op.net (Mark-Jason Dominus) writes:
> Yak yak yak yak yak yak yak yak yak yak yak yak yak yak yak yak yak
> yak yak. Blah blah blah blah blah blah blah blah blah.
>
> Yabble yabble yabble yabble yabble yabble yabble yabble yabble yabble
> yabble.
>
> Wubba wubba wubba. Mumble mumble.
> Gnonk la la la la la la.
>
> By the Holy Claws of Klortho the Magnificent, this IS a fine morning!
Okay, it's definitely time for a beer. I'm outta here.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf
------------------------------
Date: 8 Oct 1998 09:38:59 +1000
From: dformosa@zeta.org.au (David Formosa)
Subject: Re: NEEDED: A good perl programer to...
Message-Id: <6vgu2j$mld$1@godzilla.zeta.org.au>
Keywords: from just another new york perl hacker
In <6vg9gv$o8l$1@news.interlog.com> dragnet@internalysis.com (Marc Bissonnette) writes:
> I'll charge the $$,
You charge based on PID?
--
Please excuse my spelling as I suffer from agraphia. See the URL in my
header to find out more.
------------------------------
Date: 7 Oct 1998 23:50:35 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: NEEDED: A good perl programer to...
Message-Id: <6vguob$bcm$7@marina.cinenet.net>
David Formosa (dformosa@zeta.org.au) wrote:
: In <6vg9gv$o8l$1@news.interlog.com> dragnet@internalysis.com (Marc Bissonnette) writes:
:
: > I'll charge the $$,
:
: You charge based on PID?
I find that adds to the excitement value of the whole process. You just
have to be careful to avoid working on a freshly booted machine.
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| "Ripple in still water, when there is no pebble tossed,
nor wind to blow..."
------------------------------
Date: Wed, 7 Oct 1998 16:29:45 -0700
From: "Marx" <marx@nonspam.idiom.com>
Subject: Parsing records from one text file to another
Message-Id: <6vgtja$iji$1@ramona.sfo.com>
This is a multi-part message in MIME format.
------=_NextPart_000_010D_01BDF20F.B19B0600
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I have a text file that looks like this:
REC ITEMS~2~4~4~EACH~250.00~~1000.00~PRODUCT DESCRIPTION~ADDITIONAL
COMMENTS
REC HEAD~016969~19980630~709~020449~099~19980630~MERCER FREIGHT
REC ITEMS~1~1~1~EACH~2000.00~~2000.00~PRODUCT DESCRIPTION~ADDITIONAL
COMMENTS
I want to perform some sort of loop that says: if field one of my text =
file
is equal to "REC ITEMS" then print field one and the associatied fields
with it to another file. The file would hold all "REC ITEMS" records in
it.
For example,
REC ITEMS~2~4~4~EACH~250.00~~1000.00~PRODUCT DESCRIPTION~ADDITIONAL
COMMENTS
REC ITEMS~1~1~1~EACH~2000.00~~2000.00~PRODUCT DESCRIPTION~ADDITIONAL
COMMENTS
Anyone know a good way to do this?
-Marcus
------=_NextPart_000_010D_01BDF20F.B19B0600
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
<HTML>
<HEAD>
<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type>
<META content=3D'"MSHTML 4.71.1712.3"' name=3DGENERATOR>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV><FONT color=3D#000000 face=3D"" size=3D3>I have a text file that =
looks like=20
this:</FONT></DIV>
<DIV> </DIV>
<DIV>REC ITEMS~2~4~4~EACH~250.00~~1000.00~PRODUCT=20
DESCRIPTION~ADDITIONAL<BR>COMMENTS<BR>REC=20
HEAD~016969~19980630~709~020449~099~19980630~MERCER FREIGHT<BR>REC=20
ITEMS~1~1~1~EACH~2000.00~~2000.00~PRODUCT=20
DESCRIPTION~ADDITIONAL<BR>COMMENTS<BR><BR>I want to perform some sort of =
loop=20
that says: if field one of my text file<BR>is equal to "REC =
ITEMS"=20
then print field one and the associatied fields<BR>with it to another=20
file. The file would hold all "REC ITEMS" records=20
in<BR>it.<BR><BR>For example,<BR>REC =
ITEMS~2~4~4~EACH~250.00~~1000.00~PRODUCT=20
DESCRIPTION~ADDITIONAL<BR>COMMENTS<BR>REC=20
ITEMS~1~1~1~EACH~2000.00~~2000.00~PRODUCT=20
DESCRIPTION~ADDITIONAL<BR>COMMENTS<BR> </DIV>
<DIV> </DIV>
<DIV>Anyone know a good way to do this? </DIV>
<DIV> </DIV>
<DIV>-Marcus</DIV></BODY></HTML>
------=_NextPart_000_010D_01BDF20F.B19B0600--
------------------------------
Date: Wed, 7 Oct 1998 19:14:09 -0400
From: "Chris \"HTMLpro\" Alas" <rcpowerpro@geocities.com>
Subject: Re: Perl Robots
Message-Id: <6vgsj7$3q1$1@news-1.news.gte.net>
maybe your HTML validator is messed up. All the pages I make a completely
fine.
------------------------------
Date: Wed, 07 Oct 1998 23:55:29 GMT
From: ESS <paulg3@home.com>
Subject: PERL, C++ Software Test Engineer-Chandler, AZ
Message-Id: <361BFFAB.464EE0BD@home.com>
Perm Career opportunity:
We are offering a $2000 Finders Fee for any referral who get placed by
our corporate client. Paid 5 days after we receive our check!
Job Title: Software Test Engineer
Location: Arizona - Chandler
Salary: $55K-75K base (DOE) + solid benefits package
Relocation: Yes-May include signing bonus or relo expenses
Category: Engineering, Technical
*Education Desired:
Bachelor's degree in Computer Systems Engineering, OR
Bachelor's degree in Electrical Engineering (with emphasis on S/W
Engineering), OR Equivalent.
*Minimum Requirements:
Three years experience in software testing.
2 years programming experience with PERL
Programming Experience with C++
Experience with UNIX, OS/2, MS-Windows operating systems.
Experience with MS-Word
*Other Desirable Skills and Experience:
Telephony experience.
PC-based Voice Processing experience
MS-Windows development or testing experience
Programming experience with Microsoft Test
*Description of Position:
The purpose of this position is to write test plans for telephony
software (both automated and manual tests).
To develop and maintain software for automated testing of telephony
software.
This engineer is a member of the Software Test Group. That group is
responsible for the following:
-> Provide system software test plans for all new products.
-> Automate as much of the software testing as possible.
-> Perform both manual and automated tests
-> Support existing test plans and software.
-> Support other autotesting needs.
-> Help out with automated testing prior to system test, however
possible.
Please Contact:
Paul Goldenberg-Sr. Recruitment Consultant
Enterprise Staffing Solutions
4296 E. Agave Road
Phoenix, AZ 85044
voice: 602-704-1317
fax: 602-704-1316
email: paulg3@home.com
http://www.hi-touch.com/searchess
------------------------------
Date: 7 Oct 1998 23:02:19 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Pizza Hut advertises for CPAN
Message-Id: <6vgrtr$bcm$5@marina.cinenet.net>
ch (wodehouse@cheerful.com) wrote:
: miko@idocs.com wrote in message <6vfrfl$2h2$1@nnrp1.dejanews.com>...
: >Has anyone else noticed that the new Pizza Hut logo for their pan pizza looks
: >like it reads "CPAN"? I keep glancing at the TV to discover that there are
: >now wonderfully filmed national ads for CPAN, and I think "wow, CPAN must
: >really want some traffic".
:
: You're damn right (see www.pizzahut.com). I wonder how many new Perl users
: we'll see before the end of the year who were triggered by unconscious
: desires for CPAN.
And conversely, how many Perl users downloading the latest revision of
Text::YetAnotherFormattingThingy.pm will be seized with a sudden and
overwhelming desire to order a pizza...no, wait, my god, that's happening
already!
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| "Ripple in still water, when there is no pebble tossed,
nor wind to blow..."
------------------------------
Date: Wed, 07 Oct 1998 19:51:09 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: Question/Logging Scripts
Message-Id: <comdog-ya02408000R0710981951090001@news.panix.com>
Keywords: from just another new york perl hacker
In article <Pine.GSO.4.02A.9810071351510.4710-100000@user2.teleport.com>, Tom Phoenix <rootbeer@teleport.com> posted:
>On Wed, 7 Oct 1998, steve wrote:
>
>> Anyone know how i can log the refering url when someone comes
>> to my page.
>
>Sounds as if you're doing something with a webserver. The docs, FAQs, and
>newsgroups about webservers and related issues may be helpful.
maybe he wants to write a mod_perl handler. in that case the current
Perl Journal might be useful as well ;)
--
brian d foy <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers needs volunteers! <URL:http://www.pm.org/to-do.html>
------------------------------
Date: 7 Oct 1998 22:56:04 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Reading all lines from datafile
Message-Id: <6vgri4$bcm$4@marina.cinenet.net>
Nico (info@edoc.co.za) wrote:
: I'm using Perl5.004 under WIN95
My condolences. :)
: I have the following problem:
:
: I'm trying to read ALL the lines from a datafile one by one for
: processing. The code below reads only every second line.
:
: The datafile was prepared in Notepad, with <enter> at the end of each
: line.
:
: What am I doing wrong?
:
: $filename1 = 'c:\myfiles\testfile.txt';
You might want to get into the habit of using forward-slashes / as
directory separators in your files specs. Believe it or not, *only* the
DOS-family command line interpreters insist on backslashes; internal file
functions (such as are called by open) will take forward or backslashes.
And using forward slashes will save you from massive pain trying to deal
with the dual role of \ as a string escape character as well as a literal.
: open(CAT,$filename1) || die "can't open file $filename1";
You may wish to include $! in what's printed for the die, so you can tell
what caused the open to fail.
: while (<CAT>)
Okay, on each loop iteration, this reads one line from the CAT file,
placing it into the $_ variable, and terminating at EOF.
: {
: $ty =<CAT>;
Now you're reading another line from CAT, and putting it into $ty. The
line read into $_ above is never used. Hence your every-other-line
problem.
: print "$ty\n";}
You might want to use a better indentation-and-braces scheme, one which
makes the logical structure of your code easier to grok at a glance.
: close(CAT);
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| "Ripple in still water, when there is no pebble tossed,
nor wind to blow..."
------------------------------
Date: Wed, 07 Oct 1998 23:02:40 +0000
From: Alex Farber <alex@kawo2.rwth-aachen.de>
Subject: Re: reg-exp: "Buy!!!" -> "Buy!" ?
Message-Id: <361BF310.7E9350A4@kawo2.rwth-aachen.de>
Oh, sorry. I have meant:
how do you substitute more than 3 same letters with one?
Buy !!!! -> Buy !
xxxxxx -> x
Greetings
Alex
--
http://www.simplex.ru/pref.html
------------------------------
Date: Wed, 7 Oct 1998 16:25:51 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: reg-exp: "Buy!!!" -> "Buy!" ?
Message-Id: <MPG.1085985baf3805db9897f8@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and a copy mailed.]
In article <361BF310.7E9350A4@kawo2.rwth-aachen.de> on Wed, 07 Oct 1998
23:02:40 +0000, Alex Farber <alex@kawo2.rwth-aachen.de> says...
> Oh, sorry. I have meant:
>
> how do you substitute more than 3 same letters with one?
>
> Buy !!!! -> Buy !
>
> xxxxxx -> x
s/(.)\1{3,}/$1/g;
If you want that to work on newlines also, add the '/s' modifier.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 7 Oct 1998 23:58:18 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: reg-exp: "Buy!!!" -> "Buy!" ?
Message-Id: <F0HEL7.M59@news.boeing.com>
In article <361BE8DA.621C825@kawo2.rwth-aachen.de>,
Alex Farber <alex@kawo2.rwth-aachen.de> wrote:
>Hi,
>
>here is a regular expression quiz for you:
>How do you change the annoying repeating "!!!"
>(in a web board ;-) to a single "!" ?
>
s/!{2,}/!/g;
hth,
--
Charles DeRykus
------------------------------
Date: Wed, 7 Oct 1998 16:08:43 -0700
From: Mary Jane Goss <gossfam@wolfenet.com>
Subject: regular expressions
Message-Id: <Pine.OSF.3.95.981007160653.32396B-100000@gonzo.wolfenet.com>
How do I remove a semicolon with regular expressions??
I tried the following
$input{'Body'} =~ s/;//;
but it diddnt work
any help appreciated
------------------------------
Date: Wed, 07 Oct 1998 23:36:35 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: regular expressions
Message-Id: <Pine.GSO.4.02A.9810071629000.4710-100000@user2.teleport.com>
On Wed, 7 Oct 1998, Mary Jane Goss wrote:
> How do I remove a semicolon with regular expressions??
> I tried the following
> $input{'Body'} =~ s/;//;
> but it diddnt work
Yes it didd. :-)
But you're probably doing something else wrong. Without seeing the rest of
your code, I can only guess. My guess: You're operating on the wrong
variable. If that's not it, post a small (three line) stand-alone example
program which shows the behavior that you didn't expect. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 7 Oct 1998 23:47:37 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: regular expressions
Message-Id: <6vguip$bcm$6@marina.cinenet.net>
Mary Jane Goss (gossfam@wolfenet.com) wrote:
: How do I remove a semicolon with regular expressions??
: I tried the following
: $input{'Body'} =~ s/;//;
: but it diddnt work
"Didn't work" meaning what? It's always helpful to describe what you
expected to happen vs. what actually did. In this case, I'll lay odds
that the first semicolon in $input{Body} got removed, but all the others
stayed. Add the /g modifier to the substitution to fix this. Or, better,
rewrite it as
$input{Body} =~ tr/;//d;
---------------------------------------------------------------------
| Craig Berry - cberry@cinenet.net
--*-- Home Page: http://www.cinenet.net/users/cberry/home.html
| "Ripple in still water, when there is no pebble tossed,
nor wind to blow..."
------------------------------
Date: Wed, 7 Oct 1998 16:52:58 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: regular expressions
Message-Id: <MPG.10859eb1579ba9539897f9@nntp.hpl.hp.com>
[Posted to comp.lang.perl.misc and a copy mailed.]
In article <Pine.OSF.3.95.981007160653.32396B-100000@gonzo.wolfenet.com>
on Wed, 7 Oct 1998 16:08:43 -0700, Mary Jane Goss <gossfam@wolfenet.com>
says...
> How do I remove a semicolon with regular expressions??
> I tried the following
> $input{'Body'} =~ s/;//;
> but it diddnt work
Why do you think it didn't work? (As some here have said: Did it
reformat your hard disk? Did it turn off the power on your computer?)
Can you show some code that indicates that it didn't work, and how?
Your regex should remove the first semicolon in the string. If you want
to remove them all, use
$input{'Body'} =~ s/;//g;
or (better -- i.e., faster):
$input{'Body'} =~ tr/;//d;
BTW, the single quotes around 'Body' are unnecessary in that context.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 7 Oct 1998 23:52:47 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: return code
Message-Id: <F0HEBz.M3A@news.boeing.com>
In article <01bded1a$47eba4c0$348267a1@echamw030384.ham.ec.bp.com>,
Noli C. <nospam@nospam.com> wrote:
>My Script does some forks and system calls. It works like expected but
>returns 141 to the shell allthough the last command is "exit 0" and the
>script definitely reaches this point.
>What does 141 mean?
>Where do I get general information about perls exit status' ?
>
The word "definitely" always makes me uneasy :)
Consider an admittedly contrived example but note
the statement with exit is reached even though
the return value isn't 0.
perl -e 'system "kill",-13,$$ or exit 0';
echo $? ; # prints 141
'perldoc -f system' and look at the exit status discussion.
Perl's exit status to the shell will mirror those values.
hth,
--
Charles DeRykus
------------------------------
Date: 8 Oct 1998 00:33:45 GMT
From: sitaram@diac.com (Sitaram Chamarty)
Subject: Re: Runtime evaluation of required modules
Message-Id: <slrn71kn4j.mop.sitaram@diac.com>
(I'm way behind in my usenet reading, but I didnt see a reply to
this - pardon if it's a dead horse)
(clp.modules removed - I think that one's for module developers,
not questions like this, isn't it?)
On Fri, 18 Sep 1998 10:26:56 +0100, Andy Marden <amarden@ibm.net> wrote:
>What I didn't count on was that the contents of any module used are
>evaluated at compile time, even if the use if in a conditional
>statement. Hence, Platform_NT.pm is evaluated initially even under HPUX,
>and of course it can't find the Win32:: modules which are used in
>Platform_NT.pm
[snip]
>use Config;
>
>require Exporter;
>
>@ISA = qw(Exporter);
>
>$_ = $Config{'osname'};
>
>SWITCH:
>{
> # Windows NT
> /^MSWin32$/ && do { use Platform_NT; last SWITCH; };
> # HP-UX
> /^hpux$/ && do { use Platform_Unix; last SWITCH; };
Assuming you haven't got a better answer already that my newsfeed
missed, have you tried wrapping all the bits shown above in a
BEGIN block, and changing the use into separate require/import?
------------------------------
Date: 7 Oct 1998 23:28:10 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: send geroge reese (was Re: Call for Participation: Python Conference)
Message-Id: <907802725.854123@thrush.omix.com>
Abigail <abigail@fnx.com> wrote:
>snip<
: Granted, if you want to use OO just because you like to use identical
: function names in very long but different packages, Perl's OO might be
: nice for you.
It's not quite a "just", but it is one of a number of reasons to
use OO without inheritance.
: I would redesign my software if it came to that.
As software gets to the level of "huge", how would a redesign help
fight name collision problems?
>snip<
: Odd. I find Perl's OO model very *impractical* because it leaves the
: programmer which to many things to do and worry about.
I've only found this true of field name collisions. I admit this
single problem is pretty significant however, which is why I'm
quite happy to see fields.pm et al in the latest release.
--
-Zenin (zenin@archive.rhps.org) From The Blue Camel we learn:
BSD: A psychoactive drug, popular in the 80s, probably developed at UC
Berkeley or thereabouts. Similar in many ways to the prescription-only
medication called "System V", but infinitely more useful. (Or, at least,
more fun.) The full chemical name is "Berkeley Standard Distribution".
------------------------------
Date: Wed, 7 Oct 1998 19:47:46 -0500
From: phenix@interpath.com (John Moreno)
Subject: Re: Timing An LWP get request
Message-Id: <1dgjo36.lxa5loy6j4bwN@roxboro0-036.dyn.interpath.net>
Tom Phoenix <rootbeer@teleport.com> wrote:
> On Tue, 6 Oct 1998, Joel Rosenberg wrote:
>
> > From: Joel Rosenberg <jhr@best.com>
> > Reply-To: 4196, Oak, Hill, Ave, Palo, Alto, CA, 94306
>
> I don't _think_ that that's what you want...
>
> > Is there a way to time the get request and move on if it takes more
> > than the time allotted and I don't have to kill the program?
>
> Yes; see section eight of the FAQ. Hope this helps!
Uhm, if this is *specific* to the LWP modules then he ought to search
for timeout and see what he finds....
$ua->timeout([$secs])
(of course I don't make any guarantees about how well it'll work....)
--
John Moreno
------------------------------
Date: 12 Jul 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 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 3924
**************************************