[6873] in Perl-Users-Digest
Perl-Users Digest, Issue: 498 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 19 17:17:17 1997
Date: Mon, 19 May 97 14:00:34 -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 Mon, 19 May 1997 Volume: 8 Number: 498
Today's topics:
$% argument prototype. (Abigail)
Re: $% argument prototype. <merlyn@stonehenge.com>
Re: Bug report: Perl dumps core on funny split (M.J.T. Guy)
Clearing a Form when using the Back Button (Timothy Lux)
grep pat from files and subdirectories Query????
Re: Help: How to Split a file at a Null Line??? (Bart Lateur)
Re: Help: How to Split a file at a Null Line??? (Tad McClellan)
Re: Help: How to Split a file at a Null Line??? (Chipmunk)
Re: idea for new for loop construct <trenton@ssil.uoregon.edu>
Re: idea for new for loop construct <trenton@ssil.uoregon.edu>
Re: idea for new for loop construct (M.J.T. Guy)
Re: inclu-OR in regex <merlyn@stonehenge.com>
Re: Notice to antispammers <merlyn@stonehenge.com>
Pattern matching question (David Dougal)
Re: Pattern matching question <stephen+usenet@farrell.org>
Re: Pattern matching question <stephen+usenet@farrell.org>
Re: perl and awk <merlyn@stonehenge.com>
Re: print variable $abc which consist of '$' in it Query????
Re: print variable $abc which consist of '$' in it (Tung-chiang Yang)
Re: print variable $abc which consist of '$' in it (A. Deckers)
Re: print variable $abc which consist of '$' in it <stephen+usenet@farrell.org>
Re: print variable $abc which consist of '$' in it (Tad McClellan)
Re: print variable $abc which consist of '$' in it (Eric Harley)
Re: REQ: Perl obfuscator (Andrew Haveland-Robinson)
Simple (?) question <alan-s@consultancy-services*.*com>
Re: Small Web DataBase Wanted <snevel@nospam.wco.com>
Small Web DataBase <Michael.C.Lammon@MCI.com>
Re: Timing Out While waiting for user input (M.J.T. Guy)
Updated Perl Web Server (mhttpd-0.8) (Jerry LeVan)
Weird warning <burleigh@hackberry.chem.niu.edu>
Re: What is the context of $a->m1 in $a->m1->m2 ? (M.J.T. Guy)
Which best one for extension and embeddings? (Timothy Stark)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 19 May 1997 05:03:19 GMT
From: abigail@fnx.com (Abigail)
Subject: $% argument prototype.
Message-Id: <EAEwpJ.1ow@nonexistent.com>
I have a function 'fetch_table' with prototype $%, returning
an array of array references.
sub fetch_table ($%) {
my $dbh = shift or confess "No database handle";
my %args = @_;
... Lots of stuff ...
wantarray ? @rows : [@rows];
}
Now I have a second function 'fetch_cell' as follows:
sub fetch_cell (@) {
(fetch_table @_) [0] -> [0];
}
If I call fetch_cell, then %args in fetch_table will be empty, even
while @_ in fetch_cell contains a lot.
If I change it to:
sub fetch_cell (@) {
(fetch_table shift, @_) [0] -> [0];
}
it works as expected, passing everything to fetch_table.
Why is this? Does the $% as parameter list of fetch_table force
@_ to be evaluated in a scalar context?
$ perl -v
This is perl, version 5.003 with EMBED
built under solaris at Dec 11 1996 16:49:19
+ suidperl security patch
Abigail
------------------------------
Date: 19 May 1997 06:22:34 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: abigail@fnx.com
Subject: Re: $% argument prototype.
Message-Id: <8c7mgvegv9.fsf@gadget.cscaper.com>
>>>>> "Abigail" == Abigail <abigail@fnx.com> writes:
Abigail> Why is this? Does the $% as parameter list of fetch_table force
Abigail> @_ to be evaluated in a scalar context?
Yes indeedy. That's the whole point. You've promised with a
prototype that you'll be passing a scalar as the first formal arg.
Therefore, the first formal arg must be eval'ed in a scalar context.
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 470 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: 19 May 1997 12:38:45 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Bug report: Perl dumps core on funny split
Message-Id: <5lphkl$ouh@lyra.csx.cam.ac.uk>
Dominic Dunlop <domo@tcp.ip.lu> wrote:
>
>I can't reproduce this, either on 5.003 or on really really really
>soon-to-be-released 5.004 'gamma' (both on MachTen 4.0.3). Somebody
>running 5.004 on an Alpha needs to see if the problem is present or gone
>on that platform.
Dunno about Alpha, but this fails with 5.003 and is OK with 5.004 on
SunOS 4.1.3. So it's probably fixed in 5.004.
Mike Guy
------------------------------
Date: Mon, 19 May 97 15:41:50 GMT
From: luxt@gvsu.edu (Timothy Lux)
Subject: Clearing a Form when using the Back Button
Message-Id: <5lps6d$c47@news.gvsu.edu>
Keywords: form persistant cache clear perl
Hi:
I noticed when visiting Webcrawler's add a site option that after the
submission was processed, I (like many) click the back button rather than
following any links. When I did, the form I used to submit the information was
cleared.
I have been trying to do this on our forms for quite a while--especially to
prevent getting duplicate submissions by users going back and forth. Can
anyone help point me in the direction of where to find how to do this?
Help much appreciated--
Thanks,
Timothy Lux
luxt@gvsu.edu
------------------------------
Date: 19 May 1997 06:23:32 GMT
From: Query????
Subject: grep pat from files and subdirectories
Message-Id: <5lorl4$cdu@triton.np.ac.sg>
Hi,
How do I grep a pattern from a directory which consist of files
and subdirectories ending with *.abc.
example
grep $pat $dir/*.abc.
"*.abc" can be files or subdirectories residing in dir.
Why is it that I can't do this:-
$alldfiles= <$listdir/*desc>;
open(OUT, "<$allfile") || die "can't open $outfile to write ($!)\n";
Any pointers would be appreciated.
Thanks.
------------------------------
Date: Mon, 19 May 1997 11:28:57 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Help: How to Split a file at a Null Line???
Message-Id: <33803950.2120324@news.tornado.be>
tcyang@netcom.com (Tung-chiang Yang) wrote:
>close(FILE1);
>close(FILE2);
>
># I still wonder if it is necessary to test whether the close's succeed.
Closing a file only fails if your disk is full. I think.
Gent (Ghent, Gand),
Belgium,
Europe,
3rd planet from the sun.
------------------------------
Date: Mon, 19 May 1997 07:17:07 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Help: How to Split a file at a Null Line???
Message-Id: <3cgpl5.mo.ln@localhost>
$j,u?OE" (swsung.bbs@cis.nctu.edu.tw) wrote:
: Hi,
: I have a file and there is a blank line amid this file.
: How can I split the file into two file at the blank line?
: Any answers will be highly appreciated.
-----------------
#! /usr/bin/perl -w
open(OUT, ">file1") || die "could not open file1 $!";
while (<>) {
if (/^$/) { # found an empty line
# open() below does an implicit close(OUT) first
open(OUT, ">file2") || die "could not open file2 $!";
next;
}
print OUT;
}
close(OUT);
-----------------
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: 19 May 1997 13:48:04 GMT
From: Ronald.J.Kimball@dartmouth.edu (Chipmunk)
Subject: Re: Help: How to Split a file at a Null Line???
Message-Id: <5lplmk$cum$1@dartvax.dartmouth.edu>
In article <tcyangEAEzz2.1JJ@netcom.com>
tcyang@netcom.com (Tung-chiang Yang) writes:
> last if /^\n$/;
/^$/ would also work here.
Chipmunk
------------------------------
Date: Mon, 19 May 1997 02:37:15 -0700
From: Trenton Lipscomb <trenton@ssil.uoregon.edu>
Subject: Re: idea for new for loop construct
Message-Id: <33801F4B.C0A71BF9@ssil.uoregon.edu>
Chaim Frenkel wrote:
> One killer is that currently perl expands lists, but why are you
> not using for (1..4) its of reasonable size.
I'm not saying that this is a bad way of doing it. I'm just saying that
I think
for(10 x)
is a naturaly way of saying "repeat this ten times" and should be
included as a valid for and while loop argument. But the
for(1 .. $foo)
is a very elegant, intuative of making the loop too. It's always nice
to have options, and, "there's always more than one way to do it".
------------------------------
Date: Mon, 19 May 1997 02:39:03 -0700
From: Trenton Lipscomb <trenton@ssil.uoregon.edu>
Subject: Re: idea for new for loop construct
Message-Id: <33801FB7.D234F4C0@ssil.uoregon.edu>
Chaim Frenkel wrote:
> One killer is that currently perl expands lists, but why are you
> not using for (1..4) its of reasonable size.
I'm not saying that this is a bad way of doing it. I'm just saying that
I think
for(10 x)
is a naturaly way of saying "repeat this ten times" and should be
included as a valid for and while loop argument. But the
for(1 .. $foo)
is a very elegant, intuative of making the loop too. It's always nice
to have options, and, "there's always more than one way to do it".
------------------------------
Date: 19 May 1997 12:57:45 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: idea for new for loop construct
Message-Id: <5lpio9$pu5@lyra.csx.cam.ac.uk>
David Alan Black <dblack@icarus.shu.edu> wrote:
>You can certainly do this, though I don't know whether it's what you
>mean:
>
>for ("hello\n" x 4) { print };
>^D
>hello
>hello
>hello
>hello
And I strongly suspect that isn't what _you_ mean either. Try the variant
for ("hello\n" x 4) { print "X$_" };
and you'll see that the loop is obeyed once. I think you want
for (("hello\n") x 4) { print };
Mike Guy
------------------------------
Date: 19 May 1997 06:19:15 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: inclu-OR in regex
Message-Id: <8caflreh0s.fsf@gadget.cscaper.com>
>>>>> "Ilya" == Ilya Zakharevich <ilya@math.ohio-state.edu> writes:
Ilya> [A complimentary Cc of this posting was sent to Eric Bohlman
Ilya> <ebohlman@netcom.com>],
Ilya> who wrote in article <ebohlmanEACCwF.C4L@netcom.com>:
>> Chipmunk (Ronald.J.Kimball@dartmouth.edu) wrote:
>>
>> : Silly silly silly.
>>
>> : /a/ && /b/ && /c/;
>>
>> <pedantic>That's not a regex.</pedantic>
Ilya> But this is:
Ilya> /^(?=.*a)(?=.*b)(?=.*c)/s;
And this one would be faster:
/^(?=.*?a)(?=.*?b)(?=.*?c)/s;
and is in fact a slight variant of the one found in the exercise
answer in the new Llama (coming out shortly)... the exercise that
triggered this whole thread to begin with!
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 470 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: 19 May 1997 06:16:14 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: Notice to antispammers
Message-Id: <8cbu67eh5t.fsf@gadget.cscaper.com>
>>>>> "Wolfgang" == Wolfgang Schelongowski <skaranyi@LOCALHOST.ruhr.de> writes:
Wolfgang> You might have heard that Tom sometimes visits Europe. Some countries
Wolfgang> who sufferred under the Nazis take a dim view of people making such
Wolfgang> lists. Would you love to see Tom arrested?
Thus once again proving Godwin's law... that any debate on Usenet,
carried on for long enough, will eventually make a reference to
Hitler or Nazis.
Wow. How accurate he is.
(One of the corollaries is that once this has been done, the thread is
no longer useful, and can obviously be kill-filed. <plonk>)
:-)
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 470 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: 19 May 1997 08:27:50 GMT
From: ddougal@concentric.net (David Dougal)
Subject: Pattern matching question
Message-Id: <5lp2u6$drl@chronicle.concentric.net>
The purpose of this code is to find the matches for $game. Once those matches
are found, find out if the game was a win, lose, or tie based on the letter at
the beginning of each string in the array and print the result.
Here is the output: element 1 is t0123456787
found a lost
The output should have been: element 1 is t0123456787
found a tie
$game = "01234";
@array = ("l0132456789","t0123456787","w0134265879");
$count = 0;
while ($count <= 3) {
# were looking for a $game match with w or t or l
if ($array[$count] =~ /^[wtl]$game\d*/) {
# found a match
print ("element $count is $array[$count]\n");
# search for win lose or tie
# match the w character followed by any digits
if ($array[$count] =~ /^w\d*/) {
print ("found a win\n");
# match the l character followed by any digits
} elsif ($array[count] =~ /^l\d*/) {
print ("found a lost\n");
# match the t character followed by any digits
} elsif ($array[count] =~ /^t\d*/) {
print ("found a tie\n");
} else {
print ("no match found\n");
print ("element $count is $array[$count]\n");
}
}
$count++;
}
------------------------------
Date: Mon, 19 May 1997 09:52:39 GMT
From: stephen farrell <stephen+usenet@farrell.org>
To: ddougal@concentric.net (David Dougal)
Subject: Re: Pattern matching question
Message-Id: <87iv0fzt3s.fsf@phaedrus.uchicago.edu>
David> The purpose of this code is to find the matches for
David> $game. Once those matches are found, find out if the game
David> was a win, lose, or tie based on the letter at the
David> beginning of each string in the array and print the result.
David> Here is the output: element 1 is t0123456787 found a lost
David> The output should have been: element 1 is t0123456787 found
David> a tie
Not sure, but do you want something like this?
#!/usr/local/bin/perl
%outcome = (l => "lost", t => "tied", w => "won");
$game = "01234";
@array = ("l02456789","t123456787","w013265879");
@g = split(//, $game);
foreach $o (@array) {
$oc = substr $o, 0, 1;
$tally = substr $o, 1;
print $outcome{$oc} . ":\t";
foreach (@g) {
if ($tally =~ /$_/) {
print $_;
}
}
print "\n";
}
--sf
------------------------------
Date: Mon, 19 May 1997 09:52:24 GMT
From: stephen farrell <stephen+usenet@farrell.org>
Subject: Re: Pattern matching question
Message-Id: <87k9kvzt47.fsf@phaedrus.uchicago.edu>
David> The purpose of this code is to find the matches for
David> $game. Once those matches are found, find out if the game
David> was a win, lose, or tie based on the letter at the
David> beginning of each string in the array and print the result.
David> Here is the output: element 1 is t0123456787 found a lost
David> The output should have been: element 1 is t0123456787 found
David> a tie
Not sure, but do you want something like this?
#!/usr/local/bin/perl
%outcome = (l => "lost", t => "tied", w => "won");
$game = "01234";
@array = ("l02456789","t123456787","w013265879");
@g = split(//, $game);
foreach $o (@array) {
$oc = substr $o, 0, 1;
$tally = substr $o, 1;
print $outcome{$oc} . ":\t";
foreach (@g) {
if ($tally =~ /$_/) {
print $_;
}
}
print "\n";
}
--sf
------------------------------
Date: 19 May 1997 06:27:44 -0700
From: Randal Schwartz <merlyn@stonehenge.com>
To: lloyd@cs.fsu.edu (Justin C Lloyd)
Subject: Re: perl and awk
Message-Id: <8c4tbzegmn.fsf@gadget.cscaper.com>
>>>>> "Justin" == Justin C Lloyd <lloyd@cs.fsu.edu> writes:
Justin> Dennis Marti (marti@netrail.net) wrote:
Justin> :
Justin> : open FILE, filename or die $!;
Justin> : print +(split /\./)[1], "\n" while <FILE>;
Justin> Or how about
Justin> open FP, $filename or die "$filename: $!\n";
Justin> print join "\n", map { (split '\.')[1] } <FP>;
Nope. that'd be missing the final trailing newline (join puts glue
*between* elements, not *after* elements). But you've already got the
basics down:
open FP, $filename or die "$filename: $!\n";
print map { (split '\.')[1]."\n" } <FP>;
However, I'd still prefer the easier-to-read solution (call me
old-fashioned):
open FP yadda yadda yadda :-)
while (<FP>) {
chomp;
my @fields = split /\./;
print "$fields[1]\n";
}
and that's probably how I would leave it for the people that need to
maintain the program after me.
print "Just another Perl hacker," # but not what the media calls "hacker!" :-)
## legal fund: $20,495.69 collected, $182,159.85 spent; just 470 more days
## before I go to *prison* for 90 days; email fund@stonehenge.com for details
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@ora.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: 19 May 1997 06:10:04 GMT
From: Query????
Subject: Re: print variable $abc which consist of '$' in it
Message-Id: <5loqrs$ccl@triton.np.ac.sg>
The variable is read from the lines of a file.
So, how can I print out the variable if, it consist a '$' .
Thanks.
------------------------------
Date: Mon, 19 May 1997 07:01:10 GMT
From: tcyang@netcom.com (Tung-chiang Yang)
Subject: Re: print variable $abc which consist of '$' in it
Message-Id: <tcyangEAF25y.9Gw@netcom.com>
You need to make it clear whether you meant the variable name contains a
'$' or its value contains a '$' for Nathan to help you. It is obviously
easy if you meant the latter.
===============================
Query???? wrote:
: The variable is read from the lines of a file.
: So, how can I print out the variable if, it consist a '$' .
: Thanks.
--
Tung-chiang Yang tcyang@netcom.com
soc.culture.taiwan, soc.culture.china (by SCC FAQ Team) FAQ's:
http://www.clever.net/tcyang/Taiwan_faq.shtml, China_faq.shtml
------------------------------
Date: 19 May 1997 02:13:33 GMT
From: I-hate-cyber-promo@man.ac.uk (A. Deckers)
Subject: Re: print variable $abc which consist of '$' in it
Message-Id: <slrn5nvdqd.ksr.I-hate-cyber-promo@news.rediris.es>
In comp.lang.perl.misc,
Query????? wrote:
>Hi,
>
> how do I print a variable which consist of "$" in it.
You use single quotes, as in your subject:
$foo = 'a$b';
print "$foo\n";
Prints:
a$b
Look up 'quoting' and 'interpolation' in the documentation.
HTH,
Alain
--
Perl information: <URL:http://www.perl.com/perl/>
Perl archive: <URL:http://www.perl.com/CPAN/>
Perl FAQ: <URL:http://www.perl.com/CPAN/doc/FAQs/FAQ/>
>>>>>>>>>>>>> NB: comp.lang.perl.misc is NOT a CGI group <<<<<<<<<<<<<<
------------------------------
Date: Mon, 19 May 1997 09:30:05 GMT
From: stephen farrell <stephen+usenet@farrell.org>
Subject: Re: print variable $abc which consist of '$' in it
Message-Id: <87lo5bzu5e.fsf@phaedrus.uchicago.edu>
>>>>> "A" == A Deckers <I-hate-cyber-promo@man.ac.uk> writes:
A> In comp.lang.perl.misc, Query????? wrote:
>> Hi,
>>
>> how do I print a variable which consist of "$" in it.
A> You use single quotes, as in your subject:
Alternatively, you might need to mix interpolated and non-interpolated
variables, or simply you might need to put a "\n" at the end of the
line. In these cases, you can escape the $, such as
print "\$hi $name\n";
--sf
------------------------------
Date: Mon, 19 May 1997 07:10:23 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: print variable $abc which consist of '$' in it
Message-Id: <fvfpl5.ik.ln@localhost>
Query???? wrote:
: The variable is read from the lines of a file.
: So, how can I print out the variable if, it consist a '$' .
: Thanks.
-----------------
#! /usr/bin/perl -w
while (<DATA>) {
print;
}
__DATA__
$foo
$
-----------------
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: Mon, 19 May 1997 06:35:31 -0700
From: erich@powerwareintl.com (Eric Harley)
Subject: Re: print variable $abc which consist of '$' in it
Message-Id: <erich-1905970635310001@ppp-207-104-16-85.snrf01.pacbell.net>
In article <5loaom$as4@triton.np.ac.sg>, Query????? wrote:
> Hi,
>
> how do I print a variable which consist of "$" in it.
> Any pointers would be appreciated.
>
> Thanks.
when you assign the variable, if its hard coded, then put the string in
single quotes.
$amount = '$123.45';
or
$amount = "\$123.45";
------------------------------
Date: Mon, 19 May 1997 11:14:08 GMT
From: andy@osea.demon.co.uk (Andrew Haveland-Robinson)
Subject: Re: REQ: Perl obfuscator
Message-Id: <33822b5b.171969438@news.demon.co.uk>
On Mon, 19 May 1997 03:20:14 GMT, abigail@fnx.com (Abigail) wrote:
>Djee, you got the Internet for free, you got HTTP for free, you got
>HTML for free, you got CGI for free and you got Perl for free, and
What axe are you grinding? I've got none of these "for free"... you think
20,000 hours of my time is free?
Altruism is a wonderful thing - that's why the Internet is what it is, if it
wasn't, we'd probably not be here, and if we were, we'd be using different
tools.
Those who made them either used them to gain advanced qualifications or had
proper jobs too, or just wanted to change the world, get noticed or have
something to prove. In which case they've got what they wanted.
I've made my living using the Net for the last 8 years and helped to make it
what it is. I have put in what I got out of it, in the old spirit of the thing
and already do enough for free.
>now you are worried a web provider might see your puny cgi-program.
Of course I am, and you should be too.
puny? hmph!
>I guess you want the obfuscator and the upcoming compiler for free too?
If Perl wasn't free I'd be probably be using ActiveX so count your blessings!
I can write an obfuscator, a compiler would be nice, and I would pay for these
to protect thousands of dollars of invested time.
Andy.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Haveland-Robinson Associates, 17 Williams Way, Fleet, Hants, GU13 9EU England.
Tel. +44 (0)1252-811670 Fax +44 (0)1252-811714 Mobile: 0585-052583
Web: http://www.osea.demon.co.uk
------------------------------
Date: Mon, 19 May 1997 14:12:58 +0100
From: Alan Silver <alan-s@consultancy-services*.*com>
Subject: Simple (?) question
Message-Id: <PpkO0MBaHFgzEwGt@consultancy-services.com>
Hi,
I have what I believe is a simple question, but being a bit of a perl
newbie I have not managed to work it out yet.
I have a script (call it "ferret") that I want to call from within a
Perl script. I want to pass it data on stdin and capture the stdout. The
output is to be put onto a web page, so all I really want to do to it is
add <br> tags at the beginning of each line of output.
I guess that I could do this by using file handles, but I'm not
altogether sure how. All of the examples I can see only have data going
one way (ie to the script like open(FERRET,">lp -dps"); or from the
script like open(FERRET,"/etc/sysinfo |"); ). I would like to be able to
send and capture data.
In pseudocode, what I want to do is ...
# some data processing has gone on here, resulting in $ferret containing
# the input for the script
call external_script < $ferret > @ferret;
for ($i=0; $i<+$#ferret)
{
print "<br>$ferret[$i]\n";
}
I hope that this is clear. Any help would be greatly appreciated.
Alan
NOTE - Asterisks may have been added to the e-mail address to discourage
spams. Please remove them before replying.
--
====================================================================
| Sent By : Alan Silver alan@consultancy-services.com |
| |
| Remember - The penalty for bigamy is two wives !! |
====================================================================
------------------------------
Date: 19 May 1997 06:46:33 GMT
From: Simeon Nevel <snevel@nospam.wco.com>
Subject: Re: Small Web DataBase Wanted
Message-Id: <5lot09$6ls$1@news.wco.com>
In comp.lang.perl Michael Lament <umcl1@fang.cs.sunyit.edu> wrote:
> All,
> I am really into designing Web Pages and I have access to a PERL
> Interpreter
> via my CGI-BIN. I am looking to see if anyone has a PERL script that
> would interact
> with a Web Page and act a database. Just a small type of database
> where I can manipulate
> the code for the exact types of fields but I would like to have deletion
> capability.
You might want to check out your nearest CPAN archive for the "Sprite"
module written by Shishir Gundavaram. An example of it's use is in his
book "CGI Programming on eht World Wide Web", Chapter 9.
It's a stores only text data, and has some Oracle type features. The
author says it is OK for DB <5000 records but is too inefficient for
anything bigger than that.
Once you get into the CPAN archive, try the suffix path
../modules/by-authors/Shishir_Gundavaram
HTH
Simeon
------------------------------
Date: Mon, 19 May 1997 12:00:24 -0500
From: Michael Lammon <Michael.C.Lammon@MCI.com>
Subject: Small Web DataBase
Message-Id: <33808728.12AD@fang.cs.sunyit.edu>
All,
I am really into designing Web Pages and I have access to a
PERL
Interpreter
via my CGI-BIN. I am looking to see if anyone has a PERL script that
would interact
with a Web Page and act a database. Just a small type of database
where I can manipulate
the code for the exact types of fields but I would like to have
deletion
capability.
I am hoping some dedicated PERL hacker would have any types of
script
like this
that I could have. This could also be helpful in learning this great
language and
understanding it better.
Well, if you can help , I would appreciate it. Thanks in
advance
Mike
------------------------------
Date: 19 May 1997 11:54:12 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Timing Out While waiting for user input
Message-Id: <5lpf14$mnn@lyra.csx.cam.ac.uk>
I R A Aggie <fl_aggie@hotmail.com> wrote:
>Ordinarily, I'm thrilled to learn something new. In this case:
>
>$ perldoc -f alarm
>Unknown option: f
>perldoc [-h] [-v] [-u] PageName|ModuleName|ProgramName...
> -h Display this help message.
> -t Display pod using pod2text instead of pod2man and nroff.
> -u Display unformatted pod text
> -m Display modules file in its entirety
> -v Verbosely describe what's going on.
>
>[and so on]
>
>Now, do I have an old version of perldoc??
Yes, for some value of "old". The -f option is in Perl5.004.
Mike Guy
------------------------------
Date: 19 May 97 07:52:14 -0500
From: levan@eagle.eku.edu (Jerry LeVan)
Subject: Updated Perl Web Server (mhttpd-0.8)
Message-Id: <1997May19.075214.10032@acs.eku.edu>
Good Day,
I am happy to announce the availability of mhttpd-0.8. Mhttpd is
a WWW server written in Perl 5. The previous release was mhttpd-0.1.
Mhttpd can be "previewd" and obtained at its home site:
<http://eagle.eku.edu:4000/>
After the home page loads (be patient...) click on the perl button.
from this page you can read the docs, pickup the source for the
daemon, or even a complete package. The site is, of course, managed
by mhttpd. Feel free to browse and try out the examples...
Enjoy,
--Jerry LeVan
levan@eagle.eku.edu
<http://eagle.eku.edu:4000/>
Here is a brief preview...
MHTTPD a simple WWW Server for Unix
Release 0.8
Jerry LeVan
Release 0.1 March 22, 1996
Updated to 0.8 May 16,1997
Preliminary Documentation
Mhttpd is a simple perl script that provides most of the functionality of the more
sophiscated WWW servers. It is only about 700 lines of perl code ( plus a bunch
of comments and blank lines..) The total size of the mhttpd file is about 1100 lines.
You can find the latest version of mhttpd running on port 4000 at eagle.eku.edu.
The distribution consists of these files:
1) mhttpd.doc This file.
2) mhttpd.conf A sample configuration file.
3) mhttpd The perl source for the daemon.
4) base64.pl A perl library for base64 encoding/decoding
from Darrin M. Gorski
5) mkpw A perl script useful for constructing password files
6) nph-ps.cgi A shell script that demonstrates server push
7) counter.cgi A perl script that shows how to implement a page counter
8) uploader.cgi A perl script that shows how to upload a file from
NetScape running on a PC/Mac/Unix box. ( Requires CGI.pm).
Some of the features:
---------------------
1) Support both GET, POST and HEAD methods.
2) Will generate directory listings of directories in the "root" tree.
( not done if the directory contains the default document
by default index.html, or the directory is marked as protected.)
3) Individual directories can be protected against directory listings.
4) Supports NCSA and CERN format mapping files for "clickable" images.
The CERN map files will require complete URL's.
5) Supports server executables ( must live in the cgi-bin directory).
(Version 0.8 and above allow cgi's to be anywhere).
6) Supports "Forms".
7) Logs all accesses (also can be configured to use the ident protocol).
8) Has an easy to use IP based scheme to allow/deny access to the server.
9) It is very easy to configure.
10) Mhttpd supports <ISINDEX> directives.
11) Mhttpd has limited support for "nph" scripts.
12) Mhttpd can be configured to do "cgi-anywhere" ie scripts do not
have to reside in the cgi-bin directory.
13) Mhttpd can be configured to use "Basic Authentication". This will
allow password controlled access to directory subtress of the
overall server tree, the cgi-bin directory can also be protected.
14) Mhttpd can be configured to allow server side includes and executables.
Server side includes can be recursive.
15) Mhttpd runs all of the Examples distributed with the CGI.pm library.
------------------------------
Date: Mon, 19 May 1997 15:04:53 -0500
From: Darin Burleigh <burleigh@hackberry.chem.niu.edu>
Subject: Weird warning
Message-Id: <3380B265.68CD@hackberry.chem.niu.edu>
I think this is a Perl question, but perhaps its a CGI
question.
My CGI script uses the Brenner's cgi-lib.pl. In that script
are the lines:
# Disable warnings as this code deliberately uses local and
environment
# variables which are preset to undef (i.e., not explicitly
initialized)
$perlwarn = $^W;
$^W = 0;
My script (in perl) uses the -w flag (who doesn't?).
When the script is run, I get the warning message:
>Use of uninitialized value at /path/to/server/cgi-bin/cgi-lib.pl line
68.
line 68 is $^W = 0; above. How could that be? what's going on?
My script is suid; is that related?
--
==========================================================
- darin
burleigh@hackberry.chem.niu.edu
\\//\\//.\\//\\//.\\//\\//. http://hackberry.chem.niu.edu/HOME/dcb/
'2 kinds of green, look out!' - dieter rot
------------------------------
Date: 19 May 1997 11:09:51 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: What is the context of $a->m1 in $a->m1->m2 ?
Message-Id: <5lpcdv$kgs@lyra.csx.cam.ac.uk>
In article <5l340j$c9t@shoga.wwa.com>, Tushar Samant <scribble@wwa.com> wrote:
>I would like to make constructions like $a->m1->m2.
>
>My thinking went like this: for "->m2" to work in the above,
>$a->m1 would have to return a package or object reference.
>Which means, the "->m2" expects a scalar. So, in particular,
>it's enough for the "m1" method to return the proper object
>IN A SCALAR CONTEXT.
>
>But this did not work (5.003).
Thanks for the bug report; this is mended in Perl 5.004.
Mike Guy
------------------------------
Date: 19 May 1997 16:58:54 GMT
From: shark7@best.com (Timothy Stark)
Subject: Which best one for extension and embeddings?
Message-Id: <5lq0se$c9p$1@nntp1.ba.best.com>
Hi Folks:
I have a queston for you about three script interpreters (Perl,
Python, and TCL/TK). Which is the best one for implementing it into my
application to extend it itself? Also which one supports both extension
and embedding? I heard that Xircon and Eggdrop have TCL extensions. If
so, Which is the best for learning how to program scripts, implement
extensions and embeddings with my application? Praticial TCL/TK
Programming? I would appreciate that. Thank you!
-- Tim Stark
--
Timothy Stark <>< Inet: shark7@best.com, TimStark@AOL.com
Arlington, Va. TTY: (703) 418-1483 FAX: (703) 418-1484
--------------------------------------------------------------------------
"For God so loved the world, that he gave his only begotten Son, that
whosoever believeth in him should not perish, but have everlasting life.
Amen." -- John 3:16 (King James Version Bible)
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 498
*************************************