[12572] in Perl-Users-Digest
Perl-Users Digest, Issue: 6172 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Jun 29 22:07:14 1999
Date: Tue, 29 Jun 99 19:00:23 -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 Tue, 29 Jun 1999 Volume: 8 Number: 6172
Today's topics:
A cool script... <jbaird@idirect.com>
Re: chomp previous line? (Abigail)
Re: Does (rand * 6) DWIM? (Abigail)
Re: Filehandles, appending a file..why dosn't this work <rootbeer@redcat.com>
Re: Force Refresh for SSI 3will3@my-deja.com
Re: Forms Processing - thread started in HTML group (Abigail)
Re: Help with an array test (Abigail)
Re: Help with an array test (Tad McClellan)
Re: Help with an array test (Abigail)
Re: killing subprocess ==> reproducible core dump <jcreed@cyclone.jprc.com>
Re: menu (Abigail)
Re: MIME TYPE (Abigail)
Re: MIME TYPE (Abigail)
Re: Need help using umask. (Abigail)
Net::Ping...Anonmoly <jbaird@idirect.com>
Re: Net::RawIP <Tim.Potter@anu.edu.au>
Re: Pattern matching $1-$n not being pulled (Abigail)
Re: Pattern matching $1-$n not being pulled e_broyles2@my-deja.com
Re: Perl or PNP...which is better? <danielrod@nts.co.jp>
Re: printing to many filehandles simultaneously <tchrist@mox.perl.com>
Re: Problem <hiller@email.com>
regExpr question. <marlon@soda.CSUA.Berkeley.EDU>
Re: Regular Expression <rereidy@uswest.net>
Re: SSI (Server Side Includes) (Abigail)
Tied hash not scaling - advice? (K. Krueger)
use of stat function in Sprite hugh.casey@colorado.edu
Re: What is First line in Perl5 in Sun Micro... <rootbeer@redcat.com>
Re: What is First line in Perl5 in Sun Micro... (Abigail)
WIN32::ODBC and NDS (any success) ?? <bill_morris@ncsu.edu>
Re: WIN32::ODBC and NDS (any success) ?? <jbaird@idirect.com>
WIN32::ODBC and NDS (any success) ?? <bill_morris@ncsu.edu>
yahoo like search engine <bigpun@mindspring.com>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 29 Jun 1999 21:10:16 -0400
From: John Baird <jbaird@idirect.com>
Subject: A cool script...
Message-Id: <37796E78.B28346C9@idirect.com>
Hello,
I just thought that I would post a short note with regards to a series
of scripts/tools that I have just finished for automating the
configuration of CISCO devices (switches & routers).
Any Internetworking professionals who are looking to automate enterprise
wide changes on CISCO devices, and are currently using HP OpenView or
Tivoli TME 10 (formerly IBM's NetView 6000) as there IP network mngt
system, feel free to contact me as I would be more than happy to share
these tools with you. These scripts parse the information in the seed
file of OpenView and Tivoli systems to give a list of all network
devices, devices are then filtered based on an OSPF area of your network
and the hostnames are extracted and commands are automagically entered
into the devices.... for a more detailed description or for more
information on the above mail me at jbaird@idirect.com.
Leveraging these tools I was able to configure various parameters
(non-interface specific) on approximately 800 routers in about 3 hours,
these tools can save you a tonne of time!!
regards,
Jonathan Baird
With a PC, I always felt limited by the software available. On Unix, I
am limited only by my knowledge.
--Peter J. Schoenster
------------------------------
Date: 29 Jun 1999 20:46:22 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: chomp previous line?
Message-Id: <slrn7nitmv.1gv.abigail@alexandra.delanet.com>
John Little (John.Little@Duke/dot/.edu) wrote on MMCXXVIII September
MCMXCIII in <URL:news:7lbe74$rk5$1@news.duke.edu>:
** Can some help me understand how to chomp the previous line. The only way I
** can identify the lines that are a problem is by identifying all lines which
** begin without a quotation mark. In those case the previous line should be
** chomped. Of coure by the time I identify the line which doesn't begin with a
** quotation mark I've already passed the line I need to work on.
Uhm, uhm, Perl *does* have variables, you know. How about creating a
variable called $previous_line, and store the previous line in it?
Then you can chomp it at will.
Alternatively, you can remember $., seek back in the file, read $. - 1
lines, and chomp the ($. - 1)th line. But that's a hassle.
Abigail
--
echo "==== ======= ==== ======"|perl -pes/=/J/|perl -pes/==/us/|perl -pes/=/t/\
|perl -pes/=/A/|perl -pes/=/n/|perl -pes/=/o/|perl -pes/==/th/|perl -pes/=/e/\
|perl -pes/=/r/|perl -pes/=/P/|perl -pes/=/e/|perl -pes/==/rl/|perl -pes/=/H/\
|perl -pes/=/a/|perl -pes/=/c/|perl -pes/=/k/|perl -pes/==/er/|perl -pes/=/./;
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 29 Jun 1999 19:25:21 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Does (rand * 6) DWIM?
Message-Id: <slrn7niov3.1gv.abigail@alexandra.delanet.com>
Faisal Nasim (swiftkid@bigfoot.com) wrote on MMCXXVIII September MCMXCIII
in <URL:news:7lbrt4$3uo13@news.cyber.net.pk>:
() Not me!
You're quoting after the reply *again*. Fully quoting the signature. *again*.
Welcome to my killfile.
Abigail
--
echo "==== ======= ==== ======"|perl -pes/=/J/|perl -pes/==/us/|perl -pes/=/t/\
|perl -pes/=/A/|perl -pes/=/n/|perl -pes/=/o/|perl -pes/==/th/|perl -pes/=/e/\
|perl -pes/=/r/|perl -pes/=/P/|perl -pes/=/e/|perl -pes/==/rl/|perl -pes/=/H/\
|perl -pes/=/a/|perl -pes/=/c/|perl -pes/=/k/|perl -pes/==/er/|perl -pes/=/./
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Tue, 29 Jun 1999 17:14:31 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Filehandles, appending a file..why dosn't this work?
Message-Id: <Pine.GSO.4.02A.9906291712370.4425-100000@user2.teleport.com>
On Wed, 30 Jun 1999, Faisal Nasim wrote:
> try:
>
> print \n;
>
> and see what happens
$ perl
print \n;
SCALAR(0x14d738)$
Maybe trying it is good advice. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 30 Jun 1999 01:29:58 GMT
From: 3will3@my-deja.com
Subject: Re: Force Refresh for SSI
Message-Id: <7lbrue$10q$1@nnrp1.deja.com>
> abigail@delanet.com wrote:
> 3will3@my-deja.com (3will3@my-deja.com) wrote on MMCXXVIII September
> MCMXCIII in <URL:news:7l9ntt$7ab$1@nnrp1.deja.com>:
> .. So I have used a random text CGI script in a SSI,
> .. and the problem is that when you go back to the
> .. question page again and ask another question, you
> .. will get the same quote again!
>
> Yeah, and? Should we be impressed?
>
> Your posting doesn't smell like Perl. It smells like a lot of other
> things, that are better discussed in the other part of town.
>
> You could take a cab, or the subway. I wouldn't walk, it's likely
> to rain soon.
Hello,
I thought some clever human being in these parts might be able to help
me with this problem as this is where I stumbled into in my desperation!
And you didn't even give me directions! or any clue whatsoever as to
what to do!
Thanks Tom Phoenix, I'll look into this.
Julian.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 29 Jun 1999 19:28:40 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Forms Processing - thread started in HTML group
Message-Id: <slrn7nip5a.1gv.abigail@alexandra.delanet.com>
Ken (kloomis@it-resourcesNOSPAM.com) wrote on MMCXXVIII September
MCMXCIII in <URL:news:3778fac7.13647775@news.tiac.net>:
"" I have a form on a website that directs people to fill in infomation
"" and check boxes. If all is well, the form info gets sent and a
"" message appears that thanks them and provides further instructions.
""
"" I want to have it so that if a certain box is checked, the info is not
"" set and a different web message appears that tells them that for some
"" reason they are disqualified.
""
"" Can someone suggest how this would be done?
Easy. You check which box is checked, and if a certain box is checked,
your print the different web message. You just omit the step where you
set the info.
Did you have any Perl specific question, or you like to hang out in
different groups and ask random questions? Maybe you should ask about
penguins in rec.furniture, they have much more humour than we have.
Abigail
--
srand 123456;$-=rand$_--=>@[[$-,$_]=@[[$_,$-]for(reverse+1..(@[=split
//=>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\n"
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 29 Jun 1999 19:44:27 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Help with an array test
Message-Id: <slrn7niq2s.1gv.abigail@alexandra.delanet.com>
Jeff Beard (jeffbREMOVETHIS@mcguckin.com) wrote on MMCXXVIII September
MCMXCIII in <URL:news:37791297.66392A21@mcguckin.com>:
{}
{} I need to test an array to see if all values are null. If they are, do
{} one things if not, do another. I've been playing with loops that test if
{} each element is null but I need to know if they're all null.
I'm nut sure what you mean by null, as there's no Perl keyword or term
by that name. Let's assume you mean the string null.
To see if they are all equal to "null":
my $all_null = @array == grep {$_ eq "null"} @array;
However, this doesn't take advantage of an "early failure".
This does:
my $all_null = 1;
foreach (@array) {
if ($_ eq "null") {
$all_null = 0;
last;
}
}
And if you are into obfuscation, you might like:
my $all_null = do {local $" = "&&";
eval "@{[map {qq{qq{\Q$_\E} eq qq{null}}} @array]}"};
The case where "null" should be understood as "undefined" is left as an
exercise to the reader.
Abigail
--
perl -wle '$, = " "; print grep {(1 x $_) !~ /^(11+)\1+$/} 2 .. shift'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Tue, 29 Jun 1999 16:09:50 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Help with an array test
Message-Id: <e69bl7.mt1.ln@magna.metronet.com>
Marcel Grunauer (marcel.grunauer@lovely.net) wrote:
: On Tue, 29 Jun 1999 12:38:15 -0600, Jeff Beard
: <jeffbREMOVETHIS@mcguckin.com> wrote:
: >I need to test an array to see if all values are null.
: Not exactly sure whether this is what you mean, but I took it to mean
: "all elements should be 0", not "undef".
See? (Jeff)
Two followups (so far), two interpretations as to what "null"
might be meaning here, two different chunks of code.
A poor specification results in a poor program.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 29 Jun 1999 20:52:17 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Help with an array test
Message-Id: <slrn7niu23.1gv.abigail@alexandra.delanet.com>
Abigail (abigail@delanet.com) wrote on MMCXXIX September MCMXCIII in
<URL:news:slrn7niq2s.1gv.abigail@alexandra.delanet.com>:
[]
[] I'm nut sure
I hate making typos. The above should of course read:
I'm a nut, sure.
Abigail
--
perl -wle 'print "Prime" if ("m" x shift) !~ m m^\m?$|^(\m\m+?)\1+$mm'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 29 Jun 1999 20:51:22 -0400
From: Jason Reed <jcreed@cyclone.jprc.com>
Subject: Re: killing subprocess ==> reproducible core dump
Message-Id: <a19092jyt1.fsf@cyclone.jprc.com>
Jamie Zawinski <jwz@jwz.org> writes:
> What I am trying to do is, run a subprocess, and if it doesn't complete
> in a few seconds, kill it and move on.
One way that's worked for me in the past is not
trapping a die() but rather killing the process,
like so:
{
my $timeout = 5;
my $pid = fork();
if (!$pid) {
exec 'foo', 'bar', 'baz';
die "Couldn't exec: $!";
}
local $SIG{ALRM} = sub {
kill 9, $pid;
};
alarm($timeout);
waitpid $pid, 0; # for the process to finish or timeout
alarm(0);
}
(Hasn't been heavily tested, though...)
---Jason
------------------------------
Date: 29 Jun 1999 20:00:38 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: menu
Message-Id: <slrn7nir18.1gv.abigail@alexandra.delanet.com>
Tanya (tanya@i-cable.com) wrote on MMCXXVIII September MCMXCIII in
<URL:news:377871E9.8AA936E2@i-cable.com>:
** where can i download the full perl 5.00x user menu?
User menu? A perl user menu?
What kind of a restaurant would serve that?
Abigail
--
What's that guy with a riffle doing in my gaNR#(#]'sa..
NO CARRIER
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 29 Jun 1999 20:01:33 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: MIME TYPE
Message-Id: <slrn7nir2v.1gv.abigail@alexandra.delanet.com>
cwt (eng80386@nus.edu.sg) wrote on MMCXXVIII September MCMXCIII in
<URL:news:7la6n4$k5$1@nobel2.pacific.net.sg>:
<> Hallo all,
<> Anyone has any idea what this header " Content-Type: text/html\n\n<pre>" has
<> in difference with "Content-Type: text/html\n\n" ??
6 bytes. 1 at the beginning, 5 at the end.
Abigail
--
perl -MNet::Dict -we '(Net::Dict -> new (server => "dict.org")
-> define ("foldoc", "perl")) [0] -> print'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 29 Jun 1999 20:54:34 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: MIME TYPE
Message-Id: <slrn7niu6b.1gv.abigail@alexandra.delanet.com>
Martin Quensel (martin@adoma.se) wrote on MMCXXVIII September MCMXCIII in
<URL:news:3778B33E.FDF73AAE@adoma.se>:
()
() well here is a question for you! What does my name mean in english?
"He who folds yellow cucumbers in the dark".
Or was that the Swahili meaning?
Abigail
--
perl -MTime::JulianDay -lwe'@r=reverse(M=>(0)x99=>CM=>(0)x399=>D=>(0)x99=>CD=>(
0)x299=>C=>(0)x9=>XC=>(0)x39=>L=>(0)x9=>XL=>(0)x29=>X=>IX=>0=>0=>0=>V=>IV=>0=>0
=>I=>$r=-2449231+gm_julian_day+time);do{until($r<$#r){$_.=$r[$#r];$r-=$#r}for(;
!$r[--$#r];){}}while$r;$,="\x20";print+$_=>September=>MCMXCIII=>()'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 29 Jun 1999 20:07:38 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Need help using umask.
Message-Id: <slrn7nirec.1gv.abigail@alexandra.delanet.com>
Brian Wagener (wagener@cs.fsu.edu:NOSPAM) wrote on MMCXXVIII September
MCMXCIII in <URL:news:7lah7g$g6d$1@news.fsu.edu>:
~~ I am having problems using umask. The perl docs are very sparse on the
~~ subject. Well here is what I think I know and just tell me what is wrong.
~~ umask sets the default permissions of the files that havent been made yet.
~~ In my case I want all subsequent files to be made with full permission so I
~~ tried "umask 0777" and it didn't work. What am I doing wrong.
Since you don't explain the "didn't work" part, it's hard to say.
However, I can say that a umask of 0777 won't do want you want it to do.
A umask of 0000 will.
Abigail
--
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Tue, 29 Jun 1999 20:53:00 -0400
From: John Baird <jbaird@idirect.com>
Subject: Net::Ping...Anonmoly
Message-Id: <37796A6B.7A9EC0F9@idirect.com>
Hello,
Has anyone used the Net::Ping module?? If so has anyone noticed that it
seems to be unreliable in the sense that even if the device is up and is
pingable via a UNIX ping the perl ping module will return 0 indicating
that the targeted device is not available. Regardless of the protocol
type used (i.e. UDP, TCP, unable to use ICMP as I am not root on that
box) it will only successfully reach approximately 4 out of ten
devices. In fact it will reach some devices on a subnet but not
others! Moreover it does not matter if an IP address is used or a
hostname which gets resolved is used, the perl module seems to only
reaches devices which are confirmed up when it wants to!!
Is there a solution that anyone knows about to solve this anonmoly??
thanks in advance,
Jonathan Baird
With a PC, I always felt limited by the software available. On Unix, I
am limited only by my knowledge.
--Peter J. Schoenster
------------------------------
Date: 30 Jun 1999 10:55:32 +1000
From: Tim Potter <Tim.Potter@anu.edu.au>
To: Antti-Jussi Korjonen <korjoan1@babylon.dat.tele.fi>
Subject: Re: Net::RawIP
Message-Id: <6yhfnq1p8b.fsf@acronym.anu.edu.au>
Antti-Jussi Korjonen <korjoan1@babylon.dat.tele.fi> writes:
> Hi!
>
> Is it possible to specify ethernet frame checksum using RawIP module?
> I'm able to specify source and destination mac addresses, but cannot
> specify FCS checksum. Does anybody else know a way to generate otherwise
> valid ethernet packet except the FCS being faulty?
Probably not, unless you can get your hands on an ethernet protocol
analyser. The FCS field is usually generated and verified in
hardware and not under the control of the operating system.
Tim.
--
Tim Potter, System Admin/Programmer "Disco Stu doesn't advertise"
Advanced Computational Systems CRC, RSISE Bldg Australian National University,
Canberra 0200, AUSTRALIA Ph: +61 2 62798813 Fax: +61 2 62798602
------------------------------
Date: 29 Jun 1999 20:11:43 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Pattern matching $1-$n not being pulled
Message-Id: <slrn7nirm1.1gv.abigail@alexandra.delanet.com>
e_broyles2@my-deja.com (e_broyles2@my-deja.com) wrote on MMCXXVIII
September MCMXCIII in <URL:news:7lb40k$o2h$1@nnrp1.deja.com>:
!! Can someone tell me why when I do this:
!!
!! $myvar = "134:00:34:56";
!!
!! if ($myvar =~ /(.*?):(.*?):(.*?):(.*?)/) {
!! print "$1\n";
!! print "$2\n";
!! print "$3\n";
!! print "$4\n";
!! }
!!
!! I get the following output:
!!
!! 134
!! 00
!! 34
!!
!!
!! Instead of
!!
!! 134
!! 00
!! 34
!! 56
Because you ask for the *shortest* match (at that point) that satisfies
the regex. And '' is shorter than 56. If you don't want it, don't ask
for it.
Abigail
--
perl -MNet::Dict -we '(Net::Dict -> new (server => "dict.org")
-> define ("foldoc", "perl")) [0] -> print'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Wed, 30 Jun 1999 01:22:54 GMT
From: e_broyles2@my-deja.com
Subject: Re: Pattern matching $1-$n not being pulled
Message-Id: <7lbrh7$t0$1@nnrp1.deja.com>
Thank you, I figured it was something pretty obvious.
The sound you hear is me slapping my head.
In article <7lbbr8$r97$1@nnrp1.deja.com>,
Peter Jones <peter_jones@my-deja.com> wrote:
> In article <7lb40k$o2h$1@nnrp1.deja.com>,
> e_broyles2@my-deja.com wrote:
> > Can someone tell me why when I do this:
> >
> > $myvar = "134:00:34:56";
> >
> > if ($myvar =~ /(.*?):(.*?):(.*?):(.*?)/) {
> > print "$1\n";
> > print "$2\n";
> > print "$3\n";
> > print "$4\n";
> > }
> >
> > I get the following output:
> >
> > 134
> > 00
> > 34
> >
> > Instead of
> >
> > 134
> > 00
> > 34
> > 56
> >
> > Thanks!
> >
> > Sent via Deja.com http://www.deja.com/
> > Share what you know. Learn what you don't.
> >
>
> because you are using minimal matching (*?). The pattern will stop as
> soon as it can (match as little as possible). Your regex says that it
> can stop matching after the final ':' so it will not match the last
> group of numbers. there are a few things you can do, here are some
> example reqexs...
>
> /^(\d+):(\d+):(\d+):(\d)$/
>
> which will match numbers with ':' as a seperator.
>
> /^([^:]+):([^:]+):([^:]+):([^:]+)$/
> which will match all chars that are not ':' with ':' as a seperator.
>
> you can also do this...
> @parts = split(/:/, $myvar);
> which will fill @parts with everything that is not ':' so you get
> $parts[0] = '134';
> $parts[1] = '00';
> $parts[2] = '34';
> $parts[3] = '56';
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Wed, 30 Jun 1999 00:38:36 GMT
From: Daniel <danielrod@nts.co.jp>
Subject: Re: Perl or PNP...which is better?
Message-Id: <7lboub$34$1@nnrp1.deja.com>
Sorry for the blatant mistake on my part everyone! I meant to say PHP,
not PNP.
--Daniel
In article <7l98ue$2kt$1@nnrp1.deja.com>,
Daniel <danielrod@nts.co.jp> wrote:
> I am a beginning programmer, interested in web programming. I have
> read much about Perl, mod_perl, PNP, Java servlets, ASP, etc.
>
> I am interested in knowing which might be the more beneficial tool to
> learn, coming from a "no previous experience" background. I.e., If I
> am not a Perl programmer, and I am not a PNP programmer, which has the
> best future potential? (both technical and careerwise)
>
> Please understand that I am a student, not an IT manager, and hence I
> am trying to get a feel for future market potential, not trying to
> solve a particular real-live IT problem.
>
> Insofar as Perl is concerned, lets assume mod_perl, so as to put it on
> an equal field as PNP.
>
> Thanks to all!
>
> --Daniel
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
>
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 29 Jun 1999 18:05:17 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: printing to many filehandles simultaneously
Message-Id: <37795f3d@cs.colorado.edu>
[courtesy cc of this posting mailed to cited author]
In comp.lang.perl.misc, abigail@delanet.com writes:
:Ah, yes. fork(). That doesn't quite work on NT, does it?
Fix In The Next Release, thanks to Sarathy.
--tom
--
double value; /* or your money back! */
short changed; /* so triple your money back! */
--Larry Wall in cons.c from the 4.0 perl source code
------------------------------
Date: Wed, 30 Jun 1999 01:10:35 GMT
From: Jordan Hiller <hiller@email.com>
Subject: Re: Problem
Message-Id: <37796E0F.3A1FFE97@email.com>
Try this (untested). It should (theoretically) allow for
$password = "passwordenteredbyuser";
$username = "username";
print "Good password" if check_password($username, $password);
sub check_password {
my($user, $pass) = @_;
#Load each line
open(PASSFILE, "<passwords.txt") or die "Can't open passwords file: $!";
@lines = <PASSFILE>;
close(PASSFILE);
#Check if a line matches
foreach $line (@lines) {
return 1 if $line =~ /^[\s]*$user|$pass[\s\n]/;
}
#Return false if none match
return '';
}
HTH,
Jordan
Mike Foroobar wrote:
>
> As part of a larger script I am making, I need a user authentication script.
> All users and their relative passwords are stored in a flatfile database
> with the syntax:
>
> user_name|password
>
> When a user executes an action, the script send a querystring with teh user
> name and password. I now need to find out how to make sure that not only
> the username is in the database, but that is also his correct password. I
> think I know how to do the first part, but I don't know exactly how it would
> be written. Wouldn't you just read teh file into an array and then just
> check to see if the username came up in there using =~? For the second
> part, all I need to determine is if the username and passowrd are on teh
> same line. I tried to read it all into an associative array, but got
> nowhere with that. Any help, especially code, is appreciated. E-mail me at
> mikef@gigagate.com or ICQ at my handle gigagate.
>
> Sincerely,
> Mike Foroobar
--
Jordan Hiller
hiller@email.com
:~
------------------------------
Date: Tue, 29 Jun 1999 18:12:14 -0700
From: marlon <marlon@soda.CSUA.Berkeley.EDU>
Subject: regExpr question.
Message-Id: <Pine.BSF.3.96.990629180249.4862A-100000@soda.CSUA.Berkeley.EDU>
Im all FAQed out, I've spent some time on cpan and the examples dont seem
to work for my task:
I have:
$foo equal to
" a whole lot of html
spanning several lines, there are 2 specific unique
strings like <!-- something unique 1 --> and a
bunch of html in between <!-- something unique 2 -->
and then a whole lot more stuff"
so that's what $foo looks like.
And what I want is to capture all the text INBETWEEN the 2 unique strings.
It doesn't matter if I get the 2 unique strings (they're just HTML
comments) but I dont know if I have to turn $foo into a file handle,
if so then what?
If I leave $foo as a scalar how do I apply a regexp accross it?
Thanks in advance, marlon
_
------------------------------
Date: Tue, 29 Jun 1999 18:17:20 -0600
From: Ron Reidy <rereidy@uswest.net>
Subject: Re: Regular Expression
Message-Id: <37796210.A257BD62@uswest.net>
Eric Anderson wrote:
> I have a regular expression that I am trying to get to match to
> $parseString. Basically the code is as follows:
>
> if ( $parseString =~ /\<%\s*@\s*language\s*=\s*\"?(\w+)\"?\s*%\>/i )
> {
> $language = $1;
> } else {
> $language = "Not Found";
> }
>
> Now when $parseString contains the following:
>
> <%@ Language = VBScript %>
>
> $language should be equal to "VBScript", but instead the pattern is not
> matched, so $language is assigned "Not Found".
>
> I wasn't sure if the "%" character should have the "\" before it (like
> \%). Also I wasn't sure if "@" character should have a "\" before it,
> but I have tried putting a "\" in front of both. Still no match is made.
> Anybody have any ideas.
>
> --
> Eric Anderson
> Computer Science, Georgia Tech
> Co-op, Southern Regional Education Board
> ICQ# 1279816
Works for me.
--
Ron Reidy
Oracle DBA
Reidy Consulting, L.L.C.
------------------------------
Date: 29 Jun 1999 20:17:23 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: SSI (Server Side Includes)
Message-Id: <slrn7nis0k.1gv.abigail@alexandra.delanet.com>
Daniel Ulrich (shades__@mitec.net) wrote on MMCXXVIII September MCMXCIII
in <URL:news:3778ffd7@news5.newsfeeds.com>:
__
__ I need to send a server side include a variable (a code to tell it what
__ to display) but I can't seem to do this. I am using Perl 5 on a Linx/Apache
__ server. Is there a way that I can do this. I have tried cgi="script.pl?a"
__ wont work. cgi="script.pl$a" works but I can't find the variable in the env
__ or argv. If someone can help me?
And your Perl question is?
Abigail
--
echo "==== ======= ==== ======"|perl -pes/=/J/|perl -pes/==/us/|perl -pes/=/t/\
|perl -pes/=/A/|perl -pes/=/n/|perl -pes/=/o/|perl -pes/==/th/|perl -pes/=/e/\
|perl -pes/=/r/|perl -pes/=/P/|perl -pes/=/e/|perl -pes/==/rl/|perl -pes/=/H/\
|perl -pes/=/a/|perl -pes/=/c/|perl -pes/=/k/|perl -pes/==/er/|perl -pes/=/./
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 29 Jun 1999 17:41:59 -0700
From: kirbyk@best.com (K. Krueger)
Subject: Tied hash not scaling - advice?
Message-Id: <7lbp4n$2d0$1@shell2.ba.best.com>
I have a series of scripts, designed to help our operations center deal
with spam complaints. As part of this, it creates an audit trail. These
are arranged like: <auditdir>/6.29.99/209.162.144.3.blocked.
I've got a CGI tool that can search for a particular IP in the audit trail.
As time went by, using File::find for this got really slow, unsurprisingly.
So, I learned about tied hashes, and made an index file. All was well,
and it was blazingly fast.
Much more time has passed, and now it's completely broken. And when I
look at the index file:
-rw-r--r-- 1 kirbyk user 594935808 Jun 28 13:55 audit.index
Yikes! That's one big file!
I've deleted it and regenerated it, and it's still doing this.
So, clearly, I need to change something. I'm not sure if there's an
easy solution, or if I'll have to dig in and run something like a
mySQL database for the backend. It's really useful to be able to pull
up the reason we're blocking someone when an angry ISP is on the other
line. :-)
Here's the (pared down slightly) code. It worked, once upon a time:
#! /usr/local/bin/perl -w
use File::Find;
use POSIX;
use DB_File;
$auditDir = "/home/netbuild/postmaster/spam/audit";
$indexFile = "$auditDir/audit.index";
if (-e $indexFile) {
#if indexFile exists, don't start from scratch
@date = (localtime);
$date[4]++;
$auditDir .= "/$date[4].$date[3].$date[5]";
}
tie %files, "DB_File", $indexFile, O_CREAT|O_RDWR, 0666, $DB_HASH;
find (\&add_file, $auditDir);
untie %files;
exit 0;
sub add_file {
$file = $File::Find::name;
return if -d $file;
return if $file eq $indexFile;
($site) = ($file =~ /.*\/.*\/(.*)$/);
($ip) = ($site =~ /(\d*\.\d*\.\d*\.\d*).*/);
return if !$ip;
$fileList = $main::files{$ip};
return if $fileList && $fileList =~ /$file/;
$fileList .= " $file";
$main::files{$ip} = $fileList;
}
--
Kirby Krueger O- kirbyk@best.com
<*> Lips that taste of tears, they say, are the best for kissing - D. Parker
------------------------------
Date: Wed, 30 Jun 1999 01:03:34 GMT
From: hugh.casey@colorado.edu
Subject: use of stat function in Sprite
Message-Id: <7lbqd2$h4$1@nnrp1.deja.com>
Can anybody tell me what this perl command is doing with the stat() and
why the if ( (-e _) && (-T _) && (-s _) && (-r _) ) statement is
failing? here's the code snippet:
stat ($file);
&printmsg("got to here in Sprite: \$file is:");
&printmsg($file);
if ( (-e _) && (-T _) && (-s _) && (-r _) ) {
if (defined ($$self{DB_records})) {
undef $$self{DB_records};
}
$$self{DB_records} = $self->load_database ($file);
} else {
$reload_status = 0;
}
}
return ($reload_status);
This code comes from the Sprite module, the well-known flat file
database app. I cannot find docuemation on this use of the stat()
anywhere; any help much appreciated!
Hugh Casey
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Tue, 29 Jun 1999 17:09:34 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: What is First line in Perl5 in Sun Micro...
Message-Id: <Pine.GSO.4.02A.9906291657550.4425-100000@user2.teleport.com>
On 29 Jun 1999, 139af0000-HornL(DR9127)1w81 wrote:
> Is there any way to use an environment variable on the
> first line?
If and only if your system supports doing that, you can do it. Perl has no
control over whether your system supports that, of course. (Well, we could
give perl the ability to patch the kernel, but that's going too far....)
> Or possibly some other syntax using ENV?
The INSTALL doc which comes with perl sez:
It may seem obvious to say, but Perl is useful only when users can
easily find it. It's often a good idea to have both /usr/bin/perl and
/usr/local/bin/perl be symlinks to the actual binary. Be especially
careful, however, of overwriting a version of perl supplied by your
vendor. In any case, system administrators are strongly encouraged to
put (symlinks to) perl and its accompanying utilities, such as
perldoc, into a directory typically found along a user's PATH, or in
another obvious and convenient place.
If #!/usr/bin/perl doesn't work on your system, you should read this
paragraph to your favorite admin over pizza and beer. If it still doesn't
work, buy more beer.
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 29 Jun 1999 20:49:49 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: What is First line in Perl5 in Sun Micro...
Message-Id: <slrn7nittf.1gv.abigail@alexandra.delanet.com>
Tom Phoenix (rootbeer@redcat.com) wrote on MMCXXIX September MCMXCIII in
<URL:news:Pine.GSO.4.02A.9906291657550.4425-100000@user2.teleport.com>:
||
|| (Well, we could
|| give perl the ability to patch the kernel, but that's going too far....)
Yeah, we should stop after creating /vmperl.
Abigail
--
perl -MNet::Dict -we '(Net::Dict -> new (server => "dict.org")
-> define ("foldoc", "perl")) [0] -> print'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Tue, 29 Jun 1999 20:57:41 -0400
From: "Bill Morris" <bill_morris@ncsu.edu>
Subject: WIN32::ODBC and NDS (any success) ??
Message-Id: <7lbqcq$g8v$1@server2.wans.net>
I am trying to use WIN32 perl with the WIN32::ODBC drivers
of Roth to access the NDS tree in Novell.
Has anyone had any success with this ?
Bill Morris
------------------------------
Date: Tue, 29 Jun 1999 21:21:27 -0400
From: John Baird <jbaird@idirect.com>
Subject: Re: WIN32::ODBC and NDS (any success) ??
Message-Id: <37797117.9190EC7E@idirect.com>
Hello,
what you may find a little easier is to load an LDAP NLM (Light-weight
Directory Access Protocol / Netware Loadable Module) and use the Perl
LDAP module which is available from CPAN....
just a thought...
regards,
Jonathan Baird
With a PC, I always felt limited by the software available. On Unix, I
am limited only by my knowledge.
--Peter J. Schoenster
Bill Morris wrote:
> I am trying to use WIN32 perl with the WIN32::ODBC drivers
> of Roth to access the NDS tree in Novell.
>
> Has anyone had any success with this ?
>
> Bill Morris
------------------------------
Date: Tue, 29 Jun 1999 21:06:04 -0400
From: "Bill Morris" <bill_morris@ncsu.edu>
Subject: WIN32::ODBC and NDS (any success) ??
Message-Id: <7lbr7e$gtr$1@server2.wans.net>
Folks,
Has anyone had any success using WIN32 perl
and WIN32::ODBC to query data from the NDS
tree ?? I have Novell's most current ODBC
drivers installed.
Bill Morris
bill_morris@ncsu.edu
------------------------------
Date: Tue, 29 Jun 1999 21:15:49 -0400
From: "Big Poppa" <bigpun@mindspring.com>
Subject: yahoo like search engine
Message-Id: <3kee3.318$ue4.17867@typ32b.nn.bcandid.com>
Hello....I need a cgi script that is like Yahoo. Where you can type in
keywords or select from groups or categories.....
email me at bigpun@mindspring.com if you can help!
Thanx
Jim
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
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 6172
**************************************