[9385] in Perl-Users-Digest
Perl-Users Digest, Issue: 2980 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 25 13:19:30 1998
Date: Thu, 25 Jun 98 10:00:30 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 25 Jun 1998 Volume: 8 Number: 2980
Today's topics:
ANNOUNCEMENT: clpa doesn't accept perl announcements! <tchrist@mox.perl.com>
Re: ANNOUNCEMENT: clpa doesn't accept perl announcement <merlyn@stonehenge.com>
Can Anyone help? <Jason@esp-multimedia.com>
Re: Can Anyone help? <jdf@pobox.com>
Re: Can someone explain the arrow operator ? (Mike Mckinney)
Re: Can someone explain the arrow operator ? (Matt Knecht)
Re: Can someone explain the arrow operator ? (Mike Mckinney)
Re: challenge: put search into an array (Allan Hawdon)
Re: challenge: put search into an array <jdf@pobox.com>
Help with Loops r_pedersen@my-dejanews.com
help with loops rpedersen@nextlink.net
Re: help with loops (Allan Hawdon)
Re: help! : Arrays in Perl (Patrick Timmins)
Re: how to read a binary file containing C structures (Jeffrey R. Drumm)
Re: List of Known Memory Leaks? <tchrist@mox.perl.com>
Re: Newbie sort print question (Larry Rosler)
Re: Perl debugger with GUI ptkdb Unix/Win95/NT Compatib chuckk@monmouth.com
Re: Perlre needs patch? (was: searching with Perl ?) <dlaser@ermine.ox.ac.uk>
Problem with a script (S. Young)
Queues <markh@manhatten.prestel.co.uk>
Regexp/Email header problem <hminter@herc.com>
Re: Regexp/Email header problem <jdf@pobox.com>
Re: s/\s//g - causing strange result <jdf@pobox.com>
Tricky problem <pinne@pegit.se>
Re: Trying to append text to a file properly. <jdf@pobox.com>
Using the last operator to break out of sub routines. <airvent@ktis.net>
Re: Using the last operator to break out of sub routine <tchrist@mox.perl.com>
Re: What a Crappy World (oh, yes!) <ngouah@erols.com>
Re: What a Crappy World (oh, yes!) <tchrist@mox.perl.com>
Re: What a Crappy World <tchrist@mox.perl.com>
Re: What a Crappy World (The Morph on the Other Side of the Mirror)
Re: What a Crappy World <peter@peterdudley.com>
Re: What a Crappy World (Patrick Timmins)
Year 2000 And Information Warfare News Briefs <angela@nospam.iwarfare.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 25 Jun 1998 16:02:13 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: ANNOUNCEMENT: clpa doesn't accept perl announcements!
Message-Id: <6mtsa5$ces$1@csnews.cs.colorado.edu>
Here's my thesis:
If you want to read announcements about Perl, you should be able
to do so in comp.lang.perl.announce. Right now, you can't do that.
This is an easily fixable problem.
Here are just a few of the things you are missing:
1) Did you know that there is a Perl Developer's Workshop
headed by Larry? Would you like to?
2) Did you know that the deadline for early registration to the Perl
Conference is coming up? Would you like to?
3) Did you know that there is an Obfuscated Perl Contest? Would you
like to?
4) Do you know about the interactive Perl Quiz? Would you like to?
These and others like them are announcements which, insofar as I can
discern, fall within the general purview of being of general interest
to the Perl community. Why they are censored is truly beyond me.
If anyone would like to see announcements of this sort, I implore you to
*gently* ask Randal in *private* mail. He's said that he'll change the
charter in a few months, but that even then, many announcements still
won't be allowed. But by that time, it will be too late. Some of these
things have timelines.
Let there be no mistake here: I don't want Randal to stop being
moderator! By all means, let him carry on and all. It's not a fun job,
and *I* certainly don't want it. I'd be surprised if anyone else did.
But he really should approve announcements that further Perl. He can
do this now without any kind of vote. It's his right as moderator--
and his duty as who he is to help not hinder the community. It's
an easy fix.
And yes, some of us already discussed this in smaller, less public
fora first. Because this effort has gone nowhere for lack of voices,
I'd like to see people in the general community express an opinion to
Randal about this so he has more perspectives to consider. Say what you
will, but speak up one way or the other. Please send your mail directly
to Randal so that this needn't escalate into more noise in this group.
--tom
--
Love your enemies: they'll go crazy trying to figure out what you're up
------------------------------
Date: Thu, 25 Jun 1998 16:32:00 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: ANNOUNCEMENT: clpa doesn't accept perl announcements!
Message-Id: <8c1zsdwiha.fsf@gadget.cscaper.com>
>>>>> "Tom" == Tom Christiansen <tchrist@mox.perl.com> writes:
Tom> If anyone would like to see announcements of this sort, I implore
Tom> you to *gently* ask Randal in *private* mail. He's said that
Tom> he'll change the charter in a few months, but that even then,
Tom> many announcements still won't be allowed. But by that time, it
Tom> will be too late. Some of these things have timelines.
And to save my time, which Tom now seems to want to waste, EVERYONE
that writes me on this matter will get the following canned response:
I have announced an intention to change the charter to a much more
liberal charter, in news.groups, on the P5P mailing list, and also on
the IRC-efnet #perl channel (Tom frequents all three areas, and has
seen these announcements). I want this charter change to take place
in alignment with the introduction of comp.lang.perl.moderated, which
I believe will pass. (If it doesn't pass, I'll still go ahead with a
charter change independently.)
I want the charter to serve the community, and it seems the existing
charter does not fully cover unforseen items, hence the change. I
want to first propose a draft charter, and have some discussion, and
then I'll announce the final charter. I'm not prepared at this time
to propose a draft charter until I've had time to give it some more
thought. I believe everything that Tom proposes would be allowed in
the final charter.
I have no intention of speeding up this timetable. So I'll continue
to uphold the current charter until such time as this action and
public comment is complete.
Please don't write me. It won't move things along any faster. CLPA
has had this *same* charter since 1995 when it was created. A few
more weeks isn't going to hurt significantly (or we could argue
recursively that it has hurt all along, so the pain is still equal :-).
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,990.69 collected, $186,159.85 spent; just 67 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: Thu, 25 Jun 1998 17:02:21 +0100
From: Jason L Rudland <Jason@esp-multimedia.com>
Subject: Can Anyone help?
Message-Id: <3592748D.94092176@esp-multimedia.com>
Hi,
I'm fairly new to Perl, so forgive me if I being a bit thick, but I'm a
stuck!
I have a perl script which opens a DBM database and reads the
appropriate record. I also pass the script a parameter, which contains a
field name in the DBM database. What I want to do is print the contents
of the DBM field with the same name as the contents of the parameter I
passed to the script.
What I think I need to do is perform a macro-substitution so that I can
say :
print $FieldName;
and instead of printing the name of the field in the DBM file, it prints
the contents of the DBM field.
Is this clear??
Can it be done???
Any help is greatfully received,
Jason Rudland
------------------------------
Date: 25 Jun 1998 12:58:14 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: Jason L Rudland <Jason@esp-multimedia.com>
Subject: Re: Can Anyone help?
Message-Id: <ra0dz7m1.fsf@mailhost.panix.com>
Jason L Rudland <Jason@esp-multimedia.com> writes:
> I have a perl script which opens a DBM database and reads the
> appropriate record.
[snip]
We'll be better able to help you if you post a brief example of the
code that's giving you trouble.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf/
------------------------------
Date: 25 Jun 98 16:32:47 GMT
From: mike@bga.com (Mike Mckinney)
Subject: Re: Can someone explain the arrow operator ?
Message-Id: <slrn6p4uvp.a16.mike@mike.local.net>
On Thu, 25 Jun 1998 15:38:11 GMT, Joel Coltoff <joel@wmi0.wmi.com> wrote:
>In article <slrn6p4qm1.9vv.mike@mike.local.net>,
>Mike Mckinney <mikem@wans.net> wrote:
>>For what it's worth, I have seen code using the arrow operator in this group,
>>but it still is'nt clear to me.
>
> This arrow (=>) or this one (->)?
>
I'm hoping to find out about the -> operator. I had thought that => was
another form of the , operator..Is there a difference ?
TIA
--
mikem@wans.net , mike@bga.com
------------------------------
Date: Thu, 25 Jun 1998 16:39:28 GMT
From: hex@voicenet.com (Matt Knecht)
Subject: Re: Can someone explain the arrow operator ?
Message-Id: <43vk1.49$ja2.487362@news2.voicenet.com>
Mike Mckinney <mike@bga.com> wrote:
>On Thu, 25 Jun 1998 15:38:11 GMT, Joel Coltoff <joel@wmi0.wmi.com> wrote:
>I'm hoping to find out about the -> operator. I had thought that => was
>another form of the , operator..Is there a difference ?
perldoc perlref
Is what you want. => really just is syntactic sugar for ',' but I
wouldn't be suprised if there's a caveat buried somewhere about it...
with Perl, there usually is! :)
--
Matt Knecht - <hex@voicenet.com>
"496620796F752063616E207265616420746869732C20796F7520686176652066
617220746F6F206D7563682074696D65206F6E20796F75722068616E6473210F"
------------------------------
Date: 25 Jun 98 16:39:23 GMT
From: mike@bga.com (Mike Mckinney)
Subject: Re: Can someone explain the arrow operator ?
Message-Id: <slrn6p4vcf.a16.mike@mike.local.net>
On Thu, 25 Jun 1998 16:33:45 +0100, F.Quednau <quednauf@nortel.co.uk> wrote:
>Mike Mckinney wrote:
>The arrow operator isn't introduced in 'learning Perl' as that book does not
>deal with references. Read the perlref page which should bring you a bit further
>on understanding the arrow operator, which is basically something to
>'dereference' a reference.
Quite true, the arrow operator isn't "covered" in "Learning Perl", but it is
introduced, in the section on "object oriented programming", a very small
section to be sure, and I'm sure it was'nt meant to explain the arrow operator,
so I'm not trying to cast the book in a bad light.
I did read through the perlef page, as suggested in the perlop page, but I
just can't seem to grasp the in's & out's of the arrow operator. I've also
searched through deja news, and read several posts in the porters newsgroups,
but did not find any that actually explained the operator.
I'm hoping maybe someone can show some basic examples of the use, that I could
apply myself, and eventually "figure it out".
TIA.
--
mikem@wans.net , mike@bga.com
------------------------------
Date: 25 Jun 98 17:27:31 BST
From: udaa460@alder.cc.kcl.ac.uk (Allan Hawdon)
Subject: Re: challenge: put search into an array
Message-Id: <$bcyS5BYBqzf@alder.cc.kcl.ac.uk>
In article <Pduk1.45$ja2.460304@news2.voicenet.com>, hex@voicenet.com (Matt Knecht) writes:
> Sean McAfee <mcafee@qix.rs.itd.umich.edu> wrote:
>>In article <6mto73$6g2$1@nnrp1.dejanews.com>, <spostma@iserv.net> wrote:
>>@array = ($temp =~ /name=(.*)/g);
>
<snip>
> clearest way to write this would be:
>
> @array = split(/name=/, $str);
>
> Which gives the expected:
>
> $array[0] == first
> $array[1] == second
> $array[2] == third
Almost. $array[0] will contain whatever gunk (if any) precedes the
first occurrence of 'name='. $array[1] will contain 'first' and so on.
If I remember correctly this is mentioned on the man pages.
It's a good idea to do something like
for (@array) { print "***$_***\n" }
when you're experimenting with this sort of thing.
>
> And has the benefit of being extremly easy to read! :)
Indeed it does..
Allan
------------------------------
Date: 25 Jun 1998 12:48:38 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: hex@voicenet.com (Matt Knecht)
Subject: Re: challenge: put search into an array
Message-Id: <wwa5z821.fsf@mailhost.panix.com>
hex@voicenet.com (Matt Knecht) writes:
> Sean McAfee <mcafee@qix.rs.itd.umich.edu> wrote:
> >In article <6mto73$6g2$1@nnrp1.dejanews.com>, <spostma@iserv.net> wrote:
> >@array = ($temp =~ /name=(.*)/g);
>
> This won't work. The greediness of (.*) pulls all of $temp in,
> including other 'name=' elements.
You shouldn't use the dot, then. How about non-space characters?
#!//c/perl/bin/perl -w
my $s = 'name=foo name=bar name=baz name=zab';
my @names = $s =~ /name=(\S+)/g;
print "@names\n";
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf/
------------------------------
Date: Thu, 25 Jun 1998 16:11:49 GMT
From: r_pedersen@my-dejanews.com
Subject: Help with Loops
Message-Id: <6mtss4$dtp$1@nnrp1.dejanews.com>
I am using a foreach loop combined with a regular expression. When I find the
line that I want I want to read the next three lines into variables. Can you
help or point me in the direction of help?
for $line (@LogFile) {
if $line =~ /^something.../i {
capture the next three lines here..... this is were I need help
manipulate everything here
}
}
spit out some data
Please include my email in any reply.
Thanks,
Ryan Pedersen
Intranet/Internet Developer
NEXTLINK Communications
rpedersen@nextlink.net
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Thu, 25 Jun 1998 16:12:50 GMT
From: rpedersen@nextlink.net
Subject: help with loops
Message-Id: <6mtsu1$du9$1@nnrp1.dejanews.com>
I am using a foreach loop combined with a regular expression. When I find the
line that I want I want to read the next three lines into variables. Can you
help or point me in the direction of help?
for $line (@LogFile) {
if $line =~ /^something.../i {
capture the next three lines here..... this is were I need help
manipulate everything here
}
}
spit out some data.
Thanks,
Ryan Pedersen
Intranet/Internet Developer
NEXTLINK Communications
rpedersen@nextlink.net
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 25 Jun 98 17:41:24 BST
From: udaa460@alder.cc.kcl.ac.uk (Allan Hawdon)
Subject: Re: help with loops
Message-Id: <41lCuGWYPCt2@alder.cc.kcl.ac.uk>
In article <6mtsu1$du9$1@nnrp1.dejanews.com>, rpedersen@nextlink.net writes:
> I am using a foreach loop combined with a regular expression. When I find the
> line that I want I want to read the next three lines into variables. Can you
> help or point me in the direction of help?
>
> for $line (@LogFile) {
> if $line =~ /^something.../i {
> capture the next three lines here..... this is were I need help
> manipulate everything here
> }
> }
Would it be too presumptious to assume that @LogFile is the contents of a
Log file? If not, and if there is no other good reason why you want to
read the entire file at once, you might be better off reading it a line
at a time in a while loop.
Allan
------------------------------
Date: Thu, 25 Jun 1998 16:06:06 GMT
From: ptimmins@netserv.unmc.edu (Patrick Timmins)
Subject: Re: help! : Arrays in Perl
Message-Id: <6mtshe$dbi$1@nnrp1.dejanews.com>
In article <35924387.A260745F@jmu.edu>,
Justin Voshell <vosheljh@jmu.edu> wrote:
>
> Hi all,
>
> I am pretty new with Perl an can't seem to find a function that will
> tell me the length of an array. Is there such a thing [there must be]?
>
[snip]
You're right, there must be many ways to do this. What have you tried so far?
Did you try looking in the "perldata" section of your perl documentation?
Hope that helps.
Patrick Timmins
U. Nebraska Medical Center
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Thu, 25 Jun 1998 16:38:00 GMT
From: drummj@mail.mmc.org (Jeffrey R. Drumm)
Subject: Re: how to read a binary file containing C structures
Message-Id: <35947b99.531836089@news.mmc.org>
[ posted to comp.lang.perl.misc and a courtesy copy was mailed to the cited
author ]
On Thu, 25 Jun 1998 08:30:03 -0400, "Bill Jones, FCCJ Webmaster"
<webmaster@fccjmail.fccj.cc.fl.us> wrote:
>Aravind Nallan wrote:
>>
>> Hi,
>>
>> I have a binary file produced by a C program which contains C structures
>> written using fwrite. Do we have any way of reading them in perl and
>> writing out into Ascii?
>>
>> Thanks
>> Aravind
>
>
>Look toward bin mode while reading files in.
(snip)
A point of clarification: binmode has no significant effect on files used in
OSes that are binary clean, such as Unix. Win32 (and probably VMS) C libraries
treat 'binary' and 'text' files differently . . . the Unix flavors do not.
--
Jeffrey R. Drumm, Systems Integration Specialist
Maine Medical Center - Medical Information Systems Group
drummj@mail.mmc.org
"Broken? Hell no! Uniquely implemented!" - me
------------------------------
Date: 25 Jun 1998 16:03:46 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: List of Known Memory Leaks?
Message-Id: <6mtsd2$ces$2@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
axb21@po.CWRU.Edu (Anthony Bucci III) writes:
:I was wondering if anyone could point me to a list of known memory leaks in
:perl.
The only one we know about is a failed eval STRING construct.
--tom
--
The X server has to be the biggest program I've ever seen that doesn't
do anything for you. --Ken Thompson
------------------------------
Date: Thu, 25 Jun 1998 09:22:26 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Newbie sort print question
Message-Id: <MPG.ffc191e7775bf8f9896f5@nntp.hpl.hp.com>
In article <01bda045$b75cecf0$770de689@adsmalljl>, Caterpillar, Inc.
<smallenberger_jason_l@cat.com> says...
...
> History:
> I have a program that reads in a set of files. Each file is of a different
> size. After this it is put into an array to order that data and put into
> yet another array to be sorted. After the file is sorted it is printed out
> into a file. For a lack of a better way of doing it I have 5 different
> areas that do the same thing (bad programming but it works).
Learn how to write your own subroutines.
> Question:
> When the loop hits the 17 input file it starts to give duplicated data.
> Everything happens on line 10. From there on out everything is duplicated.
> This first value is the bad one and the second is good. This happens
> until it hits the end of the loop (file 26). I think that the problem is
> within the loop. However, the first 16 files work fine. If there is a
> better way of doing this GREAT. I have looked at most of the perldoc,
> perlfaq's, perl web pages, and several books. I did not see much that
> would help. Thanks.
There is nothing in your code that would behave differently from the 17th
file on. You are not accumulating memory, and you would get an error
report if your output file was too big.
I'll make some observations and proposals that will address style and
clarity; perhaps they'll help with your resolution of the mystery.
> #!/usr/perl/perl5.004_04/perl -w
#LR: Good. -w is your friend.
> #!/usr/bin
#LR: Seems irrelevant.
> use Getopt::Long;
#LR: Not used in this snippet.
> $k = 1;
#LR: Start to use 'use strict;'. This is another friend.
#LR: Then say 'my $k = 1;' and similarly for all your variables.
> $util = "Utilization of Port";
> while ($k <= 26)
#LR: Better style (keep it together): for ($k = 1; $k <= 26; $k++)
> {
> $i = 0;
> $j = 0;
#LR: Array indexing is generally un-Perlish. See below.
> $count = 0;
#LR: This can go away too. See below.
> $flag1 = 0;
> $port = "port$k";
> open (UTIL, "/usr/OV/tmp/smalljl/utilport$k") || die "Can't open Util\n";
#LR: Add $! to the diagnostic to tell *why* the open failed.
> open (OUTPUT, ">>/home/smalljl/temp/port$k") || die "Can't open
> output\n";
#LR: Do you mean to append to a file (>>) or just write it (>)?
> while (<UTIL>)
> {
> @F = split(' ');
> $date = ($F[0]);
> $time = ($F[1]);
> $dns = ($F[2]);
> $data = ($F[3]);
> $ip = ($F[4]);
#LR: my ($date, $time, $dns, $data, $ip) = split(' ');
> $util[$i] = "$dns,$date,$time,$data,$ip";
#LR: push @util, "$dns,$date,$time,$data,$ip";
> $i++;
#LR: Don't need this index anymore.
> $count++;
#LR: This won't be needed.
> }
#LR: The above could be done nicer using 'map', but better to take
#LR: baby steps for now.
> @sorted = sort @util;
> while ($j != $count)
> {
> print OUTPUT "$port,$util,$flag1,$sorted[$j]\n";
> $j++;
> }
> @sorted = ();
#LR: You can replace *all* of the above by this:
#LR: foreach (sort @util) { print OUTPUT "$port,$util,$flag1,$_\n" }
> close (OUTPUT);
#LR: Test here just in case: or die "Can't close output $k. $!.\n";
#LR: You might also check the print statement, just in case.
> close (UTIL);
#LR: This could be moved right after the last use of UTIL for clarity.
> $k++;
#LR: Moved into the for ( ; ; ) statement.
> }
> print "End of program\n";
#LR: Whew!
As you can see, *nothing* I have proposed changes the behavior of the
program. I have compiled but not run it (because I don't have your
data), but can't see anything wrong. Here it is cut down:
#!/usr/perl/perl5.004_04/perl -w
use strict;
my $util = "Utilization of Port";
my $k;
for ($k = 1; $k <= 26; $k++) {
my $flag1 = 0; # This never changes??? Move it outside.
my $port = "port$k";
open (UTIL, "/usr/OV/tmp/smalljl/utilport$k") ||
die "Can't open Util $k. $!.\n";
my @util;
while (<UTIL>) {
my ($date, $time, $dns, $data, $ip) = split(' ');
push @util, "$dns,$date,$time,$data,$ip";
}
close (UTIL);
open (OUTPUT, ">/home/smalljl/temp/port$k") ||
die "Can't open output $k. $!.\n";
foreach (sort @util) { print OUTPUT "$port,$util,$flag1,$_\n" }
close (OUTPUT) or die "Can't close output $k. $!.\n";
}
print "End of program\n";
Please let us know if that helps, or if it still misbehaves.
--
Larry Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Thu, 25 Jun 1998 16:24:12 GMT
From: chuckk@monmouth.com
Subject: Re: Perl debugger with GUI ptkdb Unix/Win95/NT Compatible
Message-Id: <6mttjc$ene$1@nnrp1.dejanews.com>
In article <Ev3zEo.Hv4@world.std.com>,
aep@world.std.com (Andrew E Page) wrote:
>
> ptkdb A Perl debugger with a perlTk Graphical User Interface
>
I downloaded and tried ptkdb. It looks like alot of effort is going into it!
I was able to use ptkdb to run & debug a perl program which was itself
using perl/Tk. [ I know - it was an evil thing to try ;) ]
I love the fact that it runs on multiple platforms, as opposed to the
activstate debugger under windows.
One suggestion is to be able to specify in the window displaying the code, to
move to a specific line number.
chuckk
chuckk@monmouth.com
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 25 Jun 1998 16:40:56 +0100
From: Rob Hutchings <dlaser@ermine.ox.ac.uk>
Subject: Re: Perlre needs patch? (was: searching with Perl ?)
Message-Id: <yk3wwa5zdyv.fsf@ermine.ox.ac.uk>
phenix@interpath.com (John Moreno) writes:
>
> F.Quednau <quednauf@nortel.co.uk> wrote:
>
> > Funny enough, the perlre page doesn't seem to explicitly state what g
> > does, but I think I read between the lines that it is the global match
> > operator.
>
> You're absolutely right - both about what it does and about it not being
> mentioned in perlre (at least not in the version I have).
>
The perlre page refers you to perlop to find out about operators,
so no wonder it doen't mention g!
Rob
------------------------------
Date: 25 Jun 1998 16:53:16 GMT
From: iris@netaxs.com (S. Young)
Subject: Problem with a script
Message-Id: <6mtv9s$os@netaxs.com>
I apologize in advance if this is considered a cgi-problem and not a Perl
problem...
I have been using the standard Perl counter from Matt's Script Archive for
a number of my web sites. This script seems to have an annoying bug -
from time to time the count gets reset to 1, which is annoying and
embarassing. This seems to be happening when 2 people accesss the counter
at the same time. My theory is that one access writes to the count file
while the other is trying to read it. The read sees an empty file,
interprets this as a count of 0 and increments to 1.
I have tried to add a lock but it has not helped, perhaps because it is on
the write and not on the read.
Can anybody tell me what I can do? Thanks in advance for any help.
Seth
P.S. Here is the problematic routine:
sub get_num {
open(COUNT,"$count_file") || die "Can't Open Count Data File: $!\n";
$count = <COUNT>;
close(COUNT);
if ($count =~ /\n$/) {
chop($count);
}
$count++;
open(COUNT,">$count_file") || die "Can't Open Count Data File For
Writing: $!
\n";
flock(COUNT, 2);
print COUNT "$count";
flock(COUNT, 8);
close(COUNT);
}
------------------------------
Date: Thu, 25 Jun 1998 16:27:33 +0100
From: "mark hutchinson" <markh@manhatten.prestel.co.uk>
Subject: Queues
Message-Id: <6mtqmq$bqh$1@phys-ma.sol.co.uk>
I am planning on writing a print queueing system in Perl5. Multiple output
devices, queueing, prioritising, queue management etc etc.
I have O'Reilly's "Advanced Perl" where it scratches the surface using RPC
and Msg.
Before I spend lots of time writing this -- has anyone already done it and
if so, would they be willing to release it? OR does anyone know of a source
of information where I could get a head start?
=================
Mark Hutchinson
Technical Consultant
Xyvision Ltd, UK
------------------------------
Date: Thu, 25 Jun 1998 15:59:06 GMT
From: "H. Wade Minter" <hminter@herc.com>
Subject: Regexp/Email header problem
Message-Id: <3592734E.1BED2B16@herc.com>
Hello,
I'm trying to strip out email headers in a string, while leaving the
message intact. I've tried various regexps, checked both books, RFTM,
prayed in Incan monkey gods, everything, but the fool thing STILL isn't
doing right.
The headers are the standard SMTP headers, starting with "From
someuser@somewhere....." and ending with the last header, and blank
line, and the start of the message.
I have the entire message loaded into one big $string, with newlines (I
think...more on that later) seperating the lines.
Here is a sample header that doesn't work (some extranious stuff
snipped):
----
>From ColParker@webtv.net Wed Jun 24 23:25:16 1998
Return-Path:
Received: from mailsorter-105.bryant.webtv.net
(mailsorter-105.iap.bryant.webtv.net [207.79.35.95])
by kenbridge.lunenburg.org (8.8.7/8.8.7) with ESMTP id XAA12241
for ; Wed, 24 Jun 1998 23:25:15 -0400
From: ColParker@webtv.net (Thomas Parker)
Date: Wed, 24 Jun 1998 22:26:12 -0500 (CDT)
To: wrestling@lunenburg.org
Subject: "Brad_Armstrong"
Message-ID: <22792-3591C354-3564@mailtod-121.bryant.webtv.net>
Content-Type: Text/Plain; Charset=US-ASCII
Content-Transfer-Encoding: 7Bit
MIME-Version: 1.0 (WebTV)
Status: RO
X-Status:
MESSAGE BEGINS HERE
-----
And here are some of the regexps I've tried with no success:
* $newmessage =~ s/From .*\n^\n//ms; # Leaves nothing in $newmessage
* $newmessage =~ s/From .*\n\n//ms; # Leaves EVERYTHING in $newmessage
* $newmessage =~ s/From .* \n\n//ms; # Ditto
* $newmessage =~ s/From [\w]+\n\n//ms; # Ditto again
Any assistance would be appreciated.
Thanks,
Wade
------------------------------
Date: 25 Jun 1998 12:56:04 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: "H. Wade Minter" <hminter@herc.com>
Subject: Re: Regexp/Email header problem
Message-Id: <u359z7pn.fsf@mailhost.panix.com>
"H. Wade Minter" <hminter@herc.com> writes:
> I'm trying to strip out email headers in a string, while leaving the
> message intact.
The Incan monkey gods should have led you straight here:
# trash everything from the beginning of the string through
# the first double-newline.
$message =~ s/^.*?\n\n//s;
Or you could use a mail-parsing module from the CPAN.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf/
*amused when gnus included "ColParker" as one of the cc recipients.*
------------------------------
Date: 25 Jun 1998 12:35:02 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: Jonathan Feinberg <jdf@pobox.com>
Subject: Re: s/\s//g - causing strange result
Message-Id: <3ect1j21.fsf@mailhost.panix.com>
Jonathan Feinberg <jdf@pobox.com> writes:
> Of course, that's iff you've used capturing parens, which Mr. Kilburn
> didn't, which is why $1 is undef.
Of course, you knew that, as was made clear by a careful re-read of
your post.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf/
------------------------------
Date: Thu, 25 Jun 1998 18:17:22 +0200
From: Bjvrn-Eke Segrell <pinne@pegit.se>
Subject: Tricky problem
Message-Id: <35927812.773E@pegit.se>
Hi,
I have a somewhat awkward soluton that i need to solve:
A web-server is recieving customer-orders from the internet
and stores them in a database.
This is done through a Perl-script on NT S 4.0 running IIS 3.0,
communicating w MS SQL server on another machine.
What i need to do is this: place another server for recieving orders
somewhere "else" on the net, when this server recieves the orders it
shall just "relay" them to another server, invisible to the client
putting the order.
I would want something like an odbc data-source accesible from the
internet.
I know this might not be the best group to this question to, in that
case please direct me.
/Cheers
Bjvrn-Eke Segrell
--
Bjvrn-Eke Segrell / Pegit AB
Email:pinne@pegit.se
Url:http://www.pegit.se
Phone:+46-(0)8-56030220, Fax:+46-(0)8-56034353
------------------------------
Date: 25 Jun 1998 12:37:10 -0500
From: Jonathan Feinberg <jdf@pobox.com>
To: "Ric Alcazar" <alcazar@netcomp.net>
Subject: Re: Trying to append text to a file properly.
Message-Id: <zpf1z8l5.fsf@mailhost.panix.com>
"Ric Alcazar" <alcazar@netcomp.net> writes:
> I've tried this in WIN32 and it seems to work fine, however, in
> UNIX, it doesn't. Please help, I've don't understand what I'm doing
> wrong.
Without a brief example of your code, which demonstrates the undesired
behavior, there's no good way for us to help you.
--
Jonathan Feinberg jdf@pobox.com Sunny Brooklyn, NY
http://pobox.com/~jdf/
------------------------------
Date: Thu, 25 Jun 1998 11:04:54 -0500
From: Jay <airvent@ktis.net>
Subject: Using the last operator to break out of sub routines.
Message-Id: <35927525.4B45C1E5@ktis.net>
Around the tenth line of the following code i used the last operator...
I think i used it correctly, it should break out of the sub routine and
goto where &playerguess was called from? I think i included enough code
to diagnose the problem . the entire program is around 171 lines long.
i didn't feel that it was neccessary to post the whole thing. Was it?
Thanks,
Jay
#...somecodedeleted...
sub playerguess {
print "Your guess: ";
$guess = <STDIN>;
$playerattempts++;
&checkguess;
if ($guess == $answer) {
print "You win! $guess is the right answer!\n";
$totalattempts = $playerattempts + $attempts;
print "I guessed $attempts times and you guessed $playerattempts.
last;
} elsif ($guess != $answer) {
if ($guess > $answer) {
print "$guess is too high.\n";
$high = $guess;
$playerhigh = $high--;
if ($playerhigh > $comphigh) {
$high = $comphigh;
}
&compguess;
} elsif ($guess < $answer) {
print "$guess is too low.\n";
$low = $guess;
$playerlow = $low++;
if ($playerlow < $complow) {
$low = $complow;
}
&compguess;
} else {
print "ERROR! This shouldn't happen.\n";
}
} else {
print "Error...";
}
}
#...somecodedeleted...
------------------------------
Date: 25 Jun 1998 16:15:55 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Using the last operator to break out of sub routines.
Message-Id: <6mtt3r$ces$5@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
airvent@ktis.net writes:
:Around the tenth line of the following code i used the last operator...
:I think i used it correctly, it should break out of the sub routine and
:goto where &playerguess was called from?
One typically exits subroutines with the return statement.
Using last to do so is considered of dubious form.
--tom
--
``The lyf so short, the craft so long to lerne.'' - Chaucer
------------------------------
Date: Thu, 25 Jun 1998 12:22:31 -0400
From: Ngouah A Nguiamba <ngouah@erols.com>
To: Olga <katzman@students.uiuc.edu>
Subject: Re: What a Crappy World (oh, yes!)
Message-Id: <35927947.7A51@erols.com>
Olga wrote:
>
> I am not telling mr. Christiansen how to post.
Is that so ? Aha !
> P.S. Since I posted yesterday I've had several other people e-mail me and
> say that they wholeheartedly agree with me, but they are too afraid of
> geting "torn apart" by the people here.
What a brave and courageous group of folks you are surrounded with.
May be it's time for you to join them ?
Ngouah Nguiamba
------------------------------
Date: 25 Jun 1998 16:08:37 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: What a Crappy World (oh, yes!)
Message-Id: <6mtsm5$ces$3@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
Olga <katzman@students.uiuc.edu> writes:
:That is the impression I got from talking to the people that did feel
:insulted and threatened.
Proof by anonymous anecdote isn't.
--tom
--
Supercomputer - a computer that can complete an endless loop in under 5 minutes
------------------------------
Date: 25 Jun 1998 16:10:30 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: What a Crappy World
Message-Id: <6mtspm$ces$4@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
Ngouah A Nguiamba <ngouah@erols.com> writes:
:Would be nice if you could have noticed by now that it is
:common practice to put your answers below/after the original
:post you are answering to and not first/above/on top of it.
It's also impolite to include so much quoted material as she
tends to do. I think her newsreader could use a tune-up
in its configuration settings. :-)
--tom
--
"SPARC" is "CRAPS" backwards --Rob Pike
------------------------------
Date: 25 Jun 1998 12:42:29 -0400
From: gtc@panix.com (The Morph on the Other Side of the Mirror)
Subject: Re: What a Crappy World
Message-Id: <6mtull$9p5@panix3.panix.com>
Lloyd Zusman <ljz@asfast.com> writes:
>fl_aggie@thepentagon.com (I R A Aggie) writes:
>> [ ... ]
>It's also a crappy world when teachers in elementary school (to re-use
>my latest, favorite analogy <g>)
[...]
>If you don't want to be a "teacher" here in c.l.p.misc, then don't do
>it. But if you have chosen that role for yourself, then don't forget
>that almost each "newbie" that shows up here is like a brand new
>second-grade student.
Your favorite analogy is broken; clpm isn't the second grade. If you
must use an educational model, think of it as somewhere between an
advanced seminar and a master class. As many people have pointed out
over and over again, the teachers here have provided extensive
documentation, and have said "Go home home and read this. If you have
and questions on what you've just read, we'll be more than happy to
answer them; if you haven't done your homework, then please just sit
back and listen." Not at all unreasonable.
Which isn't to say that second graders aren't welcome here; but we
won't insult their intelligence by lowering our standards for them.
--d/M
~~
{} Q.E.D. is just latin for "Duh!"... | dvora silberman
{} - beth s linker | gtc@panix.com
------------------------------
Date: Thu, 25 Jun 1998 09:53:30 -0700
From: pete <peter@peterdudley.com>
Subject: Re: What a Crappy World
Message-Id: <3592808A.560DA30F@peterdudley.com>
Perhaps another take on this.
Personally, I like to dig through the references and FAQs and online
resources whenever possible because I find I learn a lot of unrelated
facts and techniques that I would not have otherwise. I also like to
try multiple ways of doing something just to see what happens.
I suspect the experts generally share that characteristic (though I'm no
expert in Perl!), so they get angry when someone who has a task to
complete asks a question that could be figured out in roughly the same
time with a little experimentation and digging.
So, one type of expert has this philosophy: If I answer every question
for you, will you ever grow and improve your abilities, or will you
simply rely on the fact that you can ask any question at any time?
These experts often don't post, or they post the polite replies with
gentle nudges towards learning it yourself.
Then there are the other experts that are simply snobs. They feel a
need to put others down in order to "prove" their expertise. I
personally feel that if anyone insults me for ignorance, it is a mark of
their own feelings of inadequacy. After all, what makes them so special
if everyone else can do the same things they do? Better to make other
people feel small and maintain that feeling of accomplishment and
eliteness. (Why else would someone post a digest of their resume as
justification for their behavior?)
Etiquette works both ways. Miss Manners would not advocate rudeness as
a response to ignorance, and neither can I. Every rude post decreases
my respect not only for the rude poster but also for all Perl "experts."
Pete.
Olga wrote:
> Some of these people have tried using it.
> ....
> So many people here are so cocky, as if they were born with some innate
> knowledge of Perl and they never had to actually sit down and figure
> anything out.
------------------------------
Date: Thu, 25 Jun 1998 16:41:01 GMT
From: ptimmins@netserv.unmc.edu (Patrick Timmins)
Subject: Re: What a Crappy World
Message-Id: <6mtuit$g5b$1@nnrp1.dejanews.com>
In article <Pine.SOL.3.96.980625083613.20991B-100000@ux9.cso.uiuc.edu>,
Olga <katzman@students.uiuc.edu> wrote:
>
> I am not saying that referring a new user to the FAQ is insulting. I am
> referring to other comments made by people on this group, either in
> private or as a public post, such as, "That question is so stupid I can't
> even begin clarifying it for you, so i am not going to".
> That type of a response helps no one, and really just wastes the time the
> person given and recieving the help.
> Olga
: On Wed, 24 Jun 1998, Patrick Timmins wrote: : : Why not do both? Help them
and give them a prod. Which is what virtually every : FAQ I've ever seen on
this list has received. You may not like the help, just : like you may not
like wound debridement or vaccination shots, but it is, in : fact, still help
(and the appropriate help at that). : : Don't be such a big baby! :) : [snip]
I guess I'll try to be a bit more clear: Sometimes the best help does not
"feel good". In fact, sometimes it can be extremely painful. Social pressure
can sometimes be painful.
If you can take criticism constructively, and try to hold yourself back from
going on the defensive, you can often see the seeds of truth in the criticism
(they are the things that make you go on the defensive in the first place).
This isn't something anyone is born with ... your parents help you learn it
as you grow up, and as you get older and older, it's easier to do. But some
people never learn to do this, and they never learn to benefit from the
criticism of others.
Life is short! Have a laugh! Don't worry! Be happy! Try hard! Do your best!
Patrick Timmins
U. Nebraska Medical Center
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Thu, 25 Jun 1998 17:23:48 PST
From: <angela@nospam.iwarfare.com>
Subject: Year 2000 And Information Warfare News Briefs
Message-Id: <06251998172348angela@nospam.iwarfare.com>
Year 2000 And Information Warfare News Briefs
Get all the latest Year 2000 and Information Warfare news delivered free, directly to your email account with no advertising by subscribing to the iWarfare News Briefs.
What are the Year 2000 and Information News Briefs
The Year 2000 and Information Warfare News Briefs are designed to keep you up to date with the all the latest news stories and issues from around the world. We monitor over 2000 news sources daily and have agents in over 80% of the worlds countries giving us unique access to the latest events as they happen.These News Briefs are free and delivered directly to you email box
To subscribe, go to:
http://iwarfare.com/news.htm
Angela Bowers
News Briefs Team
iWarfare.com
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
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.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 2980
**************************************