[18144] in Perl-Users-Digest
Perl-Users Digest, Issue: 312 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Feb 18 21:05:54 2001
Date: Sun, 18 Feb 2001 18:05:09 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <982548309-v10-i312@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Sun, 18 Feb 2001 Volume: 10 Number: 312
Today's topics:
Re: (OFF TOPIC) Re: This is driving me nuts and I need (Gwyn Judd)
Re: (OFF TOPIC) Re: This is driving me nuts and I need (Abigail)
Re: (OFF TOPIC) Re: This is driving me nuts and I need (Peter J. Acklam)
Re: (OFF TOPIC) Re: This is driving me nuts and I need <no@email.com>
client-server launching in perl? (perl inetd?) <rhoge@nmr.mgh.harvard.edu>
Re: directing system() output to a var <krahnj@acm.org>
Re: Help understanding variable naming convention in Pe <Jodyman@usa.net>
Invisible code? (Jim Kroger)
Re: Invisible code? (Chris Fedde)
Re: Invisible code? <callgirl@la.znet.com>
Re: Invisible code? (Damian James)
kill unix process <jlee8@irix1.gl.umbc.edu>
Re: kill unix process <beable@my-deja.com>
Re: kill unix process <the_nutcase@hotmail.com>
Re: kill unix process (Abigail)
Re: kill unix process <revjack@revjack.net>
Re: Linda, this is cool! (Hartmann Schaffer)
perl program (Another Way)
question on multidimensional arrays <me@me.com>
Re: question on multidimensional arrays <bwalton@rochester.rr.com>
Re:Re:Re:(OFF TOPIC) This is driving me nuts and no gur <callgirl@la.znet.com>
Regular Expressions (tim leung)
Re: Regular Expressions <joe+usenet@sunstarsys.com>
sending data to a script via SSI <jeff_fletcher@pacbell.net>
Re: sending data to a script via SSI <bwalton@rochester.rr.com>
Re: sending data to a script via SSI <callgirl@la.znet.com>
Re: When is an array @f allowed in a string? (Tad McClellan)
Re: When is an array @f allowed in a string? <bertilow@chello.se>
Re: Why can't I grab this URL? (Martien Verbruggen)
Writing a Perl Server <slangdon@tampabay.rr.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Sun, 18 Feb 2001 21:26:38 GMT
From: tjla@guvfybir.qlaqaf.bet (Gwyn Judd)
Subject: Re: (OFF TOPIC) Re: This is driving me nuts and I need a guru
Message-Id: <slrn990fgd.n27.tjla@thislove.dyndns.org>
I was shocked! How could Frank Miller <no@email.com>
say such a terrible thing:
>a) Didn't read the FAQ. The flamer told me to I was supposed to "read the
>FAQ" before posting. But this person didn't even bother to spare 20 extra
>characters to tell me where the FAQ was. I didn't know about the FAQ. I
>loved reading the FAQ. It answer many of my questions. But why was I
>flamed? I would have much rather been nicely pointed to the FAQ (as a
>follow-up poster did).
I just thought I should mention in case it has slipped by anyone's
attention that questions from the FAQ are posted, in this group, right
now. See those postings with "FAQ" in the subject. Well duh. And
incidentally, if you read them, it tells you where to actually find the
FAQ on the web. So don't tell me you don't know where the FAQ is because
that tells me you didn't bother to even read the group for a single day
before you posted.
--
Gwyn Judd (print `echo 'tjla@guvfybir.qlaqaf.bet' | rot13`)
Serenity through viciousness.
------------------------------
Date: 18 Feb 2001 21:34:37 GMT
From: abigail@foad.org (Abigail)
Subject: Re: (OFF TOPIC) Re: This is driving me nuts and I need a guru
Message-Id: <slrn990fvd.ph4.abigail@tsathoggua.rlyeh.net>
Steven Smolinski (sjs@linux.ca) wrote on MMDCCXXVIII September MCMXCIII
in <URL:news:slrn99090j.12o.sjs@ragnar.stevens.gulch>:
}} Frank Miller <no@email.com> wrote:
}} > Once agiain. Sorry. The thing I find so strange is that of all the news
}} > groups I post to, the most obnoxious ones are the programming and technical
}} > ones.
}}
}} I find that good technical groups try to enforce a tiny level of
}} professionalism: they don't abide people spouting nonsense; they don't
}} abide laziness or cluelessness. Groups which do not have any standards
}} end up being a mass of the blind leading the blind.
}}
}} Not knowing about the FAQ is generally a case of laziness or
}} cluelessness. It keeps getting proven on this ng hundreds of times
}} daily. That there may be the odd exception is unfortunate, but really,
}} how remote is it that someone won't know about the FAQ?
}}
}} - Type perldoc and read the usage message. Pointer to the FAQ.
}} - The main perl manpage points to the faq on the first page.
}} - www.perl.com has "FAQ" on their main navigation.
}} - It's mentioned on this ng several times a day.
}} - a search for "perl faq" on google yields the thing as the first
}} listing.
}}
}} It's hard work to avoid konwing about the FAQ!
Specially if you claim to have read the manual, website after website,
and a few days of the newsgroup, which even has a bot posting entries of
the FAQ, and with 15 years of Usenet experience doesn't even anticipate
the existance of a FAQ.
If you manage to remain oblivous of the FAQ doing what Frank claimed to
do, what good is it to answer his questions? He'll probably miss the
answers anyway.
Abigail
--
split // => '"';
${"@_"} = "/"; split // => eval join "+" => 1 .. 7;
*{"@_"} = sub {foreach (sort keys %_) {print "$_ $_{$_} "}};
%{"@_"} = %_ = (Just => another => Perl => Hacker); &{%{%_}};
------------------------------
Date: 18 Feb 2001 22:40:33 +0100
From: jacklam@math.uio.no (Peter J. Acklam)
Subject: Re: (OFF TOPIC) Re: This is driving me nuts and I need a guru
Message-Id: <wkbsrzad1g.fsf@math.uio.no>
Frank Miller <no@email.com> writes:
> c) Not lurking for three weeks before posting. I find this
> particular frustrating. [...] I really think it's unfair to
> say that someone should have to lurk for three weeks before
> posting.
merlyn@stonehenge.com (Randal L. Schwartz) writes:
> This is again Usenet rules, not comp.lang.perl.* rules. There's
> a culture to Usenet, described in "news.announce.newusers".
> Read there first.
It should be mentioned that it isn't necessary to actually wait
three weeks before posting. Most ISP's should have several weeks
of comp.lang.perl.* postings on their servers, so it is only a
matter of taking the trouble of reading them.
Peter
--
sub int2roman{@x=split//,sprintf'%04d',shift;@r=('','I','V','X','L','C','D'
,'M');@p=([],[1],[1,1],[1,1,1],[1,2],[2],[2,1],[2,1,1],[2,1,1,1],[1,3],[3])
;join'',@r[map($_+6,@{$p[$x[0]]}),map($_+4,@{$p[$x[1]]}),map($_+2,@{$p[$x[2
]]}),map($_+0,@{$p[$x[3]]})];}print "@{[map{int2roman($_)}@ARGV]}\n";#JAPH!
------------------------------
Date: Sun, 18 Feb 2001 22:11:59 GMT
From: "Frank Miller" <no@email.com>
Subject: Re: (OFF TOPIC) Re: This is driving me nuts and I need a guru
Message-Id: <PMXj6.441520$U46.13025111@news1.sttls1.wa.home.com>
>"Abigail" <abigail@foad.org> wrote in message
news:slrn990fvd.ph4.abigail@tsathoggua.rlyeh.net...
> If you manage to remain oblivous of the FAQ doing what Frank claimed to
> do, what good is it to answer his questions? He'll probably miss the
> answers anyway.
>
I think responses like this pretty much prove my point.
FrankM
------------------------------
Date: Mon, 19 Feb 2001 00:34:55 GMT
From: Rick Hoge <rhoge@nmr.mgh.harvard.edu>
Subject: client-server launching in perl? (perl inetd?)
Message-Id: <3A906945.98FCC7E@nmr.mgh.harvard.edu>
Hi -
I would like to write a perl program which will launch a tcp client
program (an existing standalone C executable), directed to a port on the
local host, then immediately launch the appropriate server for this
request (another standalone C executable) with command-line arguments
passed from the perl script.
My motivation for this is that the client and server jointly provide a
useful file format conversion capability (client reads in files in
format A, transmits information to port X using dicom medical imaging
protocol, server grabs transmitted info and saves it in format B). I
want to keep the client/server separation, because I also use these
programs to receive and transmit data to other applications/platforms
and they work fine for this as they are. The connection requires a
degree of bidirectional communication, so I can't just pipe the output
of the client to the server.
Basically, instead of inetd starting the server with command line args
given in inetd.conf and a fixed UID, I'd like to start it from the same
perl script that launched the client and give the required
(invocation-specific) command-line args this way. This way everything
would be done as a single user so the output files (format B) could be
written anywhere the invoking user has permission to write.
Is this an asinine thing to do? I'd really appreciate any suggestions
about how one might go about this in perl or alternate approaches to
bundling the client and server.
tia,
rick
------------------------------
Date: Mon, 19 Feb 2001 00:38:32 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: directing system() output to a var
Message-Id: <3A906C39.49F37D4@acm.org>
Rudolf Polzer wrote:
>
> my $out = `perl -e "systen '$cmd';"`;
^^^^^^
And what happened when you tried this?
John
------------------------------
Date: Sun, 18 Feb 2001 21:04:27 -0500
From: "Jody Fedor" <Jodyman@usa.net>
Subject: Re: Help understanding variable naming convention in Perl
Message-Id: <96puv0$np5$1@plonk.apk.net>
Thanks all for your help. I Think I've been headed
down the proper path.
Jody
------------------------------
Date: Sun, 18 Feb 2001 18:07:29 -0500
From: minorseventhSPAMBLOCK@earthlink.net (Jim Kroger)
Subject: Invisible code?
Message-Id: <minorseventhSPAMBLOCK-1802011807290001@tritone.csbmb.princeton.edu>
Hello esteemed perlers,
I have spent a couple days staring at this code, trying to understand why
my while loop is passed over. This happens with or without the debugger.
I have tried putting additional statements right before the loop and they
are executed fine. I have put a print statement right before the loop
printing the contents of <DATA> and it prints the proper column of strings
from the file "file" so <DATA> is not empty. I have tried putting the
contents of DATA into an array, then using that array in place of <DATA>
in the while loop statement, same problem. I hope I'm missing something
small that is an obvious mistake. Without the debugger, the @ffile array
is not filled, and with the debugger (perl -d programname) stepping
through, it simply executes the line before the loop then the line after
it, as if the 4 lines were invisible, no matter what.
Any help would definately be appreciated....
Thanks very much,
Jim
--------
-
-
-
-
open(DATA, "file");
open(SPLIT, ">airfilelist");
while (<DATA>) { <
$temp = "func_an/${_}"; <
@ffile = (@ffile, $temp); <
} <
@ffile = ($ffile[0], @ffile);
print SPLIT @ffile;
-
-
-
-
--
Remove SPAMBLOCK to reply
------------------------------
Date: Sun, 18 Feb 2001 23:53:10 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: Invisible code?
Message-Id: <GfZj6.239$zN2.188989952@news.frii.net>
In article <minorseventhSPAMBLOCK-1802011807290001@tritone.csbmb.princeton.edu>,
Jim Kroger <minorseventhSPAMBLOCK@earthlink.net> wrote:
>Hello esteemed perlers,
>
>Any help would definately be appreciated....
>
>Thanks very much,
>Jim
>
>--------
>-
>open(DATA, "file");
>open(SPLIT, ">airfilelist");
>while (<DATA>) { <
> $temp = "func_an/${_}"; <
> @ffile = (@ffile, $temp); <
>} <
>@ffile = ($ffile[0], @ffile);
>print SPLIT @ffile;
>-
>-
While your code is a bit unorthodox, it does work on my system (perl 5.6.0)
You might want to try checking the return value of those opens.
open(DATA, "file") or die "$0: $!";
Maybe that would give you some hints.
--
This space intentionally left blank
------------------------------
Date: Sun, 18 Feb 2001 17:26:02 -0800
From: Kira <callgirl@la.znet.com>
Subject: Re: Invisible code?
Message-Id: <3A90762A.76C9ED24@la.znet.com>
Jim Kroger wrote:
(snippage)
> I have spent a couple days staring at this code, trying to understand why
> my while loop is passed over. This happens with or without the debugger.
> open(DATA, "file");
> open(SPLIT, ">airfilelist");
> while (<DATA>) { <
> $temp = "func_an/${_}"; <
> @ffile = (@ffile, $temp); <
> } <
> @ffile = ($ffile[0], @ffile);
> print SPLIT @ffile;
Why did you post code with fatal syntax errors?
"Unterminated <> operator at...."
Godzilla!
--
TEST SCRIPT:
____________
#!perl
print "Content-type: text/plain\n\n";
open(DATA, "test1.txt");
open(SPLIT, ">test2.txt");
while (<DATA>)
{
$temp = "func_an/${_}";
## Diagnostics One:
if ($temp)
{ print "Diagnostics One -\n \$temp Is: $temp\n"; }
else
{ print "Diagnostics One -\n \$temp Is Null\n"; }
@ffile = (@ffile, $temp);
## Diagnostics Two:
if (@ffile)
{ print "Diagnostics Two -\n Array \@ffile Is: @ffile\n"; }
else
{ print "Diagnostics Two -\n Array \@ffile Does Not Exist\n"; }
}
@ffile = ($ffile[0], @ffile);
## Diagnostics Three:
print "Diagnostics Three -\n Array \@ffile Is: @ffile\n";
print SPLIT @ffile;
print "\n\nProgram Finished";
exit;
CONTENTS OF TEST1.TXT:
______________________
test1text_one test1text_two
PRINTED TO TEST2.TXT:
_____________________
func_an/test1text_one test1text_two
func_an/test1text_one test1text_two
PRINTED RESULTS:
________________
Diagnostics One -
$temp Is: func_an/test1text_one test1text_two
Diagnostics Two -
Array @ffile Is: func_an/test1text_one test1text_two
Diagnostics Three -
Array @ffile Is: func_an/test1text_one test1text_two
func_an/test1text_one test1text_two
Program Finished
------------------------------
Date: 19 Feb 2001 02:01:03 GMT
From: damian@qimr.edu.au (Damian James)
Subject: Re: Invisible code?
Message-Id: <slrn990vi3.pnr.damian@puma.qimr.edu.au>
Thus spake Jim Kroger on Sun, 18 Feb 2001 18:07:29 -0500:
>-
>open(DATA, "file");
>open(SPLIT, ">airfilelist");
>while (<DATA>) { <
> $temp = "func_an/${_}"; <
> @ffile = (@ffile, $temp); <
>} <
>@ffile = ($ffile[0], @ffile);
>print SPLIT @ffile;
>-
You need to use some name other then DATA for the filehandle -- this is a
'global special filehandle', which refers to anything following the __END__
token in the file containing the script.
Aside to others: I found this in the Camel, and also in perldata. The
perldata reference was, I thought, a bit obscure to expect newbies to have
understood. I'd have thought that 'global special filehandles' should be in
perlvar (the way they are included at the end of the section on special
variables in the Camel). Should this be regarded as a doc bug?
Cheers,
Damian
--
$;=ord$%,$:=$;-ord q,.,,$_=q 13346:3366:3276:3326:3386:546:566:966:3396:3376:1.
q 73386:546:;96:3326:3336:3386:3266:3236:3366:546::26:3236:3366:32:6:546:32667.
q,:;96:;;6:3296:3236:3366:326:56,,s,.,;ord($&)-$:-$;;;;;,eg,s,$;,;chr$&-$:;,eg,
eval eval; #requires 5.6.0 ## my first attempt at one of these...
------------------------------
Date: 18 Feb 2001 19:59:24 GMT
From: Ji Lee <jlee8@irix1.gl.umbc.edu>
Subject: kill unix process
Message-Id: <96p9is$c7h$1@news.umbc.edu>
Hi folks,
i have following code in my perl script, but it does not works, can anyone tell me what i am doing wrong.
------------------------------
Date: Sun, 18 Feb 2001 20:51:00 GMT
From: Beable van Polasm <beable@my-deja.com>
Subject: Re: kill unix process
Message-Id: <m3lmr3pvsn.fsf@beable.van.polasm.bigpond.net.au>
Ji Lee <jlee8@irix1.gl.umbc.edu> writes:
>
> i have following code in my perl script, but it does not works, can
> anyone tell me what i am doing wrong.
Ummmm, not posting the code? Is that wrong? Read this:
perldoc -f kill
cheers
Beable van Polasm
--
Why couldn't they have used giant pulsating space lobsters instead?
-- Plorkwort | IQC 78189333
http://members.nbci.com/_______/index.html
------------------------------
Date: Mon, 19 Feb 2001 10:31:48 +1300
From: "Carl Ranson" <the_nutcase@hotmail.com>
Subject: Re: kill unix process
Message-Id: <_aXj6.993$8qy1.37683409@news.xtra.co.nz>
Yeah, I agree....they should be wiped out, man.
War of attrition......Banzai.
:)
"Ji Lee" <jlee8@irix1.gl.umbc.edu> wrote in message
news:96p9is$c7h$1@news.umbc.edu...
>
> Hi folks,
>
> i have following code in my perl script, but it does not works, can anyone
tell me what i am doing wrong.
>
>
------------------------------
Date: 18 Feb 2001 21:36:26 GMT
From: abigail@foad.org (Abigail)
Subject: Re: kill unix process
Message-Id: <slrn990g2q.ph4.abigail@tsathoggua.rlyeh.net>
Ji Lee (jlee8@irix1.gl.umbc.edu) wrote on MMDCCXXVIII September MCMXCIII
in <URL:news:96p9is$c7h$1@news.umbc.edu>:
,,
,, Hi folks,
,,
,, i have following code in my perl script, but it does not works, can anyone te
,,
Yeah.
There's nothing really here. The empty program does not have any side effects.
Abigail
--
BEGIN {my $x = "Knuth heals rare project\n";
$^H {integer} = sub {my $y = shift; $_ = substr $x => $y & 0x1F, 1;
$y > 32 ? uc : lc}; $^H = hex join "" => 2, 1, 1, 0, 0}
print 52,2,10,23,16,8,1,19,3,6,15,12,5,49,21,14,9,11,36,13,22,32,7,18,24;
------------------------------
Date: 18 Feb 2001 21:59:19 GMT
From: revjack <revjack@revjack.net>
Subject: Re: kill unix process
Message-Id: <96pgjn$139$1@news1.Radix.Net>
Keywords: Hexapodia as the key insight
Abigail <abigail@foad.org> wrote:
: Ji Lee (jlee8@irix1.gl.umbc.edu) wrote on MMDCCXXVIII September MCMXCIII
: in <URL:news:96p9is$c7h$1@news.umbc.edu>:
: ,,
: ,, Hi folks,
: ,,
: ,, i have following code in my perl script, but it does not works, can anyone te
: ,,
: Yeah.
: There's nothing really here. The empty program does not have any side effects.
But does it return TRUE?
RJ, runs fine on my Timex Sinclair
--
___________________
revjack@revjack.net
------------------------------
Date: 18 Feb 2001 20:11:17 -0500
From: hs@paradise.nirvananet (Hartmann Schaffer)
Subject: Re: Linda, this is cool!
Message-Id: <slrn990n47.382.hs@paradise.nirvananet>
In article <r5iu8tsqccj65ote3hfgo6dvjphskn15l3@4ax.com>, Sheila King wrote:
>On Sun, 18 Feb 2001 03:27:19 GMT, Mindfield
><mindfield@badgers.emulationnet.com> wrote in comp.lang.python in article
><21gu8tsoknv01eegt4jak2lo7180kijno5@4ax.com>:
>
>:It's really quite a loathesome little business,
>:and I've never figured out why people are still stupid enough to think
>:that it works, but I guess they still abide by the old motto, "There's
>:no such thing as bad publicity."
>
>It costs them next to nothing, and they must end up selling some of their
>product or generating some revenue from the spam. If they didn't, the spamming
>would decrease, but instead it is on the increase. Some people are stupid
>enough to buy from spammers.
frankly, i doubt this. most of those spams are so inept that i would be
surprised if it generates any sales. the only thing that seems to generate
sales are those spam generators (to clueless idiots)
hs
------------------------------
Date: 18 Feb 2001 22:22:38 GMT
From: anotherway83@aol.com (Another Way)
Subject: perl program
Message-Id: <20010218172238.03850.00003151@ng-mi1.aol.com>
hey
pls try out my first perl program here
it is a calculator
copy and paste this in ur browser, the download should start automatically, the
file is very small
http://www.geocities.com/anotherway83/Calculator.zip
copy it *exactly*, please...
thanks
peace
------------------------------
Date: Sun, 18 Feb 2001 23:40:38 GMT
From: "me" <me@me.com>
Subject: question on multidimensional arrays
Message-Id: <W3Zj6.4534$GX2.1835709@typhoon.ne.mediaone.net>
In the code below, I have a function called blah which returns a one
dimensional array of the parameter given and another called blah2 for a 2
dimensional array. The returned array is then assigned to another one
dimensional array and printed. This is done twice to make sure what is sent
back is not a reference to the computed array in the function. I get the
correct output for the one dimensional array but not for the two dimensional
one. Am I assigning the arrays correctly? Should the 2 dimensional array be
returned differently?
# one dimensional array
@allones=blah(1);
@alltwos=blah(2);
print @allones,@alltwos,"\n";
sub blah{
for $x (1 .. 4){
$b2 [$x]= $_[0];
}
return @b;
}
# two dimensional array
@LOL=blah2(1);
@LOL2=blah2(2);
for $x (1 .. 4){
for $y (1 .. 4){
print $LOL[$x][$y];
print $LOL2[$x][$y];
}
print "\n";
}
sub blah2{
for $x (1 .. 4){
for $y (1 .. 4){ $b [$x][$y]= $_[0]; }
}
return @b2;
}
------------------------------
Date: Mon, 19 Feb 2001 01:13:52 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: question on multidimensional arrays
Message-Id: <3A9073D0.9590762A@rochester.rr.com>
me wrote:
>
> In the code below, I have a function called blah which returns a one
> dimensional array of the parameter given and another called blah2 for a 2
> dimensional array. The returned array is then assigned to another one
> dimensional array and printed. This is done twice to make sure what is sent
> back is not a reference to the computed array in the function. I get the
> correct output for the one dimensional array but not for the two dimensional
> one. Am I assigning the arrays correctly? Should the 2 dimensional array be
> returned differently?
>
> # one dimensional array
> @allones=blah(1);
> @alltwos=blah(2);
> print @allones,@alltwos,"\n";
>
> sub blah{
> for $x (1 .. 4){
> $b2 [$x]= $_[0];
> }
> return @b;
> }
>
> # two dimensional array
> @LOL=blah2(1);
> @LOL2=blah2(2);
>
> for $x (1 .. 4){
> for $y (1 .. 4){
> print $LOL[$x][$y];
> print $LOL2[$x][$y];
> }
> print "\n";
> }
>
> sub blah2{
> for $x (1 .. 4){
> for $y (1 .. 4){ $b [$x][$y]= $_[0]; }
> }
> return @b2;
> }
Well, actually, the code as you supply it doesn't print anything other
than some blank lines. The primary reason for this appears to be:
1. In sub blah, you compute array @b2, and then return array @b.
Consequence: empty array returned.
2. In sub blah2, you compute array @b, and then return array @b2.
Consequence: you didn't return what you thought you did.
Fixing those two mistakes results in printout which might be what you
wanted (although it seems a bit hard to interpret to me, it is printout
that makes some degree of sense -- it is what I would expect from that
program).
You should make use of my in your subs to avoid polluting your main
workspace with sub variables. And you should use the -w switch (which
would have let you know all about the above problems) and also use
strict; (which would likewise have identified those problems).
Actually, the -w switch will point out one additional problem: you
neglected to assign anything to $allones[0] and @alltwos[0], so those
values are undef when used in the first print statement.
--
Bob Walton
------------------------------
Date: Sun, 18 Feb 2001 14:50:27 -0800
From: Kira <callgirl@la.znet.com>
Subject: Re:Re:Re:(OFF TOPIC) This is driving me nuts and no guru!
Message-Id: <3A9051B3.37CC8410@la.znet.com>
Chris Fedde wrote:
Uri Guttman wrote:
jb wrote:
Bart Lateur wrote:
Frank Miller wrote:
Tad McClellan wrote:
David H. Adler wrote:
Frank Miller wrote:
Randal L. Schwartz wrote:
Chris Fedde wrote:
Uri Guttman wrote:
Frank Miller wrote:
Steven Smolinski wrote:
jb wrote:
Bart Lateur wrote:
Gwyn Judd wrote:
Abigail wrote:
Peter J. Acklam wrote:
Chris Fedde wrote:
Uri Guttman wrote:
jb wrote:
Bart Lateur wrote:
Frank Miller wrote:
Tad McClellan wrote:
David H. Adler wrote:
Frank Miller wrote:
Frank Miller wrote:
Tim Gaverth wrote:
Joe Schaefer wrote:
John W wrote:
Jonathan Feinberg wrote:
Frank Miller wrote:
Steven Smolinski wrote:
Frank Miller wrote:
Gwyn Judd wrote:
Abigail wrote:
Peter J. Acklam wrote:
Tim Gaverth wrote:
Joe Schaefer wrote:
Frank Miller wrote:
Tim Gaverth wrote:
Richard J. Rauenzahn wrote:
Peter L. Berghold wrote:
John W wrote:
Jonathan Feinberg wrote:
Frank Miller wrote:
Steven Smolinski wrote:
Frank Miller wrote:
Gwyn Judd wrote:
Frank Miller wrote:
Gwyn Judd wrote:
Abigail wrote:
Peter J. Acklam wrote:
Frank Miller wrote:
Tad McClellan wrote:
David H. Adler wrote:
John W wrote:
Jonathan Feinberg wrote:
Frank Miller wrote:
Steven Smolinski wrote:
Frank Miller wrote:
Gwyn Judd wrote:
(snipped)
SHUTUP ALREADY!
Jeesshh... this is worse than
The Night Of The Living Brain Dead.
Godzilla!
------------------------------
Date: Sun, 18 Feb 2001 19:51:03 GMT
From: m_010@yahoo.com (tim leung)
Subject: Regular Expressions
Message-Id: <3a9026b4.44165927@enews.newsguy.com>
Hi,
I want to write a java script that validate a field inside a HTML
FORM.
1) The field contains a string of one or more version numbers
2) If the field has more than 1 version number, then needs a comma to
separate the version.
3) Version number must be separate by 3 dots (e.g. 1.1.1.1 )
Examples:
3.12.0.256 (ok)
1.0.0.0,3.12.1.256, 2.2.2.2 (ok)
1.0.22 (not ok)
1.0.0.0, 3.12.1.256 (ok)
I had come up with the regular expression
var pattern = /^(\d+\.){3}\d+(,(\d+\.){3}\d+)*$/;
but how can I eliminate all the spaces (including leading and trailing
space ) like:
1.0.0.0, 3.12.1.256, 2.2.2.2 to
1.0.0.0,3.12.1.256,2.2.2.2
I try the following code but didn't work:
function verify(f)
{
var msg;
var empty_fields = "";
var errors = "";
//loop through all element in the form
for(var i = 0; i < f.length; i++) {
var e = f.elements[i];
if ( !e.optional ){
//replace all space with empty string
e.value.replace(/\s/g, "");
var pattern = /^(\d+\.){3}\d+(,(\d+\.){3}\d+)*$/;
//match the string without space with pattern
if ( !pattern.test(e.value) ){
empty_fields += " +++++++ " + e.name;
}
}
}
if (!empty_fields ) return true;
msg =
"______________________________________________________\n\n"
msg += "The form was not submitted because of the following
error(s).\n";
msg += "Please correct these error(s) and re-submit.\n";
msg +=
"______________________________________________________\n\n"
if (empty_fields) {
msg += "- The following required field(s) are empty:"
+ empty_fields + "\n";
if (errors) msg += "\n";
}
msg += errors;
alert(msg);
return false;
}
thanks
------------------------------
Date: 18 Feb 2001 16:04:44 -0500
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: Regular Expressions
Message-Id: <m3wvanem8j.fsf@mumonkan.sunstarsys.com>
m_010@yahoo.com (tim leung) writes:
> Hi,
> I want to write a java script that validate a field inside a HTML
> FORM.
I think this is the fourth version of your post that I've
seen in various newsgroups. Please stop multi-posting the
same question. Cross-post it once instead, if you must.
Since you now seek help with java script, I suggest you look
in a java script newsgroup instead of spamming Perl-related
ones like this one.
Joe Schaefer
--
%ENV=(); $A="\rr jpeurls ht\ba \rcankotehe"x666;END{ system
"$^X -wT $0 $^S";print"r\n"}sub foo{$_=pop||exit;/$_/;print
eval 'BEGIN{$^H='. ($^H+=666) .'}$_[-(()=$A=~//g)+$[]';}@_=
reverse$A=~/./g;&foo while$ARGV[0]=~//g;#evil mess for *nix
------------------------------
Date: Sun, 18 Feb 2001 16:41:22 -0800
From: "Jeff Fletcher" <jeff_fletcher@pacbell.net>
Subject: sending data to a script via SSI
Message-Id: <HYZj6.176$xL1.123313@news.pacbell.net>
When I was running my site on Unix, I was able to send data via the URL of a
page, and have SSI's within the page access that data. In other words ....
http://www.mysite.com/page.shtml?string=word
would send string=word into a script executed via a <!--#cgi exec="'-->
command within the page. The script then parsed the data and used it.
Well, for some reason that doesn't work on my new host, which uses an NT
platform.
Any ideas?
------------------------------
Date: Mon, 19 Feb 2001 00:52:31 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: sending data to a script via SSI
Message-Id: <3A906ECF.699B66FD@rochester.rr.com>
Jeff Fletcher wrote:
>
> When I was running my site on Unix, I was able to send data via the URL of a
> page, and have SSI's within the page access that data. In other words ....
>
> http://www.mysite.com/page.shtml?string=word
>
> would send string=word into a script executed via a <!--#cgi exec="'-->
> command within the page. The script then parsed the data and used it.
>
> Well, for some reason that doesn't work on my new host, which uses an NT
> platform.
>
> Any ideas?
And your Perl question is what?
--
Bob Walton
------------------------------
Date: Sun, 18 Feb 2001 17:36:23 -0800
From: Kira <callgirl@la.znet.com>
Subject: Re: sending data to a script via SSI
Message-Id: <3A907897.CA0D6F34@la.znet.com>
Jeff Fletcher wrote:
> When I was running my site on Unix, I was able to send
> data via the URL of a page, and have SSI's within the
> page access that data. In other words ....
> http [...] www.mysite.com/page.shtml?string=word
> would send string=word into a script executed via a <!--#cgi exec="'-->
> command within the page. The script then parsed the data and used it.
Those are false statements. Correct syntax is:
<!--#exec cgi="path/to/script.cgi" -->
> Well, for some reason that doesn't work on my new host,
> which uses an NT platform.
> Any ideas?
Your NT platform is not correctly configured to
execute cgi scripts in user directories or is not
correctly configured to enable server side includes,
or both.
Godzilla!
------------------------------
Date: Sun, 18 Feb 2001 14:35:38 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: When is an array @f allowed in a string?
Message-Id: <slrn99090a.fsa.tadmc@tadmc26.august.net>
Bertilo Wennergren <bertilow@chello.se> wrote:
>Tad McClellan:
>
>> >Thanks also to those who suggested "use diagnostics" and "use strict";
>> >I should probably get into that habit.
>> ^^^^^^
>
>> No "should" about it.
>
>> You *must* get into the habit of "use strict".
>> I have seen people lose jobs for lack of it...
>
>With such a company policy Perl seems not to be the appropriate tool
>to use.
A company policy that helps the company make more money is Good Policy.
Using Perl costs less labor than using C/C++/Java. Using Perl
makes the company money.
Enabling strictures costs less labor than leaving them disabled.
Avoiding code rework (ie. bug fixes) makes the company money.
Perl together with "use strict" is cheaper than Perl alone.
Cheap is good. Expensive (troubleshooting) is bad.
>Or am I wrong?
You decide for yourself. I would decide that you are wrong,
but I have an unhealthy affinity for money.
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Sun, 18 Feb 2001 23:38:19 GMT
From: "Bertilo Wennergren" <bertilow@chello.se>
Subject: Re: When is an array @f allowed in a string?
Message-Id: <L1Zj6.1075$MU.12701@nntp1.chello.se>
Tad McClellan:
> Bertilo Wennergren <bertilow@chello.se> wrote:
> >> You *must* get into the habit of "use strict".
> >> I have seen people lose jobs for lack of it...
> >With such a company policy Perl seems not to be the appropriate tool
> >to use.
> A company policy that helps the company make more money is Good Policy.
> Using Perl costs less labor than using C/C++/Java. Using Perl
> makes the company money.
> Enabling strictures costs less labor than leaving them disabled.
> Avoiding code rework (ie. bug fixes) makes the company money.
> Perl together with "use strict" is cheaper than Perl alone.
> Cheap is good. Expensive (troubleshooting) is bad.
Good arguments. But then a language that makes cheating impossible
would seem more appropriate, wouldn't you say? Having to fire
people because they've botched up, due to the unstrict nature of
perl (it's so easy to leave out the strictures!), can be very,
very costly!
> >Or am I wrong?
> You decide for yourself.
That's right: It's not a must, sayeth the Camel. But it's very
good advice.
> I would decide that you are wrong,
> but I have an unhealthy affinity for money.
Actually I'm a stickler for "use strict" so don't ge me wrong.
I recommend it to everyone, but it's not a must, according to
the Perl philosophy (and I so much prefer to code in Perl,
rather than Java...).
--
#####################################################################
Bertilo Wennergren
<http://purl.oclc.org/net/bertilo>
<bertilow@chello.se>
#####################################################################
------------------------------
Date: Mon, 19 Feb 2001 01:21:03 GMT
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Why can't I grab this URL?
Message-Id: <slrn990t7v.121.mgjv@verbruggen.comdyn.com.au>
On Sat, 17 Feb 2001 02:19:55 GMT,
What A Man ! <whataman@home.com> wrote:
> Bart Lateur wrote:
>>
>> I think you probably need to tweak the REFERER.
>
> I appreciate that suggestion. Obviously, this is the key.
> Someone just e-mailed me a way to do it. I can't wait to
> try it to see if it works.
> to Godzilla: Eat that donkey dung yourself. I used IE5,
Godzilla is a troll. Don't bother responding to it.
> Well, this subject has been exhausted, but what amazes me
> is that perl book author Randall Schwartz didn't give the
It's Randal.
> correct answer either. He did point out the incorrect
> 'Accept'='text/html', though. Thanks for all of the
> helpful responses, and especially for the helpful emails
> (you know who you are). I really do appreciate it.
One reason why Randal didn't come up with the answer may be that none
of this really was a Perl issue. It all comes down to how HTTP works,
how servers can be configured, and what the service you were trying to
contact actually has configured and implemented. No amount of Perl
knowledge would help here. Not even in-depth knowledge of HTTP and
HTML would have helped, since this was really related only to how
these people have configured their services.
It's a bit harsh to blame someone for not being able to divine that
from a post on Usenet. others went the extra step and contacted the
service for you, and read the response for you, so they could give you
advice based on what happened then. But you won't find that sort of
thing in any book on Perl.
Martien
--
Martien Verbruggen |
Interactive Media Division | Failure is not an option. It comes
Commercial Dynamics Pty. Ltd. | bundled with your Microsoft product.
NSW, Australia |
------------------------------
Date: Mon, 19 Feb 2001 00:33:17 GMT
From: Scotty99 <slangdon@tampabay.rr.com>
Subject: Writing a Perl Server
Message-Id: <3A90694E.9E8FF6F8@tampabay.rr.com>
I'm thinking about writing a perl server in a unix environment to
replace the one I currently have that I wrote in C++ in a windows
environment. Unlike a web server,
this server will need to accept sockets and communicate with multiple
clients for extended periods of time. My current server listens for
incoming connections and
accepts each connection and puts it on a separate thread. I noticed
that perl doesn't
have threading or at least not stable threading. Anyway, I am thinking
about using forks, but I am curious if they eat a lot of memory. Say I
have 100 to 500 clients connected each on his own forking process. Is
this feasible or a bad idea?
Scott
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V10 Issue 312
**************************************