[11616] in Perl-Users-Digest
Perl-Users Digest, Issue: 5215 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Mar 24 13:07:24 1999
Date: Wed, 24 Mar 99 10:00:26 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 24 Mar 1999 Volume: 8 Number: 5215
Today's topics:
Re: << string definer (Mike Wescott)
Re: << string definer <ebohlman@netcom.com>
Re: << string definer <cassell@mail.cor.epa.gov>
Re: C function in Perl <aqumsieh@matrox.com>
Re: Can i do tcp/ip programming on NT platforms? <zenin@bawdycaste.org>
Re: Do you know how to install perl on a win95 system? (Cameron Laird)
Re: File Length And Truncating <aqumsieh@matrox.com>
Getting the return value <sdatta@lucent.com>
Re: Getting the return value <Tony.Curtis@vcpc.univie.ac.at>
Re: Getting the return value <dwatanab@uci.edu>
Help with DBI and DBD::Oracle <burchd@erols.com>
How can I send Cookie to a browser with ssi command. <grieco@netvision.net.il>
Re: I have a question about a search script> <jglascoe@giss.nasa.gov>
initialization <zlhu@iastate.edu>
Re: initialization (Larry Rosler)
Re: MSQL problem with select <jeromeo@atrieva.com>
Re: Need username in Perl script (John Dilley)
Re: newbe: to find the highest entry in group (Tad McClellan)
Re: Newbie to Perl (Larry Rosler)
Re: Newbie to Perl (Bart Lateur)
Re: Newbie to Perl <ebohlman@netcom.com>
Re: Newbie to Perl (Jonathan Stowe)
Re: Odd/Even <droby@copyright.com>
Re: Odd/Even (Larry Rosler)
Re: Passing parameters (CGI) <wmwilson1@go.com>
Re: Perl Books (was Re: << string definer) <dhenders@cpsgroup.com>
Re: Perl Books (was Re: << string definer) <cassell@mail.cor.epa.gov>
Perl Conference 3.0 in Monterey, California, Aug. 21-24 (John Robson)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 24 Mar 1999 11:09:17 -0500
From: wescott@cygnus.ColumbiaSC.NCR.COM (Mike Wescott)
Subject: Re: << string definer
Message-Id: <x47ls6yimq.fsf@cygnus.ColumbiaSC.NCR.COM>
In article <7d9j4m$h12$1@nitrogen.mankato.msus.edu> Timothy Larson writes:
[...]
> use Time::localtime;
> use Time::Local;
> $s = <<END
> This is my string.
> END
> print "$s\n";
[...]
> So, any ideas why this simple thing should not work?
I didn't see it right away either. Hint: where is the end of the assignment
statement?
Neither way of terminating that statement seems quite right, aesthetically.
--
-Mike Wescott
mike.wescott@ColumbiaSC.NCR.COM
------------------------------
Date: Wed, 24 Mar 1999 16:24:12 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: << string definer
Message-Id: <ebohlmanF93xKC.MME@netcom.com>
I R A Aggie <fl_aggie@thepentagon.com> wrote:
: There *is* a situation where not having the ; doesn't cause problems: at
: the end of a block. Consider:
[snip]
: This is probably because the interpreter uses the curly brackets to
: determine how far to parse. That may explain why occasionally that
: syntax would work for you.
Actually, it's because Perl uses semicolons as statement *separators*
(ala Pascal) rather than statement *terminators* (ala C). A semicolon is
only needed between statements, and the end of a block isn't a statement.
------------------------------
Date: Wed, 24 Mar 1999 09:33:16 -0800
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
To: Timothy Larson <larsot2@krypton.mankato.msus.edu>
Subject: Re: << string definer
Message-Id: <36F921DC.5674554D@mail.cor.epa.gov>
Timothy Larson wrote:
> [a bit of a snip to get to the crux of the biscuit]
>
> print <<ENDOFJUNK;
> Top of the world ma!
> ENDOFJUNK
>
> works. All my other examples didn't use a ; either and that was my problem.
> Maybe there is something about different versions requiring a ; and others
> not? *sigh* Thanks everyone.
I just want to clarify one tiny point. The difference is syntax, not version.
Here docs have worked the same in Perl since I've been piddling^Wprogramming
with it. There are special cases where you can manage without the semicolon,
as a number of posters have said. But they are special cases, not changes in
Perls' handling of code. Unlike some languages I could name, Perl has been
remarkably consistent about this.
David
--
David L. Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Wed, 24 Mar 1999 10:05:15 -0500
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: C function in Perl
Message-Id: <x3yhfrb6i8k.fsf@tigre.matrox.com>
"yue xu" <xum@psi.com> writes:
> Does anyone know how to integrate a C function into
> Perl? i.e. if I have a function doing shell sort, how can
> I make it available in PERL (not mean make it a executable
> and do system)?
Read the following docs:
perlcall
perlxs
perlembed
HTH,
Ala
------------------------------
Date: 24 Mar 1999 16:33:01 GMT
From: Zenin <zenin@bawdycaste.org>
Subject: Re: Can i do tcp/ip programming on NT platforms?
Message-Id: <922293216.906364@thrush.omix.com>
Jrgen Ibelgaufts <ibelgaufts@gfc-net.de> wrote:
: well you *can* write fancy stuff with sockets on NT.
Sure, and you can write fancy socket code in Java too. :-P
: I wrote a webserver
Most web servers don't do anything fancy with sockets.
: that can show directories
Like I said. :-)
: and process cgi calls (as perl modules).
eval() is not a socket call, ya know.
--
-Zenin (zenin@archive.rhps.org)
Yah, Emacs is a good OS, but I prefer FreeBSD.
------------------------------
Date: 24 Mar 1999 10:33:23 -0600
From: claird@Starbase.NeoSoft.COM (Cameron Laird)
Subject: Re: Do you know how to install perl on a win95 system?
Message-Id: <7db44j$s1e$1@Starbase.NeoSoft.COM>
In article <7d37k3$8aj@sjx-ixn9.ix.netcom.com>,
Andri Bell [aka Andre Bell] <andre_perl@ONE-CLICK.COM> wrote:
>In article <1a3J2.5$ay6.15@weber.videotron.net>, "S.Faust" <sfaust@isi-mtl.com> wrote:
>>http://www.ActiveState.com/
>>
>>click the install and that is it
>
>Thanks,
>I did that and it wasn't enough. I'm gettting errors that chmod is an invalid
>command. Is chmod a separate executable file? If so then that is my problem,
>I'm running win95 not unix and I need to download chmod some place. If chmod
>is part of an operating system (like command-line "delete" is part of DOS
>command.com) maybe I need to get that operating system(?).
>
>I don't know, I'm guessing of course. Maybe this will be resolved when I
>download the perl file from activestate as was suggested. I'll know within the
>next few minutes when I install api...exe.
>
>Thanks again.
It sounds as though you might have an OK
installation of Perl, but your scripts or
applications are platform-specific. What
do you do to "get errors that chmod is an
invalid command"? What's the precise
diagnostic?
--
Cameron Laird http://starbase.neosoft.com/~claird/home.html
claird@NeoSoft.com +1 281 996 8546 FAX
------------------------------
Date: Wed, 24 Mar 1999 11:11:05 -0500
From: Ala Qumsieh <aqumsieh@matrox.com>
Subject: Re: File Length And Truncating
Message-Id: <x3yemme7tra.fsf@tigre.matrox.com>
"David J Whalen-Robinson" <davidrn@pobox.com> writes:
> I want to truncate a file to a shorter length WHILE it is open.
> I think there is a way to do this but I forget how.
Did you search for "truncate" in the docs? If you didn't, then why
didn't you? It's just a few keystrokes away and takes much less time
than posting and waiting for an answer.
perldoc -f truncate
------------------------------
Date: Wed, 24 Mar 1999 11:00:30 -0600
From: Sujay Datta <sdatta@lucent.com>
Subject: Getting the return value
Message-Id: <36F91A2E.1F95F223@lucent.com>
I want to get the output of a shell command
as well as the return value. How do I get both.
Help is appreciated.
Sujay
------------------------------
Date: 24 Mar 1999 18:08:16 +0100
From: Tony Curtis <Tony.Curtis@vcpc.univie.ac.at>
Subject: Re: Getting the return value
Message-Id: <8390cmlssf.fsf@vcpc.univie.ac.at>
Re: Getting the return value, Sujay
<sdatta@lucent.com> said:
Sujay> I want to get the output of a shell command
Sujay> as well as the return value. How do I get
Sujay> both.
perldoc perlipc
hth
tony
--
Tony Curtis, Systems Manager, VCPC, | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien. | <URI:http://www.vcpc.univie.ac.at/>
"You see? You see? Your stupid minds! | private email:
Stupid! Stupid!" ~ Eros, Plan9 fOS.| <URI:mailto:tony_curtis32@hotmail.com>
------------------------------
Date: Wed, 24 Mar 1999 09:26:51 -0800
From: =?iso-8859-1?Q?d=E1na?= watanabe <dwatanab@uci.edu>
Subject: Re: Getting the return value
Message-Id: <36F91FA2.4975A312@uci.edu>
chomp (my $output = `date`);
my $return = $?;
print "output=$output\n";
print "return=$return\n";
prints
output=Wed Mar 24 09:19:48 PST 1999
return=0
"$? The status returned by the last `...` command, pipe close or system
operator "
(Perl 5 Desktop Reference)
Sujay Datta wrote:
>
> I want to get the output of a shell command
> as well as the return value. How do I get both.
> Help is appreciated.
> Sujay
------------------------------
Date: Wed, 24 Mar 1999 11:48:13 -0500
From: David Burch <burchd@erols.com>
Subject: Help with DBI and DBD::Oracle
Message-Id: <36F9174D.8F89C338@erols.com>
Hello everyone:
I have built both DBI and DBD::Oracle on a Solaris system. I can
connect,
select and update except with CLOB datatypes. I have scoured the POD
documentation in the modules, the README.longs file, Alligator Descartes
FAQ's, and archives of this group on the web and found questions on how
to
access CLOB datatypes but no answers. If I have overlooked something
important please let me know.
I have enclosed my database table description as well as a sample perl
program that I am using. A plain select on the CLOB returns 80
characters
of it and I tried using the bind_param method to specify the type as
CLOB,
but I get no data at all returned that way.
Again, I would appreciate any and all help including pointers to
documentation concerning using DBI/DBD::Oracle with CLOBS.
------------------------------------------------------------------
This is what the cfr42 table I am using looks like.
I am trying to return the contents of the DOC_TEXT CLOB field.
------------------------------------------------------------------
SQL> desc cfr42
Name Null? Type
----------------------------------------- -------- --------------
DOC_ID NOT NULL VARCHAR2(50)
BNA_SERVICE VARCHAR2(50)
DOC_TITLE VARCHAR2(500)
DOC_SIZE NUMBER
DOC_TEXT CLOB
------------------------------------------------------------------
This is a sample program with comments about what works
and what doesn't
------------------------------------------------------------------
#!/usr/local/bin/perl
use lib '/home/myuser/oracle/lib/perl5/site_perl';
use DBD::Oracle qw(:ora_types);
use DBI;
my $dbh = DBI->connect ('webdb', 'USER', 'PASSWORD', 'Oracle');
die "Can't connect to database: $DBI::errstr\n" unless $dbh;
# The next line works but only returns the first row
# $sth = $dbh->prepare(q{ SELECT DOC_TEXT FROM CFR42 }) or
# die "Can't prepare statement: $DBI::errstr\n";
# The next two commands return no errors but no results either
$sth = $dbh->prepare( q{ SELECT ? FROM CFR42 } ) or
die "Can't prepare statement: $DBI::errstr\n";
$sth->bind_param('1', 'DOC_TEXT', { ora_type => ORA_CLOB });
$sth->execute;
my @row;
while ( @row = $sth->fetchrow )
{
print "Row returned: @row\n";
}
$sth->finish;
$dbh->disconnect;
------------------------------------------------------------------
That's it--thanks in advance for your help.
David Burch
burchd@erols.com
------------------------------
Date: Wed, 24 Mar 1999 18:22:57 -0000
From: "Fred Grieco" <grieco@netvision.net.il>
Subject: How can I send Cookie to a browser with ssi command.
Message-Id: <7db3iq$dgg$1@news.netvision.net.il>
I have a question : How can I send Cookie to a browser with ssi command.
My command is :
<!--#exec cgi="/cgi-bin/bantry.cgi" -->
in my shtml page and doesn't set cookie to browser.
This cgi is setting the cookies if I make a direct link from the page
<a href=/cgi-bin/bantry.cgi>
I think I have to redirect the HTTP header to the Client in place of the
SSI-process.
What is the Perl command or wich environment variable have I to force ?
Thank you.
Fred
------------------------------
Date: Wed, 24 Mar 1999 12:06:11 -0500
From: Jay Glascoe <jglascoe@giss.nasa.gov>
To: Rollo Lawson <rollo@enter.net>, rollo_lawson@yahoo.com
Subject: Re: I have a question about a search script>
Message-Id: <36F91B83.1822D650@giss.nasa.gov>
[courtesy copy of post sent to cited author]
Rollo Lawson wrote:
>
> #!/perl/bin/perl
A "use strict;" would be nice here. IMHO, lexical scoping,
"my declarations" elevate Perl from a mere super-shell to a true,
general-purpose programming language. YMMV.
> #Marc's Search.pl
> read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
> @pairs=split(/&/, $buffer);
uh-oh, someone's going to give you grief about "reinventing the wheel"...
> #Split the Values
> foreach $pair (@pairs)
> {
> ($name,$value)=split(/=/,$pair);
> $value =~tr/+/ /;
> $value =~s/%(..)/pack("C",hex($1))/eg;
> $FORM{$name}=$value;
> }
> $i=0;
> foreach $file (</apache/htdocs/*.htm>)
> {
> print $file;
> open(HTML, $file);
> undef $/;
undef local $/; # localize the change to "$/"; don't mess up other code
> $body=<HTML>;
>
> $/="\n";
> close(HTML);
> if ($body=~/$FORM{key}/i)
> {
my ($title) = ($body =~ m#<TITLE>(.+?)</TITLE>#is);
> push(@doclist, $file);
push(@doclist, [$file, $title]);
> }
> }
>
> print "Content-type: text/html\n\n";
> print "<HTML>\n<HEAD>\n<TITLE>Your Search results</TITLE></HEAD>\n";
> print "<BODY><CENTER><H1>Your Search Results</H1></CENTER>\n<HR><P>\n";
> print "The following documents contain the word: <B>$FORM{key}</B>\n<P>\n";
>
> print "<UL>\n";
> print "Hello World";
print << "NARF!";
Content-type: text/html\n\n
<HTML>\n<HEAD>\n<TITLE>Your Search results</TITLE></HEAD>
[... etc ...]
Hello World
NARF!
>
> foreach $name (@doclist){
foreach $pair (@doclist){
my ($name, $title) = @$pair;
>
> print "<LI><a href=\"$name\">$name</a>\n";
print qq{<LI>$title: <a href="$name">$name</a>\n};
>
> }
> print "</UL>\n";
> print "</BODY>\n</HTML>\n";
Jay Glascoe
--
"... the whole documentation is not unreasonably
transportable in a student's briefcase."
-- John Lions describing UNIX 6th Edition
"This has since been fixed in recent versions."
-- Kernighan & Pike
------------------------------
Date: Wed, 24 Mar 1999 09:52:34 -0600
From: Zhiliang Hu <zlhu@iastate.edu>
Subject: initialization
Message-Id: <36F90A41.54DDE148@iastate.edu>
Thanks to all who took time to solve my confusion!
Here is another confusion, probably a better one :)
I have a few working CGI scripts. They are working, but I always
observe complains in the error log:
"Use of uninitialized value at" lines such as:
1. read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
2. $ENV{REMOTE_HOST};
3. ($name,$value)=split(/:/,$pair);
4. ($term1, $term2, $term3, $term4, $term5) = split(/\s+/,
$FORM{terms});
and so on. I wonder is it a standard requirement in perl to
"initialize" them such as:
$buffer = $buffer;
$ENV{'CONTENT_LENGTH'} = $ENV{'CONTENT_LENGTH'};
$ENV{REMOTE_HOST} =$ENV{REMOTE_HOST};
... ...
?
Well, then how should I initialize "$name", $value", "term1 .... term5"
in the above example?
Zhiliang
------------------------------
Date: Wed, 24 Mar 1999 09:11:29 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: initialization
Message-Id: <MPG.1162bc9fc3b2cae9897b3@nntp.hpl.hp.com>
[Posted and a courtesy copy sent.]
In article <36F90A41.54DDE148@iastate.edu> on Wed, 24 Mar 1999 09:52:34
-0600, Zhiliang Hu <zlhu@iastate.edu >says...
...
> I have a few working CGI scripts. They are working, but I always
> observe complains in the error log:
>
> "Use of uninitialized value at" lines such as:
...
> and so on. I wonder is it a standard requirement in perl to
> "initialize" them such as:
>
> $buffer = $buffer;
> $ENV{'CONTENT_LENGTH'} = $ENV{'CONTENT_LENGTH'};
> $ENV{REMOTE_HOST} =$ENV{REMOTE_HOST};
> ... ...
> ?
>
> Well, then how should I initialize "$name", $value", "term1 .... term5"
> in the above example?
>From perldiag:
Use of uninitialized value
(W) An undefined value was used as if it were already defined. It
was interpreted as a ``'' or a 0, but maybe it was a mistake. To
suppress this warning assign an initial value to your variables.
***
Considering how important and frequent it is, this diagnostic is
surprisingly sloppily worded. It confuses 'uninitialized' and
'undefined'. It should be titled 'Use of undefined value' (as in the
first sentence). And the last sentence should say 'assign a defined
value to your variables'.
So, to answer your question, assigning an undefined value to a variable
does not 'initialize' it or suppress this warning.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personl/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 24 Mar 1999 08:45:38 -0800
From: Jerome O'Neil <jeromeo@atrieva.com>
To: cliff@scs.uiuc.edu
Subject: Re: MSQL problem with select
Message-Id: <36F916B2.6211E5DF@atrieva.com>
Clifford Meece wrote:
> Now when I try to call an equivalent routine from perl:
>
> $acct="1111022";
> $proj="00";
> $sth=$dbh->prepare(q{SELECT * FROM accounts WHERE (acctNum = '$acct'
> AND subAcct = $proj)});
> $sth->execute;
>
> I get :
>
> DBD::mSQL::st execute failed: parse error at line 1 near "= $" at
> bin/populate_accounts2.pl line 41, <ACCTS> chunk 1.
Look at how you are quoting your SQL statement:
q{SELECT * FROM accounts WHERE (acctNum = '$acct' AND subAcct = $proj)}
And ask yourself "Why doesn't this interpolate?"
Hint: See the Quote and Quote-like operators section of perlop.
> Any Ideas?
qq?
Good Luck!
--
Jerome O'Neil, Operations and Information Services
Atrieva Corporation, 600 University St., Ste. 911, Seattle, WA 98101
jeromeo@atrieva.com - Voice:206/749-2947
The Atrieva Service: Safe and Easy Online Backup http://www.atrieva.com
------------------------------
Date: Wed, 24 Mar 1999 17:33:58 GMT
From: john@deletethisdilley.com (John Dilley)
Subject: Re: Need username in Perl script
Message-Id: <36f92175.46752855@news.jps.net>
No, I did a search on 'auth' looking for anything to do with authentication
schemes. Lot's of authoring sites but none on authentication. I'll do a search
on WWW and see if anything makes sense.
JohnD
abigail@fnx.com (Abigail) wrote:
>
>You have 35k groups with www in the name?
>
>Abigail
------------------------------
Date: Wed, 24 Mar 1999 06:08:59 -0500
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: newbe: to find the highest entry in group
Message-Id: <b4had7.1v2.ln@magna.metronet.com>
jas888@my-dejanews.com wrote:
: I'd to find out the way to look for the highest entry in a group with a text
: For example, "things1,4" is capture for "things1" group and
: "data5,3" is capture for "data5" group
-------------------------
#!/usr/bin/perl -w
use strict;
my %highest; # key = group value = highest count for that group
while (<DATA>) {
chomp;
my($group, $count) = split /,/, $_, 2;
if (exists $highest{$group})
{ $highest{$group} = $count if $count > $highest{$group} }
else
{ $highest{$group} = $count } # first one seen for this group
}
foreach my $group (sort keys %highest) {
printf "$group,$highest{$group}\n";
}
__DATA__
things1,2
things1,3
things1,4
data5,2
data5,3
-------------------------
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 24 Mar 1999 08:01:38 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Newbie to Perl
Message-Id: <MPG.1162ac3be21b16b89897b2@nntp.hpl.hp.com>
[Posted and a courtesy copy sent.]
In article <36F8F57F.C6BA431B@alcatel.fr> on Wed, 24 Mar 1999 15:23:59
+0100, Olivier Henrot <olivier.henrot@alcatel.fr >says...
...
> > #!/usr/bin/perl => should be something like #!c:\\perl\\bin\\perl.exe with Win32 or whatever your perl path is or just #!perl.exe and add the path to perl.exe to your autoexec.bat
> #!/usr/bin/perl is an unix thing
WRONG! ActivePerl ignores the filename part of the #! line. And what's
wrong with your newsreader's line wrapping?
> > $GUESTBOOKFILE = "./guestbookfile.txt";
>
> => should be ".\\guestbbokfile.txt"; with Win32
> / is an unix separator
> \ is a windows one and since it's an escape character to perl you
> must double it...
WRONG! '/' works perfectly well and is preferable.
> just took a quick glance at your program, there might be others "unix"
> things you'll have to change.
RIGHT! They have to do with file locking. flock() is not implemented
on Windows 95.
> hope that helps a little.
Not even one little bit.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personl/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 24 Mar 1999 16:09:25 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Newbie to Perl
Message-Id: <36fa0dec.697492@news.skynet.be>
Olivier Henrot wrote:
>
>> $GUESTBOOKFILE = "./guestbookfile.txt";
>
>=> should be ".\\guestbbokfile.txt"; with Win32
> / is an unix separator
> \ is a windows one and since it's an escape character to perl you
>must double it...
Nope. A single '/' works on all PC Perls I've tried. Double backslashes
don't really hurt, though.
Bart.
------------------------------
Date: Wed, 24 Mar 1999 16:37:27 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Newbie to Perl
Message-Id: <ebohlmanF93y6F.69@netcom.com>
Olivier Henrot <olivier.henrot@alcatel.fr> wrote:
: > $GUESTBOOKFILE = "./guestbookfile.txt";
: => should be ".\\guestbbokfile.txt"; with Win32
: / is an unix separator
: \ is a windows one and since it's an escape character to perl you
: must double it...
Actually, the Win32 filesystem is perfectly happy with forward slashes as
path separators. The only time you need to use backslashes instead is
when you're passing commands to the shell.
------------------------------
Date: Wed, 24 Mar 1999 17:11:25 GMT
From: gellyfish@gellyfish.com (Jonathan Stowe)
Subject: Re: Newbie to Perl
Message-Id: <36f91c15.29839548@news.dircon.co.uk>
On Wed, 24 Mar 1999 15:23:59 +0100, Olivier Henrot
<olivier.henrot@alcatel.fr> wrote:
>> message - Sorry, an error ocurred: unable to open guestbook file,
>> showed. However, the "Thank you, so-and-so, for signing the guestbook"
>> message was displayed.
>
>> I'm using Win95 and running ActivePerl5.005. Also had the CGI.pm
>> installed. Looking at the proggie, I suspect the POSIX module must be
>> missing (just guessing). If indeed, where to get one? Are not all the
>> exotic modules package into the latest build of ActivePerl? Please
>> enlighten this confused guy. Thanks.
>>
>> Here's the proggie:
>>
>> #!/usr/bin/perl => should be something like #!c:\\perl\\bin\\perl.exe with Win32 or whatever your perl path is or just #!perl.exe and add the path to perl.exe to your autoexec.bat
> #!/usr/bin/perl is an unix thing
>
>
>> $GUESTBOOKFILE = "./guestbookfile.txt";
>
>=> should be ".\\guestbbokfile.txt"; with Win32
> / is an unix separator
> \ is a windows one and since it's an escape character to perl you
>must double it...
>
No the slashes are a red herring. The underlying libraries for
windows dont care - its only the command interpreter that does ... but
of course this gets said some ten thousand times a week ...
/J\
------------------------------
Date: Wed, 24 Mar 1999 16:54:11 GMT
From: Don Roby <droby@copyright.com>
Subject: Re: Odd/Even
Message-Id: <7db5bc$cl0$1@nnrp1.dejanews.com>
In article <comdog-ya02408000R2303991340210001@news.panix.com>,
comdog@computerdog.com (brian d foy) wrote:
> In article <MPG.1160eac437e94b479897ab@nntp.hpl.hp.com>, lr@hpl.hp.com (Larry
Rosler) posted:
>
> > In article <1dp3gkr.na65rqq8sztsN@p57.block2.tc3.state.ma.tiac.com> on
> > Tue, 23 Mar 1999 01:18:52 -0500, Ronald J Kimball
> > <rjk@linguist.dartmouth.edu >says...
> > > Gabriel Richards <grichard@uci.edu> wrote:
> > >
> > > > if ($counter = [an odd number]) {do x}
> > >
> > > if ($counter & 1) {do x}
> >
> > That may be 'high-school' level (because it deals with binary
> > representations).
> >
> > if ($counter % 2) {do x}
> >
> > is 'elementary-school' level (because it deals with arithmetic).
> >
> > The '&' is perhaps 5% faster, though.
>
> i don't know if i like that characterization. i don't think that
> knowing the number's native representation represents a more
> advanced thinking. the % operator should work despite the
> underlying representation, and as such is a more abstract way of
> thinking, which puts it at the "university" level, perhaps ;)
>
No no no! Fields and rings are "university" level.
We learn what numbers basically mean abstractly long before we learn about
internal computer representations. But then, we abstract in ever-more obtuse
ways afterward, eventually talking about things like "sheaves of germs of
holomorphic functions on an analytic variety", and completely losing touch
with anything resembling the visible world.
> i don't think a 5% speed improvement on a single op that represents
> an insignificantly small portion of the overall program is worth
> the loss of clarity. in machine langauge, they would look the same,
> so why not be more expressive in the higher level langauge, which
> is higher level by design ;)
>
Actually, there's more than one way to do it in machine language too. And
some are clearer than others and some are more efficient than others.
The importance of this efficiency of course depends on the frequency of
looping around this single op. But I agree in principle that the operators
that deal with numbers as numbers are more aesthetically pleasing than those
tied to internal representation. I mean, what if we want to port our code to
a ternary machine? ;-)
Excuse me while I climb back into my straitjacket again.
--
Don Roby
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 24 Mar 1999 09:39:28 -0800
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Odd/Even
Message-Id: <MPG.1162c325468f27289897b4@nntp.hpl.hp.com>
In article <7db5bc$cl0$1@nnrp1.dejanews.com> on Wed, 24 Mar 1999
16:54:11 GMT, Don Roby <droby@copyright.com >says...
...
> But I agree in principle that the operators
> that deal with numbers as numbers are more aesthetically pleasing than those
> tied to internal representation.
That is why I posted an arithmetic operation (modulus) in the first
place, not a bitwise operation (and).
> I mean, what if we want to port our code to
> a ternary machine? ;-)
One doesn't have to go that far. There *were* machines that used ones-
complement binary representation for negative numbers. On such a
machine, the number -1 (~1, not ~0) would be *even* using a bitwise
operation on natively-represented integers.
I think that 32-bit twos-complement binary representation is so
ingrained in Perl that the compiler would have to simulate that
representation on any hardware, no matter what the native machine
representation of an integer might be.
--
(Just Another Larry) Rosler
Hewlett-Packard Company
http://www.hpl.hp.com/personl/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 24 Mar 1999 16:40:49 GMT
From: Mike Wilson <wmwilson1@go.com>
Subject: Re: Passing parameters (CGI)
Message-Id: <7db4ie$bvj$1@nnrp1.dejanews.com>
In article <comdog-ya02408000R2303991648590001@news.panix.com>,
comdog@computerdog.com (brian d foy) wrote:
> # Some people want to have their cake and eat it too!
> # Uncomment this line to have the contents of the query string
> # APPENDED to the POST data.
> # $query_string .= (length($query_string) ? '&' : '') .
$ENV{'QUERY_STRING'} if defined $ENV{'QUERY_STRING'};
>
> you need to uncomment that line, as i have :) for 2.42, that's line
> 398.
>
> personally, i think this should be the default behaviour. otherwise
> you can get to the query string through the query_string() method.
>
You were right on target with this, thanks very much. This one has kept me
stumped for days, needless to say, I agree that this should be the default.
> --
> brian d foy
> CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 24 Mar 1999 10:14:25 -0600
From: Dale Henderson <dhenders@cpsgroup.com>
Subject: Re: Perl Books (was Re: << string definer)
Message-Id: <87yakmdfvi.fsf@camel.cpsgroup.com>
>>>>> "Scratchie" == Scratchie <upsetter@ziplink.net> writes:
Scratchie> Timothy Larson <larsot2@krypton.mankato.msus.edu>
Scratchie> wrote: : In _Teach Yourself Perl in 21 Days_ I found a
Scratchie> neat use of << to define : multiline strings.
Scratchie> This is the second time I've seen this book mentioned
Scratchie> today. Is it getting remaindered somewhere?
Scratchie> Here is a critical review of the book in question:
Scratchie> http://xenu.phys.uit.no/~tom/TYP21D.html
It seems like I saw a list of reviews by Tom Christiansen on
www.perl.org; however, I can't find them now. It also seems that
Tom didn't like this book either. (Not sure).
--
Dale Henderson <mailto:dhenders@cpsgroup.com>
"Imaginary universes are so much more beautiful than this stupidly-
constructed 'real' one..." -- G. H. Hardy
------------------------------
Date: Wed, 24 Mar 1999 09:03:03 -0800
From: "David L. Cassell" <cassell@mail.cor.epa.gov>
Subject: Re: Perl Books (was Re: << string definer)
Message-Id: <36F91AC7.C9B4ED22@mail.cor.epa.gov>
Scratchie wrote:
>
> Michael Kersey <mkersey@metricom.com> wrote:
> : I read the first edition of the book "Teach Yourself CGI Programming with
> : Perl 5 in 7 Days" by Eric Hermann. I was initially confused by the
> : presentation order, but it was clear that the author _did_ understand the
> : subject matter. However, the presentation order was so distracting that I
> : spent considerable effort attempting to understand it.
>
> I was disturbed by the fact that some code examples had typos and some
> were missing important lines. I must have spent a half hour trying to find
> where "$mailprog" was defined in one script before I realized that he
> hadn't included that line in the code listing. Since the script in
> question was a freely-available form-to-email script, that didn't say much
> about Mr. Herrmann's understanding of the material.
>
> When the book initially went from "Perl" to "Perl 5", the publishers
> added a bunch
> of
> command-line perl tutorials at the end of each chapter, but none of the
> primary content of the book (the CGI material) even mentioned a single
> function or ability of Perl 5 (as opposed to Perl 4). The only mention of
> CGI.pm was a chapter that simply quoted Lincoln' Stein's documentation in
> toto.
>
> The Perl tutorials themselves were completely unrelated to any of the Perl
> in the rest of the book, so you might be seeing perl constructs in the CGI
> section of, say, Chapter 3 when that piece of perl didn't appear in the
> perl tutorial section until Chapter 9.
>
> The book has a lot of examples on how to accomplish specific things, (many
> of which are unrelated to Perl or CGI, such as image maps and SSI) but the
> book struck me as pretty light on providing the sort of foundation of
> knowledge you need to build upon if you're going to create new apps
> unrelated to the examples in the book. The book seemed to be aimed towards
> consultants who need to cut and paste something together to give someone a
> guest book and an email response form.
Nice book. Can't say I'm surprised, since SamsNet has this kind of rep.
Their C books tend to be so DOS-centric that they actually recommend things
that violate the ANSI standard. Maybe you should submit this book review to
tchrist for inclusion on his book-review page at perl.org .
David
--
David L. Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: 24 Mar 1999 16:45:13 GMT
From: as646@FreeNet.Carleton.CA (John Robson)
Subject: Perl Conference 3.0 in Monterey, California, Aug. 21-24
Message-Id: <7db4qp$sqf@freenet-news.carleton.ca>
Hi, I'm from Canada and I'm thinking of going to the Perl Conference 3.0 in
Monterey, California between August 21-24. I'm a Perl enthusiast, not an
expert, but that's ok and that's what I like about Perl ... you don't have
to know everything to enjoy programming in it and to accomplish much and
still be lazy :) ... I like its rebellious but accepting attitude! Anyway,
Some friends and I are planning a three-week vacation on the West Coast
which may include the Conference on our itinerary. This year, Linux and the
Open Source community will be there too.
Have you attended past Perl Conferences and what do you think of it? How
much does it cost and do you think it's worth your money and time? What
kind of folks do you find there? Did you learn much?
If you live in Monterey, California, where is the cheapest place (cheap
but decent!) for me to stay? If you are a Canadian like me and you are
planning to go, let me know so maybe we can meet or hang out at the
Conference.
I'm interested to hear your personal experiences on Perl Conferences. And
if you know of any other Perl, Linux, Internet/Web or XML conferences In
California, Oregon or Washington State, please do let me know.
For more information on Perl Conference 3.0, you can go this site :
http://www.oreilly.com/oreilly/press/conferences.html
Thanks!
------------------------------
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 5215
**************************************