[23151] in Perl-Users-Digest
Perl-Users Digest, Issue: 5372 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Aug 16 14:06:17 2003
Date: Sat, 16 Aug 2003 11:05:12 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Sat, 16 Aug 2003 Volume: 10 Number: 5372
Today's topics:
Re: "goodbye little kiddie" from uri <murat.uenalan@gmx.de>
Re: "goodbye little kiddie" from uri <scripts_you-know-the-drill_@hudsonscripting.com>
Re: and why can't I do my own CGI? <REMOVEsdnCAPS@comcast.net>
Re: and why can't I do my own CGI? <flavell@mail.cern.ch>
Re: and why can't I do my own CGI? <scripts_you-know-the-drill_@hudsonscripting.com>
Re: Can't see http_referrer in IE <flavell@mail.cern.ch>
Re: CGI is not so hard <REMOVEsdnCAPS@comcast.net>
Re: CGI is not so hard <simon@unisolve.com.au>
Re: CGI is not so hard <scripts_you-know-the-drill_@hudsonscripting.com>
Re: CGI is not so hard <scripts_you-know-the-drill_@hudsonscripting.com>
Re: CGI is not so hard <scripts_you-know-the-drill_@hudsonscripting.com>
Re: CGI is not so hard <scripts_you-know-the-drill_@hudsonscripting.com>
Re: file upload in cgi <scripts_you-know-the-drill_@hudsonscripting.com>
Re: file upload in cgi <REMOVEsdnCAPS@comcast.net>
Re: file upload in cgi <scripts_you-know-the-drill_@hudsonscripting.com>
Re: hand crafting soap for google api's <scripts_you-know-the-drill_@hudsonscripting.com>
Re: hand crafting soap for google api's <spamblock@junkmail.com>
Re: hand crafting soap for google api's <uri@stemsystems.com>
Re: How to express "not followed by"? (Yi Mang)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sat, 16 Aug 2003 15:46:31 +0200
From: "Murat Ünalan" <murat.uenalan@gmx.de>
Subject: Re: "goodbye little kiddie" from uri
Message-Id: <bhlcep$k00$01$1@news.t-online.com>
"Hudson" <scripts_you-know-the-drill_@hudsonscripting.com> schrieb im
Newsbeitrag news:04mrjv04oupg61v3ghn948m75p6rlc7b1b@4ax.com...
> sweet...you suck...
Keep you discussions on a technical level or GO AWAY !
Murat
------------------------------
Date: Sat, 16 Aug 2003 10:29:46 -0700
From: Hudson <scripts_you-know-the-drill_@hudsonscripting.com>
Subject: Re: "goodbye little kiddie" from uri
Message-Id: <5fqsjvog02io1mtadlasbmu2rlnljvpace@4ax.com>
yeah, well...tell the regulars here not to name call and put people down at the
drop of a hat.
On Sat, 16 Aug 2003 15:46:31 +0200, "Murat Ünalan" <murat.uenalan@gmx.de> wrote:
>
>"Hudson" <scripts_you-know-the-drill_@hudsonscripting.com> schrieb im
>Newsbeitrag news:04mrjv04oupg61v3ghn948m75p6rlc7b1b@4ax.com...
>> sweet...you suck...
>
>Keep you discussions on a technical level or GO AWAY !
>
>Murat
>
------------------------------
Date: Sat, 16 Aug 2003 07:01:38 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: and why can't I do my own CGI?
Message-Id: <Xns93D951A124CB9sdn.comcast@206.127.4.25>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
Hudson <scripts_you-know-the-drill_@hudsonscripting.com> wrote in
news:csmrjvk88gs41b8irahg6o1aoruhtmesuj@4ax.com:
> On Sat, 16 Aug 2003 00:19:32 -0700, Hudson
> <scripts_you-know-the-drill_@hudsonscripting.com> wrote:
>
>>I don't see why I have to use some huge module when the ideas behind
>>it are simple...
>
> for example...
>
> get input
> know what you are doing with it
> don't use it for things that can fuck up your system unless you check
> it what else is there?
Three reasons.
1: Yes, it's not particularly difficult to write code to parse and
manipulate CGI input. But it is a pain in the ass. Why not go with a
solution that has already been implemented?
2: There are many small details about parsing CGI input, preventing
attacks, handling file uploads, etc, that are tricky to get right. Every
now and then, someone posts to this newsgroup a script which does its own
CGI handling. In my years of reading comp.lang.perl.misc, I have not
once seen such code that did not have at least one mistake in it. The
most common is:
@pairs = split /&/, $cgi_input;
Why is that wrong? Because cgi input can be separated by semicolons as
well as ampersands; in fact, that's the W3C's recommendation. Few who
write their own CGI code seem to know this.
3. When one writes one's own code, one can only do so much testing.
CGI.pm has been used in many thousands of scripts, and has been invoked
literally billions of times. You would be hard-pressed to find a bug in
it by now. And if you did, you could inform Lincoln Stein (CGI.pm's
author), and he would fix it, and thousands of web administrators would
download it and install it, and the web would be a better place.
I am a very experienced Perl programmer. There are many routine modules
that I could code myself, but I always use the off-the-shelf solution
whenever possible. In fact, I will nearly always use an off-the-shelf
module even if I don't like its interface, simply because I can be
confident that it works, works right, and will be maintained. And
because I'm lazy -- I don't have time to solve problems that have been
solved.
Reinventing wheels is for cavemen.
- --
Eric
$_ = reverse sort $ /. r , qw p ekca lre uJ reh
ts p , map $ _. $ " , qw e p h tona e and print
-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
iQA/AwUBPz4dFGPeouIeTNHoEQLtjQCgpvHWYbvUkIS0IkTg9sRVsZizv4QAn1Cx
KJEfP6l/I7jdA4EUXdaCzEN5
=7XDm
-----END PGP SIGNATURE-----
------------------------------
Date: Sat, 16 Aug 2003 14:44:48 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: and why can't I do my own CGI?
Message-Id: <Pine.LNX.4.53.0308161425040.17948@lxplus076.cern.ch>
On Sat, Aug 16, Eric J. Roode inscribed on the eternal scroll:
[some good points omitted...]
> 3. When one writes one's own code, one can only do so much testing.
> CGI.pm has been used in many thousands of scripts, and has been invoked
> literally billions of times. You would be hard-pressed to find a bug in
> it by now.
Well, with respect, I think that's a bit of an exaggeration. There
have been quite a number of bugs - mostly minor and obscure - in
various versions: however, most of those bugs have been in the detail
(and many successful uses of CGI.pm never actually met the bugs), and
were usually fail-safe (i.e there were situations where the script
didn't work as intended, but it wasn't a security vulnerability).
Whereas many of the home-spun scripts that have been seen, had severe
bugs which were only too easy for an attacker to exploit.
So, even though I'm aware that CGI.pm isn't perfect, I would strongly
recommend its use to anyone who feels the need to discuss the issue
here. There might just be a few programmers in the world who'd be
capable of doing it better if they had the interest in it, but I sure
as heck don't count myself amongst that number.
> And if you did, you could inform Lincoln Stein (CGI.pm's
> author), and he would fix it, and thousands of web administrators would
> download it and install it, and the web would be a better place.
And that's the key: "peer review".
One issue you didn't mention, which seems to me to be very relevant in
practice: even the simplest of hand-coded scripts has a tendency to
add features during its life. Maybe to support POST when it was
originally only to support GET - maybe to support file-upload when it
originally didn't - maybe to support re-writing an incomplete form and
prompting for required fields that had been left blank or wrongly
completed - and so on. If started off the right way, then CGI.pm
allows such features to be bolted on almost for free. If started off
with hand-coding, then such a script rapidly becomes an insecure and
unmaintainable quivering heap. I know - I've made just that mistake
for myself, in the early days.
cheers
------------------------------
Date: Sat, 16 Aug 2003 12:37:44 -0700
From: Hudson <scripts_you-know-the-drill_@hudsonscripting.com>
Subject: Re: and why can't I do my own CGI?
Message-Id: <mu1tjvos73vbkggt5cmde464fj0bbtp99g@4ax.com>
>Reinventing wheels is for cavemen.
thank you Eric.
you know what...parsing CGI is kind of a bitch...maybe I should just load in
part of a module and not use the whole thing.
------------------------------
Date: Sat, 16 Aug 2003 11:56:11 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Can't see http_referrer in IE
Message-Id: <Pine.LNX.4.53.0308161150470.3731@lxplus005.cern.ch>
On Sat, Aug 16, pkent inscribed on the eternal scroll:
> In article <Pine.LNX.4.53.0308131159100.755@lxplus081.cern.ch>,
> "Alan J. Flavell" <flavell@mail.cern.ch> wrote:
>
> > pkent said:
> > > It probably depends on your web server software
> > This appears to have been a stealth CGI question. Why should it
> > depend?
>
> Because all software sucks, obviously.
OK, understood now; but I was afraid that someone reading your posting
might conclude that CGI was supposed to be server-specific. I guess
it was just a matter of emphasis.
best regards
------------------------------
Date: Sat, 16 Aug 2003 07:05:26 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: CGI is not so hard
Message-Id: <Xns93D95245D20EBsdn.comcast@206.127.4.25>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
Hudson <scripts_you-know-the-drill_@hudsonscripting.com> wrote in
news:33trjvothr5jaderpr9fj8st36hkdon231@4ax.com:
> ok...I have really had it with this group...I think this is lame that
> you all don't know http or cgi or soap and can only think in modules.
>
> what kind of programmers are you all? geez......!!
>
Why are you insulting *everyone* in the group for a bunch of conversations
you've been involved in with a few people over the course of maybe two
hours? (at least, as far as I can tell, by looking at the headers).
Am I missing something?
- --
Eric
$_ = reverse sort $ /. r , qw p ekca lre uJ reh
ts p , map $ _. $ " , qw e p h tona e and print
-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
iQA/AwUBPz4d+mPeouIeTNHoEQJtAwCeOaMobWbs0I2MEGfGHbjXsCa3O3gAn1Zj
iOQ6eRfXZKu5elGxYojneiIh
=r7Xh
-----END PGP SIGNATURE-----
------------------------------
Date: Sun, 17 Aug 2003 00:27:40 +1000
From: Simon Taylor <simon@unisolve.com.au>
Subject: Re: CGI is not so hard
Message-Id: <3F3E3F5C.7020800@unisolve.com.au>
Hudson wrote:
> ok...I have really had it with this group...I think this is lame that you all
> don't know http or cgi or soap and can only think in modules.
>
> what kind of programmers are you all? geez......!!
Folks, please stop feeding this troll!
If we ignore it long enough, it will get hungry and it will move
away.... ;-)
Simon Taylor
------------------------------
Date: Sat, 16 Aug 2003 10:19:56 -0700
From: Hudson <scripts_you-know-the-drill_@hudsonscripting.com>
Subject: Re: CGI is not so hard
Message-Id: <ftpsjvc50ijjknb8s507spu9b3msongiha@4ax.com>
hehe...funny guy
On Sat, 16 Aug 2003 06:40:14 GMT, "Jürgen Exner" <jurgenex@hotmail.com> wrote:
>Hudson wrote:
>[3 articles, all follow ups to his own articles]
>
>What is wrong? Do you always talk to yourself?
>
>jue
>
------------------------------
Date: Sat, 16 Aug 2003 10:20:49 -0700
From: Hudson <scripts_you-know-the-drill_@hudsonscripting.com>
Subject: Re: CGI is not so hard
Message-Id: <gupsjv0e1tbgd3hb3g05qaspurpf7efko7@4ax.com>
OK, sorry...just the guys that are jumping on me
>Why are you insulting *everyone* in the group for a bunch of conversations
>you've been involved in with a few people over the course of maybe two
>hours? (at least, as far as I can tell, by looking at the headers).
>
>Am I missing something?
------------------------------
Date: Sat, 16 Aug 2003 10:21:32 -0700
From: Hudson <scripts_you-know-the-drill_@hudsonscripting.com>
Subject: Re: CGI is not so hard
Message-Id: <vvpsjvs9fk0ofrc0gtpks710kaakj173ao@4ax.com>
I'm not a troll...but don't worry, I am not going to continue this.
On Sun, 17 Aug 2003 00:27:40 +1000, Simon Taylor <simon@unisolve.com.au> wrote:
>Hudson wrote:
>> ok...I have really had it with this group...I think this is lame that you all
>> don't know http or cgi or soap and can only think in modules.
>>
>> what kind of programmers are you all? geez......!!
>
>Folks, please stop feeding this troll!
>
>If we ignore it long enough, it will get hungry and it will move
>away.... ;-)
>
>Simon Taylor
------------------------------
Date: Sat, 16 Aug 2003 12:26:28 -0700
From: Hudson <scripts_you-know-the-drill_@hudsonscripting.com>
Subject: Re: CGI is not so hard
Message-Id: <g21tjvc490kalgkg9trhcrj79s8g96drjc@4ax.com>
>> You use environment varibles to grab the input from the form.
>
>Huh? Certainly not for POST.
read (STDIN, my $input, $ENV{'CONTENT_LENGTH'});
my @kv = split (/&/, $input);
for my $kv (@kv)
etc....that's not just grabbing an environmental varible?
>
>And somewhere else you ask:
>
>> what kind of programmers are you all? geez......!!
no...what I said was (or meant to say) knowing about how CGI, HTTP and SOAP work
is fun...it is not hard and you can do it just as well by yourself as through a
module. By depending on modules, you are not understanding what you are doing
and letting someone else do the work for you. Of course, I cannot build my own
car or program a linux kernal, but still it is fun to try to do the things you
are able to.
>Why don't you find out yourself? To get an idea on what those very
>people you are poorly trying to attack have done so far go to
>http://search.cpan.org/ and look up their name. After that you'll have a
>change to see the code they have written and released. Compare that with
>your own works and you'll quickly have to acknowledge that they aren't
>as lazy, clueless and unwilling to read RFCs as you try to convey.
>
>Or grep a perl source distribution for their names and learn that some
>of them are distributing to the perl-core. That alone makes your
>statements utterly ludicrous.
>
>If I do any of the above for your name (which happens to be non-real,
>btw), I'm sure I'll come up with nothing.
So what? There are always going to be people better, stronger, smarter, etc.
Does that mean I can join in on the discussion a little bit?
------------------------------
Date: Sat, 16 Aug 2003 10:45:22 -0700
From: Hudson <scripts_you-know-the-drill_@hudsonscripting.com>
Subject: Re: file upload in cgi
Message-Id: <cbrsjvk4hebib3ltpr6pqo9ts81fp5d44r@4ax.com>
I guess the easy answer is I'm not doing mission critical applications. Or..I
don't know...I never thought about it.
If I had to get an answer to that, I would have to put a little more research
into it.
On Sat, 16 Aug 2003 11:17:15 +0200, Matija Papec <mpapec@yahoo.com> wrote:
>X-Ftn-To: Hudson
>
>Hudson <scripts_you-know-the-drill_@hudsonscripting.com> wrote:
>>very easy...I did it yesterday...if a file is over x bytes, stop the transfer
>>and unlink the file...what's so hard?
>
>
>What happens when you interrupt your upload or when you're uploading
>multiple files at once?
------------------------------
Date: Sat, 16 Aug 2003 11:11:40 -0500
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: file upload in cgi
Message-Id: <Xns93D97C03671E4sdn.comcast@206.127.4.25>
-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1
Hudson <scripts_you-know-the-drill_@hudsonscripting.com> wrote in
news:cbrsjvk4hebib3ltpr6pqo9ts81fp5d44r@4ax.com:
> I guess the easy answer is I'm not doing mission critical
> applications. Or..I don't know...I never thought about it.
>
> If I had to get an answer to that, I would have to put a little more
> research into it.
>
>
>
> On Sat, 16 Aug 2003 11:17:15 +0200, Matija Papec <mpapec@yahoo.com>
> wrote:
>
>>X-Ftn-To: Hudson
>>
>>Hudson <scripts_you-know-the-drill_@hudsonscripting.com> wrote:
>>>very easy...I did it yesterday...if a file is over x bytes, stop the
>>>transfer and unlink the file...what's so hard?
>>
>>
>>What happens when you interrupt your upload or when you're uploading
>>multiple files at once?
Hudson,
I'm not going to jump on the attack bandwagon here, but I do have one
style point that I'd like to point out. Consider this friendly advice,
not a fascist attempt to make you conform to my way of doing things. (I
include this disclaimer because you seem to be sensitive to that sort of
interpretation).
In general on Usenet, it is considered good form to post your
response after the quoted material you are responding to. This is
obviously not always a strict requirement, but in most cases it is the
most sensible way to post.
Take the above exchange for instance. Someone coming along and
reading it, without having read the history, will see the answer to a
question, followed by the question itself. Very confusing.
Even I, who had previously read the question, had to jump down past
your response to remind myself what the question was, and then jump back
to read your response. It's annoying.
The style you used is called "top-posting", or "jeopardy-style", and
is considered impolite. You will note that nearly no experienced person
on usenet uses this style. That's not because they're all a bunch of
conformist snobs; it's because, over the years, people have gfound that
this style works best for most communication on usenet, and it is thus
considered polite.
FYI.
- --
Eric
$_ = reverse sort $ /. r , qw p ekca lre uJ reh
ts p , map $ _. $ " , qw e p h tona e and print
-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>
iQA/AwUBPz5XrWPeouIeTNHoEQI6RACdGMM7Zl/IBPL660yEXUAa7Ber/DIAoLBc
u1YiHfaYGpf1Bxp8L2p/vpad
=SXPX
-----END PGP SIGNATURE-----
------------------------------
Date: Sat, 16 Aug 2003 12:27:59 -0700
From: Hudson <scripts_you-know-the-drill_@hudsonscripting.com>
Subject: Re: file upload in cgi
Message-Id: <nc1tjvsuc08277etqkkdhdf4d5oj64rqf3@4ax.com>
> The style you used is called "top-posting", or "jeopardy-style", and
>is considered impolite. You will note that nearly no experienced person
>on usenet uses this style. That's not because they're all a bunch of
>conformist snobs; it's because, over the years, people have gfound that
>this style works best for most communication on usenet, and it is thus
>considered polite.
>
>FYI.
thanks for the advice...I guess it is kind of like writing in all caps is
considered shouting ;-)
------------------------------
Date: Sat, 16 Aug 2003 12:12:12 -0700
From: Hudson <scripts_you-know-the-drill_@hudsonscripting.com>
Subject: Re: hand crafting soap for google api's
Message-Id: <2b0tjv4l8iodiqkf5demr86j9q86b8edr3@4ax.com>
>The decision to hand-roll your own solution is amongst the poorest you
>can make. And you really think it takes less time to write a robust and
>standard-compliant parser yourself than learning the relevant bits of
>CGI.pm? Which are actually just:
>
> use CGI qw/param/;
>
> my @params = param(); # all parameters in the query string
> for my $p (@params) {
> my $val = param($p); # single value for parameter $p
> my @vals = param($p); # all values for parameter $p
> }
>
>That's not too complicated, is it?
no it isn't complicated, thanks for posting it.
>
>But naturally, you are free to write your own parser. Please post it
>here when you are done with it so that we can all have a good laughter.
this is basically what I am using
my %kv = (); # key-value kv
my @form_varibles = qw(form_value_1
form_value_2
etc
);
read (STDIN, my $input, $ENV{'CONTENT_LENGTH'});
my @kv = split (/&/, $input);
for my $kv (@kv) {
(my $key, my $value) = split (/=/, $kv);
if (length($value) < 1) { zero_value ($key) }
if (length($value) > 255) { string_too_big ($key) }
$value =~ tr/+/ /;
$value =~ s/%([\dA-Fa-f][\dA-Fa-f])/pack ("C", hex ($1))/eg;
for my $varible (@form_varibles) {
if ($key eq "$varible") {
$kv{$key} = $value;
}
}
}
>> Stop being a troll with me...thank you.
>
>The most reliable way to get dropped in many killfiles is calling a
>well-respected regular a troll.
if you look back, he called me a total beginner, a troll and a script
kiddie...so I was just responding in kind
------------------------------
Date: Sat, 16 Aug 2003 09:33:50 -0700
From: "David Oswald" <spamblock@junkmail.com>
Subject: Re: hand crafting soap for google api's
Message-Id: <vjsnaknumilb01@corp.supernews.com>
"Tassilo v. Parseval" <tassilo.parseval@rwth-aachen.de> wrote in message
news:bhkivf$gb8$1@nets3.rz.RWTH-Aachen.DE...
> But naturally, you are free to write your own parser. Please post it
> here when you are done with it so that we can all have a good laughter.
And by all means, Hudson, post the URL where we can all see the hand-rolled
hand-job in action. It will be fun to see what a good job it does. *eg*
------------------------------
Date: Sat, 16 Aug 2003 17:08:49 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: hand crafting soap for google api's
Message-Id: <x7zni9r0m6.fsf@mail.sysarch.com>
>>>>> "H" == Hudson <scripts_you-know-the-drill_@hudsonscripting.com> writes:
H> read (STDIN, my $input, $ENV{'CONTENT_LENGTH'});
bug alert, no checking if read worked.
also no allwoing for post OR get.
H> my @kv = split (/&/, $input);
bug alert ; is allowed
H> for my $kv (@kv) {
H> (my $key, my $value) = split (/=/, $kv);
H> if (length($value) < 1) { zero_value ($key) }
H> if (length($value) > 255) { string_too_big ($key) }
bug alert.
H> $value =~ tr/+/ /;
H> $value =~ s/%([\dA-Fa-f][\dA-Fa-f])/pack ("C", hex ($1))/eg;
H> for my $varible (@form_varibles) {
H> if ($key eq "$varible") {
bug alert. unneccesary quoting of a scalar variable. besides the
misspelling of variable.
H> $kv{$key} = $value;
H> }
bug alert. no support for multiple value with the same name.
>>> Stop being a troll with me...thank you.
>>
>> The most reliable way to get dropped in many killfiles is calling a
>> well-respected regular a troll.
H> if you look back, he called me a total beginner, a troll and a script
H> kiddie...so I was just responding in kind
well, that code is script kiddie quality. i just call them as i see
them.
and as tad said, you post code, expect comments. this is how usenet works.
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
Date: 16 Aug 2003 10:38:55 -0700
From: yi_mang@yahoo.com (Yi Mang)
Subject: Re: How to express "not followed by"?
Message-Id: <832301af.0308160938.7a55bc26@posting.google.com>
Thanks for all the people who has helped me to tackle the problem.
Sorry I'm vague on the description of the problem. Here I'll try to
describe the problem more clearly:
I have a test file, some of the lines have a sequence of digits, what
I'm trying to do is to print out the lines that has "a sequence of
digits not followed by a semicolon" (teh same as "a sequence of digits
followed by a non-semicolon").
Here is my test file(test.txt):
123;edf
abde
abc1234
12abc
abc123;
abcdef
defg
Here is my program:
open(IN,"<./test.txt");
while(<IN>)
{
chomp;
# sequence of digits not followed by a semicolon
if ( /\d+(?!;)/ ) #Thanks to those who suggest it.
#if ( /\d+([^;])/ ) #my original post. Got the same result.
{
print "Error on line $.: $_\n";
}
}
close(IN);
The result shows line 1, line 3, line 4 and line 5. But actually only
line 3 and line 4 should come out. Line 1 and line 5 are the extact
opposite (followed by a semicolon). I just don't understand why they
would also match.
I actually get around the problem by doing the following:
if ( /\d+/ )
{
if ( $' !~ /^;/ )
{
print "Error on line $.: $_\n";
}
}
But there got be an easy way to do this by using only one if
statement.
Thanks for all your time and efforts. I appreciate it.
------------------------------
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 5372
***************************************