[13613] in Perl-Users-Digest
Perl-Users Digest, Issue: 1023 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Oct 8 15:05:48 1999
Date: Fri, 8 Oct 1999 12:05:34 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <939409533-v9-i1023@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Fri, 8 Oct 1999 Volume: 9 Number: 1023
Today's topics:
A perl dereferencing problem manojska@my-deja.com
Anyone know Everysoft Everyauction cgi script and its a <jlatek@interTeccorp.com>
Re: Bug with localtime() in Perl 5.004 and 5.005 (Ilya Zakharevich)
Re: Building perl with GCC 2.95.1 on solaris (Mads Toftum)
calling a dll from perl tlars@my-deja.com
Re: Checking for processes (M.J.T. Guy)
Re: Converting from Decimal to Binary <cassell@mail.cor.epa.gov>
Re: Date variable (Larry Rosler)
formatting numbers <inna@raykhman.com>
Re: formatting numbers (Andrew Johnson)
Re: formatting numbers <inna@raykhman.com>
Re: giving a file a variable name <kpmonroe@unity.ncsu.edu>
Re: Hosts running Mason and ImageMagic <norman.bunn@mci.com>
Re: How can I sort an array of hashes sorted by one of <skilchen@swissonline.ch>
Re: How to write an EOF in to a file? (Larry Rosler)
Re: How to write an EOF in to a file? (Larry Rosler)
interacting with a web server <jmarans@nortelnetworks.com>
Re: interacting with a web server <makkulka@cisco.com>
Re: Is $$variable allowed like in PHP ? (Tad McClellan)
Re: Is $$variable allowed like in PHP ? <cassell@mail.cor.epa.gov>
Re: Looking for Perl script to parse Ada code <uri@sysarch.com>
Re: Memory leak in assignment <dan@tuatha.sidhe.org>
NEWBIE QUESTION ON ORACLE <g-preston1@ti.com>
Re: NEWBIE QUESTION ON ORACLE <makkulka@cisco.com>
Re: Oh Yeah!. How to compile Perl to .EXE? <laurensmith@sprynet.com>
Overkill of warnings in module <NoSpam@JSoft.xs4all.nl>
Re: parenthesizing arguments to grep - BLOCK form (Larry Rosler)
Re: Perl Doc.. (Ilya Zakharevich)
Re: Please compare and contrast C and Perl. <cassell@mail.cor.epa.gov>
Re: Possible to Protect Code?? <cassell@mail.cor.epa.gov>
reading a hash using DBI <ewhite@guy.ssc.wisc.edu>
Sending mail with Perl? <unigni@zaynar.demon.co.uk>
Setting up Asctive Perl on Personal Web Server <mark@imp.net>
Re: Setting up Asctive Perl on Personal Web Server (Bill Moseley)
Shell and Perl have different $? (Sam Carmalt)
Re: Shell and Perl have different $? <sariq@texas.net>
Re: Splash screen (ItsMe9905)
Re: Spreadsheets. <cassell@mail.cor.epa.gov>
Re: STDERR output doesn't match $! (M.J.T. Guy)
udp socket failed to read? <xliu@cs.sunysb.edu>
Re: Using a regexp in an index function, can it be done (Ilya Zakharevich)
Re: What is THE book for PERL? <laurensmith@sprynet.com>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Fri, 08 Oct 1999 18:40:08 GMT
From: manojska@my-deja.com
Subject: A perl dereferencing problem
Message-Id: <7tldq5$vu0$1@nnrp1.deja.com>
Hi Perls ..
In one of my scripts I have a class call my_class, then
ref($self->{message}->[$count]) returns 'my_class'. But when I call the
method print_me of my_class like
$self->{message}->[$count]->print_me()
I get the error ' Can't call method "print_me" without a package or
object reference at my_class.pm line 44, <MANXQ> chunk 44. '
Pls help. Thanks in advance.
manojska
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Fri, 8 Oct 1999 11:52:50 -0500
From: "Jason Latek" <jlatek@interTeccorp.com>
Subject: Anyone know Everysoft Everyauction cgi script and its addons?
Message-Id: <pfpL3.1708$Av5.114221@news.corecomm.net>
I am building a site and am trying to use everysoft's everyauction. I can
get the basic script to work, but I want to use the addons. I am having
trouble with most of them. Please let me know if you know how to configure
them and how much you charge to do it.
jlatek@interteccorp.com
Thanks,
Jason
------------------------------
Date: 8 Oct 1999 18:28:38 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Bug with localtime() in Perl 5.004 and 5.005
Message-Id: <7tld4m$9b8$1@charm.magnus.acs.ohio-state.edu>
[A complimentary Cc of this posting was sent to Larry Rosler
<lr@hpl.hp.com>],
who wrote in article <MPG.1266b4314d84fff298a058@nntp.hpl.hp.com>:
> > If I remember some obscure research I once did into time standards, I
> > recall some standard allowing the possibility of 2 leap second being
> > added at once. That's what the 61 is for.
>
> I think you are right about that, which is why the pedants put 61 into
> the spec. But it is wrong nevertheless, because it is understood that
> there will never be a change of more than one leap second at a time, nor
> more frequently than once every six months.
AFAIU, you gave two contradictory statements.
Moreover, leap seconds are "mostly" governed by the changes in the
rate of Earth rotation, which IIRC are in turn mostly governed by
whether changes. Since one cannot predict the latter, making
prediction about the former would be kinda stupid.
One can observe the known (scarce) statistical data and make some
reasonable "if nothing changes" probabilistic predictions, nothing
more.
Ilya
------------------------------
Date: Fri, 08 Oct 1999 16:43:00 GMT
From: mt@dev.null (Mads Toftum)
Subject: Re: Building perl with GCC 2.95.1 on solaris
Message-Id: <37fe1e86.54975500@news.inet.tele.dk>
On Fri, 08 Oct 1999 10:08:00 -0400, Edward C Morgan
<ecmorgan@lucent.com> wrote:
[SNIP]
>Is there an easier way of doing that?
changing your PATH, to have /usr/local/bin before /usr/ccs/bin would
probably help - it would still complain about the -B option, but it
would probably compile without trouble.
vh
Mads Toftum, QDPH
som på USENET repræsenterer sig selv og ingen andre.
------------------------------
Date: Fri, 08 Oct 1999 16:42:42 GMT
From: tlars@my-deja.com
Subject: calling a dll from perl
Message-Id: <7tl6u0$qur$1@nnrp1.deja.com>
Does anyone know if it's possible to call a dll in the Win32 version of
perl? If so, could you please direct me to the module that allows you
to do this.
Thanks,
Tait
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 8 Oct 1999 18:28:02 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Checking for processes
Message-Id: <7tld3i$6bm$1@pegasus.csx.cam.ac.uk>
In article <7tl36k$o6m$1@nnrp1.deja.com>, <schan6128@my-deja.com> wrote:
>
>
>>
>> If you have the process' PID, you can use kill() with a zero signal to
>see
>> if it's alive.
>
>I've been trying to use the kill with a zero signal, but it is killing
>the process. Is there anyway to just simply monitor the process and not
>kill it? Basically what I am trying to do is to set up sort of a
>guardian process. But thanks for all your help so far.
kill 0, $pid should do this, as documented in perlipc. If not,
your Perl is broken.
What platform are you on, and what version of Perl?
Mike Guy
------------------------------
Date: Fri, 08 Oct 1999 12:02:01 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Converting from Decimal to Binary
Message-Id: <37FE3FA9.63B95E8@mail.cor.epa.gov>
Steffen Beyer wrote:
[snip]
>
> Suggestion for the perlfaq4 manpage:
> ------------------------------------
[snip]
Steffen, you *did* send these to TomC at
perlfaq-suggestions@perl.com already, right?
Okay, sorry for doubting you...
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Fri, 8 Oct 1999 10:49:08 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: Date variable
Message-Id: <MPG.1267ce6d7875ddf198a05f@nntp.hpl.hp.com>
In article <19991008120045.18179.00000165@ng-da1.aol.com> on 08 Oct 1999
16:00:45 GMT, ItsMe9905 <itsme9905@aol.comnojunk> says...
> Try $the_date = `/bin/date`; If that doesn't work ask your web admin the path
> to te date module(?).
This is poor advice. Calling an external command is not portable and is
wasteful of resources when Perl can do the same thing internally.
As at least three others have said already:
perldoc -f localtime
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 08 Oct 1999 14:09:54 -0700
From: inna raykhman <inna@raykhman.com>
Subject: formatting numbers
Message-Id: <37FE5DA2.5E403DD9@raykhman.com>
Hi,
does anybody know of any module or perl function that would allow me to
format a string containing a number, you know insert comma's in all the
right places and things.
or, if someone, knows the reg.exp. off the top of their head (i hope
that's the correct phrase, it does sound weird.) anyway, that would be
equally great.
thanks,
inna
------------------------------
Date: Fri, 08 Oct 1999 18:23:27 GMT
From: andrew-johnson@home.com (Andrew Johnson)
Subject: Re: formatting numbers
Message-Id: <zEqL3.13833$Vg4.570187@news1.rdc2.on.home.com>
In article <37FE5DA2.5E403DD9@raykhman.com>,
inna raykhman <inna@raykhman.com> wrote:
!
! Hi,
!
! does anybody know of any module or perl function that would allow me to
! format a string containing a number, you know insert comma's in all the
! right places and things.
section 5 of the perlfaqs has this entry:
How can I output my numbers with commas added?
try: perldoc perlfaq5
andrew
------------------------------
Date: Fri, 08 Oct 1999 14:35:36 -0700
From: inna raykhman <inna@raykhman.com>
Subject: Re: formatting numbers
Message-Id: <37FE63A8.C72ADBC2@raykhman.com>
thanks,i've found it.
inna
Art Haas wrote:
> inna raykhman <inna@raykhman.com> writes:
>
> >
> > does anybody know of any module or perl function that would allow me to
> > format a string containing a number, you know insert comma's in all the
> > right places and things.
> >
>
> I know of such a function, and you can too if you read perlfaq5 - look
> for 'How can I output my numbers with commas added?'
>
> --
> ###############################
> # Art Haas
> # (713) 689-2417
> ###############################
------------------------------
Date: Fri, 08 Oct 1999 09:30:33 -0400
From: Kevin Monroe <kpmonroe@unity.ncsu.edu>
Subject: Re: giving a file a variable name
Message-Id: <37FDF1F8.5F6BB1F5@unity.ncsu.edu>
Oh, I see! Thanks for the insight
kevin
David Cassell wrote:
> Kevin Monroe wrote:
> >
> > Thank you for your assistance. Your help is greatly appreciated. As I want to
> > learn how to fish for myself instead of being fed, could you elaborate on why
>
> Good. We like people who want to learn.
>
> > > __ print NEW "$line";
> > > ^ ^
> > > | |
> > >
> > > Don't do that.
> >
> > this should not be done that way.
>
> Use this instead:
>
> print NEW $line;
>
> Putting unneeded quotes around variables can lead to..
> umm.. surprises. Try this and see the difference.
>
> my @array = qw/one two three four/;
> print @array;
> print "@array";
>
> David
> --
> David Cassell, OAO cassell@mail.cor.epa.gov
> Senior computing specialist
> mathematical statistician
------------------------------
Date: Fri, 08 Oct 1999 16:21:09 GMT
From: "Norman Bunn" <norman.bunn@mci.com>
Subject: Re: Hosts running Mason and ImageMagic
Message-Id: <VRoL3.7141$Bf6.87410@pm02news>
Well, let's see. HTML::MASON is a perl module for component-based pages
(www.masonhq.com and Web Techniques 10/99) and PerlMagick is a perl specific
interface to ImageMagick, an image manipulation program. So if I can find a
web host that is running the Apache extensions that support HTML::MASON and
allow execution of ImageMagick, then I could run cgi-based perl programs
that use these.
I guess that's what this has to do with Perl. :)
Norman
Abigail wrote in message ...
>Norman Bunn (norman.bunn@mci.com) wrote on MMCCXXVIII September MCMXCIII
>in <URL:news:Zm7L3.5976$Bf6.75999@pm02news>:
>?? Does anyone know of a web hosting company running Mason and/or
ImageMagic?
>
>
>And this has what to do with Perl?
>
>
>
>Abigail
>--
>sub
_'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
>"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub
_{print+/.*::(.*)/s}
>*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
>_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))
))))
>
>
> -----------== 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: Fri, 08 Oct 1999 18:04:18 GMT
From: "Samuel Kilchenmann" <skilchen@swissonline.ch>
Subject: Re: How can I sort an array of hashes sorted by one of hash keys ?
Message-Id: <CmqL3.23038$m4.84926735@news.magma.ca>
Pascal Chambre <Pascal.Chambre@inria.fr> wrote in:
news:37FE0E74.437512EE@inria.fr
>
> But can we parametrise the by_key sub for instance :
> @a = sort by_key($key) @a;
Not in this way.
> I guess we could use a closure..
Exactly. Maybe with something like:
use strict;
my @a = ({k1 => 'b', k2 => 'a'},
{k1 => 'f', k2 => 'c'},
{k1 => 'd', k2 => 'g'},
{k1 => 'z', k2 => 'b'},
);
sub do_sort {
my $data_ref = shift;
my $sortkey = shift;
my $sortfunc = sub {
$a->{$sortkey} cmp $b->{$sortkey};
};
my @sorted = sort $sortfunc @$data_ref;
return @sorted;
}
foreach my $key (keys %{$a[0]}) {
print "sorted by key: $key\n";
@a = do_sort(\@a, $key);
foreach my $elt (@a) {
print "k1: $elt->{k1}, k2: $elt->{k2}\n";
}
print "---\n";
}
------------------------------
Date: Fri, 8 Oct 1999 10:56:29 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: How to write an EOF in to a file?
Message-Id: <MPG.1267d02d1ae13aa598a060@nntp.hpl.hp.com>
In article <7tkdaf$gbk$1@news.ntu.edu.sg> on Fri, 8 Oct 1999 17:23:25
+0800, Daniel Y.L. <linyong2000@990.net> says...
...
> # undef $/;
> # $contents = <FILEHANDLE>; # it only read one line, it is correct;
Why do you say it reads only one line? It should read the entire file.
...
> I also tried to clear the $INPUTY_RECROD_SEPARATOR, $/ to read the whole
> file contents. But, it also hang up.
The 'canonical' way to read an entire file into a scalar is:
$contents = do { local $/; <FILEHANDLE> };
It would be surprising if you tried that and found that it didn't work.
Perhaps you forgot to check the results of the open() to see that the
filed was upened successfully for reading.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 8 Oct 1999 11:11:41 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: How to write an EOF in to a file?
Message-Id: <MPG.1267d3b7f8b6df3e98a062@nntp.hpl.hp.com>
In article <7tkdaf$gbk$1@news.ntu.edu.sg> on Fri, 8 Oct 1999 17:23:25
+0800, Daniel Y.L. <linyong2000@990.net> says...
...
> # undef $/;
> # $contents = <FILEHANDLE>; # it only read one line, it is correct;
Why do you say it reads only one line? It should read the entire file.
...
> I also tried to clear the $INPUTY_RECROD_SEPARATOR, $/ to read the whole
> file contents. But, it also hang up.
The 'canonical' way to read an entire file into a scalar is:
$contents = do { local $/; <FILEHANDLE> };
It would be surprising if you tried that and found that it didn't work.
Perhaps you forgot to check the results of the open() to see that the
file was opened successfully for reading.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 08 Oct 1999 13:24:05 -0400
From: Jeffrey Marans <jmarans@nortelnetworks.com>
Subject: interacting with a web server
Message-Id: <37FE28B4.87E66EFD@nortelnetworks.com>
I'd like to run a perl script from the command line on a client machine,
have it execute an ASP on a web server, and then read back and parse
the web server's response.
Can someone send me some info and possibly a code frag illustrating
that process?
Please reply to jmarans at nortelnetworks dot com.
Thanks,
Jeffrey Marans
------------------------------
Date: Fri, 08 Oct 1999 11:17:31 -0700
From: Makarand Kulkarni <makkulka@cisco.com>
Subject: Re: interacting with a web server
Message-Id: <37FE353B.EE652F80@cisco.com>
{ Jeffrey Marans wrote:
> I'd like to run a perl script from the command line on a client machine,
> have it execute an ASP on a web server, and then read back and parse
> the web server's response.
> Can someone send me some info and possibly a code frag illustrating
> that process?
> Please reply to jmarans at nortelnetworks dot com.
use the LWP::UserAgent module.
get libwww-perl collection from CPAN.
The perldocs in there have lot of code snippets to illustrate how you
can do your task.
--
------------------------------
Date: Fri, 8 Oct 1999 07:26:53 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Is $$variable allowed like in PHP ?
Message-Id: <tdkkt7.kin.ln@magna.metronet.com>
Daniel Krajzewicz (krajzewicz@inx.de) wrote:
: Recently I noticed, reading the PHP3-manual that this script-language
: supports
: the use of construcs like "$$name = value".
: Hereby the variable with the name "$name" receives the value "value".
: Is this also possible to construct such operations in Perl ??
Yes, but you really really really don't want to do it.
Use a hash instead: $names{$name} = 'value';
http://www.plover.com/~mjd/perl/varvarname.html
If you insist on giving yourself maintenance headaches, see
the "Symbolic references" section in perlref.pod...
... but you'll be sorry...
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: Fri, 08 Oct 1999 11:59:20 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Is $$variable allowed like in PHP ?
Message-Id: <37FE3F08.D3B1748@mail.cor.epa.gov>
Daniel Krajzewicz wrote:
> Recently I noticed, reading the PHP3-manual that this script-language
> supports
> the use of construcs like "$$name = value".
> Hereby the variable with the name "$name" receives the value "value".
> Is this also possible to construct such operations in Perl ??
<The Brain>
Are you pondering what I'm pondering?
</The Brain>
Can PHP be the cause of all these "I want to do $$name = value"
questions that show up here?
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: 08 Oct 1999 11:56:30 -0400
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Looking for Perl script to parse Ada code
Message-Id: <x7g0zlongx.fsf@home.sysarch.com>
>>>>> "S" == Streesh <streesh@caci.com> writes:
S> Does anyone know where I might find this?
only ada can parse ada.
:-)
uri
--
Uri Guttman ----------------- SYStems ARCHitecture and Software Engineering
uri@sysarch.com --------------------------- Perl, Internet, UNIX Consulting
Have Perl, Will Travel ----------------------------- http://www.sysarch.com
The Best Search Engine on the Net ------------- http://www.northernlight.com
------------------------------
Date: Fri, 08 Oct 1999 19:17:42 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: Memory leak in assignment
Message-Id: <qrrL3.60$IZ5.813@news.rdc1.ct.home.com>
Ilya Zakharevich <ilya@math.ohio-state.edu> wrote:
> [A complimentary Cc of this posting was sent to Dan Sugalski
> <dan@tuatha.sidhe.org>],
> who wrote in article <P3mL3.13$IZ5.616@news.rdc1.ct.home.com>:
>> Are you saying that somewhere in the source perl cheats and encodes an
>> integer with just the base sv structure? I can see how this could be done,
>> by treating the sv_any pointer as an integer, but I can't see *where*
>> this is done. And I just went prowling through sv.c and most of the
>> pp*.c code.
> No. Instead of allocating sizeof(xiv) bytes for xiv, Perl "allocates"
> (here is an additional cheating, but it is irrelevant for the
> discussion) 4, then moves the pointer 8 bytes backward.
I see. I had sort of wondered what that chunk of sv.c did. Now I know. Playing
interesting games with the iv/nv/rv arenas.
I'll admit, I find this code fairly disturbing. We're lying a *lot* to the compiler
about what's going on, and I have this nagging feeling that this is one optimization
that'll bite us as newer compilers come on the scene.
I also now know why there's all that #ifdef PURIFY code in there. Purify'd scream
bloody murder about this. I'm surprised Dec C doesn't. (But, then, Dec C 6.2 is
quite unhappy about biggish chunks of perl already, so it might just not have
gotten around to yelling about this one)
Dan
------------------------------
Date: Fri, 08 Oct 1999 11:07:48 -0500
From: Jerry Preston <g-preston1@ti.com>
Subject: NEWBIE QUESTION ON ORACLE
Message-Id: <37FE16D4.8D5EB4E1@ti.com>
I am new at this. I am using Perl/CGI to access Oracle. In following code:
insert into twroot.scrap_status( C_REMOVED_BY, C_REMOVED_NAME,
C_REMOVED_REASON, c_removed_date )
values( $Emp_Number, $Emp_Name, $Reason, $c_date );
gives the following error:
Software error:
syntax error at /pdeweb/dm5pde/htdocs/cgi-pde/jerryp/insert.pl line 18, near
") values" syntax error at
/pdeweb/dm5pde/htdocs/cgi-pde/jerryp/insert.pl line 33, near ") values"
What am I doing wrong?
Thanks,
Jerry
------------------------------
Date: Fri, 08 Oct 1999 10:29:31 -0700
From: Makarand Kulkarni <makkulka@cisco.com>
Subject: Re: NEWBIE QUESTION ON ORACLE
Message-Id: <37FE29FA.60AC3C9B@cisco.com>
{ Jerry Preston wrote:
> I am new at this. I am using Perl/CGI to access Oracle. In following code:
> insert into twroot.scrap_status( C_REMOVED_BY, C_REMOVED_NAME,
> C_REMOVED_REASON, c_removed_date )
> values( $Emp_Number, $Emp_Name, $Reason, $c_date );
> gives the following error:
> Software error:
> syntax error at /pdeweb/dm5pde/htdocs/cgi-pde/jerryp/insert.pl line 18, near
> ") values" syntax error at
> /pdeweb/dm5pde/htdocs/cgi-pde/jerryp/insert.pl line 33, near ") values"
>
> What am I doing wrong?
take off the semicolon at the end of the sql statement.
--
------------------------------
Date: Fri, 8 Oct 1999 10:51:14 -0700
From: "Lauren Smith" <laurensmith@sprynet.com>
Subject: Re: Oh Yeah!. How to compile Perl to .EXE?
Message-Id: <7tlauj$3mt$1@brokaw.wa.com>
Paul D wrote in message <37FDCC6D.B1264F56@home.com>...
>The title says it all.
>How do I go about compiling from the plain text script to
>an EXE that could run on its own, or at least still from the
>cgi-bin but with it having "absorbed" all the stuff it needs into
>one file (ie: the includes, uses etc).
perlfaq3 "How can I compile my Perl program into byte code or C?" gives
some explanations about the usefulness of such compilation. The main
point is that it won't make your program faster, smaller, or more
secure.
If you're still deluded after reading the above FAQ, I guess you can
surf over to http://www.demobuilder.com/perl2exe.htm and see about their
services.
Lauren
------------------------------
Date: Fri, 8 Oct 1999 20:41:19 +0200
From: "Willem Joosten" <NoSpam@JSoft.xs4all.nl>
Subject: Overkill of warnings in module
Message-Id: <7tldsm$btj$1@news1.xs4all.nl>
Hi,
I'm writing some ODBC stuff with Activate state Perl. I use the strict and
diagnostics modules to make life easier but this module gives a lot (twice
every single time I get row) of 'Use of unitialized value' warnings.
Is there a way to turn these warnings of locally?
Also took a peek at the code, the "$self->{'data'}" is the cause of the
problem. But this is never assigned to (as far as I can see). Is this hash
assigned to by some linked c-code?
And is it in general possible to use external code to assign to Perl
variables without passing them to external code?
Groeten
------------------------------
Date: Fri, 8 Oct 1999 11:10:20 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: parenthesizing arguments to grep - BLOCK form
Message-Id: <MPG.1267d365bf5d93a598a061@nntp.hpl.hp.com>
In article <7tksai$ivj$1@nnrp1.deja.com> on Fri, 08 Oct 1999 13:41:40
GMT, jrw32982@my-deja.com <jrw32982@my-deja.com> says...
> How can I parenthesize the arguments to grep when I'm using the BLOCK
> form?
>
> grep BLOCK LIST works fine
> grep(BLOCK LIST) gives a syntax error
>
> The manual seems to indicate that the arguments to all functions can be
> parenthesized. I believe that the perl parser is interpreting the BLOCK
> as an anonymous hash. How can I force it to recognize a BLOCK?
Uh, oh. I don't know what's going on here.
Help! I need somebody's help!
#!/usr/local/bin/perl -w
use strict;
print grep {$_ % 2} 0 .. 9; # 13579
print grep ({$_ % 2} 0 .. 9); # 13579
#print grep({$_ % 2} 0 .. 9); # Syntax error here!
__END__
This is perl, version 5.005_03 built for MSWin32-x86-object
(with 1 registered patch, see perl -V for more detail)
Copyright 1987-1999, Larry Wall
Binary build 519 provided by ActiveState Tool Corp.
http://www.ActiveState.com
Built 09:50:30 Aug 12 1999
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 8 Oct 1999 18:22:27 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Perl Doc..
Message-Id: <7tlcp3$99d$1@charm.magnus.acs.ohio-state.edu>
[A complimentary Cc of this posting was sent to Martien Verbruggen
<mgjv@comdyn.com.au>],
who wrote in article <WAgL3.162$u83.8870@nsw.nnrp.telstra.net>:
> > It's a secret. Part of the fun of learning Perl is to figure out which
> > commands there are, and how they work. It would be silly to include 1200+
> > pages of man pages, available as 'man perl'. That would be for wussies!
>
> After all, the number of combinations of legal characters that could
> make up a command is limited. Large, but limited. You could try them
> all..
Unfortunately, one cannot find the limit without giving this
secret-cabal 7-finger salute
man perl
Ilya
------------------------------
Date: Fri, 08 Oct 1999 11:54:02 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Please compare and contrast C and Perl.
Message-Id: <37FE3DCA.598F6580@mail.cor.epa.gov>
luvisi@andru.sonoma.edu wrote:
>
> Neil <neil@pacifier.com> writes:
> > Please compare and contrast the two languages.
[snip]
> bit floating around. For each of these domains, I believe there is at
> least one other language which is better than perl (this list is not
> meant to be comprehensive, just illustrative)...
>
> file manipulation: find + sh
Sometimes. But a lot of repetitive file manipulation tasks
seem to work better/faster in Perl.
> running other programs: sh
Often true [for simple programs with little flow control].
But when one needs more flow control, better error-checking,
pattern-matching, non-unix-box systems work, and/or a way
out of the pipes-are-my-life mentality, I find Perl is
preferable. For me, anyway. YMMV.
> string manipulation: icon
Really? Could you share an example? I find icon's
pattern-matching and substitution facilities to be way
behind Perl's. Maybe I don't know enough icon.
> object oriented programming: C++, Eiffel, Pike, and any other language
> that doesn't require that you know the names of a superclass's private
> variables when subclassing in order to avoid clobbering them (note:
> this kind of includes python, with it's support for automatically
> mangling _foo into modulename_foo, but I'm not particularly fond of
> that scheme either)
C++ ? Yick. Eiffel is better.
> functional programming: scheme
I can't complain about that one.
> bit twiddling devices and such: C
Or that one.
> fast number crunching: C, FORTRAN, Pascal, etc.
FORTRAN or C. But that's what XS is for. :-)
> big number crunching: bc, dc, icon, COBOL, Mathematica, and anything
> else with arbitrary precision built in (note: this isn't all that
> important since big number modules are available as an add on for perl)
> > I am aware that Larry Wall wrote Perl in C.
>
> yup.
C is a good language, and is the best language for some tasks.
But then, a parachute is the best way to get off a mountaintop
for certain values of 'best'. Just don't try it if you're
not already an expert.
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Fri, 08 Oct 1999 11:43:13 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Possible to Protect Code??
Message-Id: <37FE3B41.A8F6549C@mail.cor.epa.gov>
vivekvp wrote:
[snip]
> I have a perl script that has variables to set up at the top of the
> script. Then there is a section that states it is not to be changed -
> changing data might cause the script not to function. All I am trying
> to do is change the spelling of a couple of words with in html brackets
> <> ie. favor can be changed to favour. when i upload the script -
> reset the permissions - i get an internal 500 premature end of headers 0
> but when i re upload the script - changing the word 'favour' back to
> favor - it works!
>
> is it possible to protect code against modification? it look like plain
> text to me - but all the code that should not be altered is bunched
> together - no spaces or separation by lines...
Without more info, it's tough to do more than make a wild guess.
Still, it is unlikely that the code has been 'protected'
against mods. A typo or braino in your code is more likely.
The first part of your message makes it sound as of you have
inadvertently changed something like a URL or a tag so that the
changed page is no longer working.
But the second part of your message makes things sound as if
you have accidentally made a mistake in getting your file
ready. Did you use FTP and send it as binary instead of ASCII?
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: Fri, 8 Oct 1999 12:48:35 -0500
From: Eric White <ewhite@guy.ssc.wisc.edu>
Subject: reading a hash using DBI
Message-Id: <Pine.OSF.3.95.991008124726.3557F-100000@guy.ssc.wisc.edu>
Thanks to everyone who helped me out yesterday. I was the victim of a
misplaced set of quotes. (Ok, I was also the perp, but enough on that...)
Everyone was so helpful that I thought I'd push my luck and ask another
question.
The scenario: I'd like to read in the values from a form and put them into
a database. I think I've got a handle on how to do this, but some weird
things seem to be happening. Here's what I've got:
#!c:\Perl\bin\perl.exe -w
use DBI;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
use Tie::IxHash;
tie %FORM, "Tie::IxHash";
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
$dbName = "webtest";
$dbDriver = "ODBC";
$dbUserName = "";
$dbPassword = "";
$dbh = DBI->connect("DBI:ODBC:webtest",
{ RaiseError =>1 , AutoCommit => 0 });
$dbh->do ("INSERT INTO webtest VALUES ('$FORM{third}', '$FORM{password}',
'$FORM{first}', '$FORM{second}', '$FORM{caseid}')");
$dbh->disconnect;
############
}
print "<html><head><title>Form Output</title></head><body>";
print "<h2>Results from FORM post</h2>\n";
foreach $key (keys(%FORM)) {
print "$key = $FORM{$key}<br>";
}
####################
print "</body></html>";
So I'm reading in the STDIN from the forms and moving it into a hash
called %FORM. The problem comes in referencing the individual elements
in the dbh->do statement. What's odd is that if I use it as it's written
here it works. If, however, I switch the places of $FORM{third} and
FORM{caseid} in the INPUT statement only the value for $FORM{caseid} is
inserted to the database. Every other element's value is not inserted.
I was hoping that the Tie::IxHash module might help, but it doesn't
seem to (other than the fact that now all the forms are printed in the
resulting page in their "input" order).
I've tried this in a variety of different ways, ordering the variables
in the INSERT statement differently, changing the number of elements in
the hash, etc. I can't seem to identify any pattern for what works and
what doesn't work. Any ideas on what's happening here?
I hope I've given enough information to at least make it a reasonable
question.
As always, thanks for any help.
Eric
---------------------------------------------------------------
Eric White ewhite@ssc.wisc.edu
UW Survey Center phone: 608-265-4066
University of Wisconsin - Madison http://www.wisc.edu/uwsc/
------------------------------
Date: Fri, 8 Oct 1999 18:36:02 +0100
From: Unigni <unigni@zaynar.demon.co.uk>
Subject: Sending mail with Perl?
Message-Id: <aAroyFACui$3Ew+9@zaynar.demon.co.uk>
What's the easiest way to make a Perl program (for Windows, using
ActivePerl) that can send an e-mail? I know how to send e-mails using
telnet, so is there a way to run an automatic telnet session with Perl,
or should I use a specific e-mail-sending command?
Any help will be greatly appreciated! :-)
--
Philip Taylor
philip @ zaynar . demon . co . uk
------------------------------
Date: Fri, 8 Oct 1999 12:39:23 -0400
From: "Mark Polakow" <mark@imp.net>
Subject: Setting up Asctive Perl on Personal Web Server
Message-Id: <q8pL3.15132$w8.297415@wbnws01.ne.mediaone.net>
I know have done this before but i can't remember how? Can someone give me a
step by tep of getting Active perl to run on Win98 MS Personal Web server -
I am using the latest Active Perl 520
thanks alot.
------------------------------
Date: Fri, 8 Oct 1999 11:03:21 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: Setting up Asctive Perl on Personal Web Server
Message-Id: <MPG.1267d1c079d29fa49897e8@nntp1.ba.best.com>
Mark Polakow (mark@imp.net) seems to say...
> I know have done this before but i can't remember how? Can someone give me a
> step by tep of getting Active perl to run on Win98 MS Personal Web server -
> I am using the latest Active Perl 520
Sure. Check the faq that comes with Activestate or go to their web site
where they explain how to do it.
But if want a wise-ass answer I can give you a 2 step process:
1) Delete MS PWS
2) Download Apache and install it.
--
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.
------------------------------
Date: Fri, 08 Oct 1999 16:14:29 GMT
From: scarmalt@swconsult.ch (Sam Carmalt)
Subject: Shell and Perl have different $?
Message-Id: <37fe1815.183298863@news.iprolink.ch>
I have a working script which does a remote copy.
$file_to_copy = "file.x";
$file_remote = "somedir/copy.x";
system("rcp $file_to_copy user\@machine:/path/$file_remote");
We recently decided that it would be good to know if this was
successful (the most likely cause of failure being that the remote
file system is not found). At the shell
>rcp file.x user@machine:/path/somedir/copy.x
>echo $?
returns 0 with success, and 1 with failure (due to setting somedir to
a non-existant value). But the perl script statments
$ia = system("rcp $file_to_copy user\@machine:/path/$file_remote");
print "\$? = $? \$ia = $ia \n";
Gives values of 0 both when the rcp works and when it doesn't.
Have I missed something obvious?
Thanks and regards
------------------------------
Date: Fri, 08 Oct 1999 11:36:00 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: Shell and Perl have different $?
Message-Id: <37FE1D70.AC6D6473@texas.net>
Sam Carmalt wrote:
>
> But the perl script statments
>
> $ia = system("rcp $file_to_copy user\@machine:/path/$file_remote");
> print "\$? = $? \$ia = $ia \n";
>
> Gives values of 0 both when the rcp works and when it doesn't.
>
> Have I missed something obvious?
Yes. The documentation for 'system'.
perldoc -f system
- Tom
------------------------------
Date: 08 Oct 1999 15:55:39 GMT
From: itsme9905@aol.comnojunk (ItsMe9905)
Subject: Re: Splash screen
Message-Id: <19991008115539.18179.00000162@ng-da1.aol.com>
Edo,
If by "visualize" you mean if you can have a Perl script write out an HTML page
for you then the answer is yes.
gc
------------------------------
Date: Fri, 08 Oct 1999 11:56:25 -0700
From: David Cassell <cassell@mail.cor.epa.gov>
Subject: Re: Spreadsheets.
Message-Id: <37FE3E59.4FEFCB7F@mail.cor.epa.gov>
Kangas wrote:
>
> Other than Excel what spreadsheets can perl connect with??
Any win32 spreadsheet which speaks OLE . Which means almost any
modern version of a win32 spreadsheet. I dunno about MacPerl
and Mac spreadsheets. I have yet to find a need to make Perl
speak with a unix spreadsheet, but YMMV.
David
--
David Cassell, OAO cassell@mail.cor.epa.gov
Senior computing specialist
mathematical statistician
------------------------------
Date: 8 Oct 1999 18:15:30 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: STDERR output doesn't match $!
Message-Id: <7tlcc2$5s2$1@pegasus.csx.cam.ac.uk>
Natalya Barner <nbarner@uswest.com> wrote:
>I'm trying to write some code which will output the OS error message if
>a system call fails.
>The problem I'm having is that the message going to STDERR is not the
>same message that's getting stored in $!.
>
>Here's the code:
> #!/usr/local/bin/perl
> $rc = system("mkdir mydir");
> if ($rc)
> {
> print "couldn't do it: $!\n";
> }
>
>And here's the output:
> mkdir: cannot create mydir: File exists
> couldn't do it: No such file or directory
You're confusing the two variables $! and $?, which do quite different
things.
perldoc perlvar and look for '$?', '$!' and 'Error Indicators'
perldoc -f system
And, as Abigail has pointed out, for this particular example it
would be much more sensible to use Perl's built-in mkdir().
Mike Guy
------------------------------
Date: Fri, 08 Oct 1999 13:46:25 -0400
From: Xiaoyan Liu <xliu@cs.sunysb.edu>
Subject: udp socket failed to read?
Message-Id: <37FE2DF1.6D200081@cs.sunysb.edu>
Hi, all,
Please give me some hint on this problem.... I setup an UDP socket to
send and read msg from a server which is written in JAVA also with UDP .
Somehow, the perl socket cannot recv msg and the CGI gets blocked and
crashed my www server sometime. Is there any settings for read?
send($socket, $data, 0) == length($data)) {
print $query->header("text/html");
print $query->start_html("Confirm/Cancel Transaction");
print $query->p("Request sent to server!");
$server = recv($socket, $buffer, 256, 0); // blocked?????
print $query->p("Receive from server: $buffer");
close($socket);
thank you in advance.
------------------------------
Date: 8 Oct 1999 18:41:08 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: Using a regexp in an index function, can it be done?
Message-Id: <7tlds4$9fb$1@charm.magnus.acs.ohio-state.edu>
[A complimentary Cc of this posting was sent to Rick Delaney
<rick.delaney@home.com>],
who wrote in article <37FD3E41.6A05DD1F@home.com>:
> And if it needs those quantifiers you can so something like
>
> /($pattern)/g; # Add 'o' modifier if $pattern never changes
>
> print pos() - length $1, "\n";
pos = 0;
/(?=$pattern)/g;
print pos;
Ilya
------------------------------
Date: Fri, 8 Oct 1999 10:30:52 -0700
From: "Lauren Smith" <laurensmith@sprynet.com>
Subject: Re: What is THE book for PERL?
Message-Id: <7tl9oe$1bs$1@brokaw.wa.com>
Trond Michelsen wrote in message ...
>
>Johnny 'Loopy' Ooi <jjyooi@dcs.qmw.ac.uk> wrote in message
>news:37FD9728.257BC43@dcs.qmw.ac.uk...
>> Can anyone in the know tell me the _best_ book to read/buy for
>research
>> and reference into PERL?
>
>If you only want to buy _ONE_ book about Perl, you should buy "The Perl
>CD Bookshelf"
And after that, there is a ton of documentation that comes with Perl.
It is the most up-to-date collection of documents that you can get for
Perl. It is *the* definitive reference. :-)
Lauren
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 1023
**************************************