[15447] in Perl-Users-Digest
Perl-Users Digest, Issue: 2857 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 25 03:06:08 2000
Date: Tue, 25 Apr 2000 00:05:09 -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: <956646308-v9-i2857@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Tue, 25 Apr 2000 Volume: 9 Number: 2857
Today's topics:
Re: backslash escaping not metacharacters in a char cla <fjherna@europa3.com>
Confusion between bitwise and stringwise & ? <lr@hpl.hp.com>
Re: Crypt module suggestions <elaine@chaos.wustl.edu>
Re: Date standardization without Date::Manip drode@my-deja.com
Re: Date standardization without Date::Manip <elaine@chaos.wustl.edu>
Re: Date standardization without Date::Manip alexandria_sarkut@my-deja.com
Re: emulate a browser <jeff@vpservices.com>
Has anyone used the pro ver of Perl Scripting Tool if s <scotnet@sympac.com.au>
How to replace these strings in a html file (2nd post) <huyv@usa.net>
HOW? auto execute perl on start session <joshuadharmawan@hotmail.com>
Re: I'm about to lose a client!!! SOMEBODY HELP ME!!! <rootbeer@redcat.com>
Re: I'm about to lose a client!!! SOMEBODY HELP ME!!! <phill@modulus.com.au>
Re: I'm about to lose a client!!! SOMEBODY HELP ME!!! <sid@eurekanet.com>
Re: I'm about to lose a client!!! SOMEBODY HELP ME!!! (Craig Berry)
Re: man2html <makarand_kulkarni@My-Deja.com>
Re: Oracle DBI DBM memory leak <dan@tuatha.sidhe.org>
oral perl problem( I can't update table!) <yoonjung@cs.tamu.edu>
Re: Out of memory! <dan@tuatha.sidhe.org>
Re: Out of memory! <elaine@chaos.wustl.edu>
Re: Perl & Fortran msouth@fulcrum.org
Perl Install on NT Wrokstation <pturmel@synapse.net>
Re: Perl Install on NT Wrokstation <rootbeer@redcat.com>
Re: Perl Install on NT Wrokstation <DNess@Home.Com>
Perl on NT anyone? <administrator@westelcom.com>
Re: Perl on NT anyone? <makarand_kulkarni@My-Deja.com>
Re: Perl on NT anyone? <DNess@Home.Com>
Running script from hyperlink ? <bjorn@xfertipro.com>
Re: SQL get values by column name? <makarand_kulkarni@My-Deja.com>
Re: SQL get values by column name? <jeff@vpservices.com>
undefined value as a symbol reference <gene01@smalltime.com>
Re: using CPAN: what's all this junk!? jlamport@calarts.edu
Re: using CPAN: what's all this junk!? (Sam Holden)
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 25 Apr 2000 11:02:37 +0200
From: Javier Hernandez <fjherna@europa3.com>
To: Larry Rosler <lr@hpl.hp.com>
Subject: Re: backslash escaping not metacharacters in a char class
Message-Id: <Pine.LNX.4.21.0004251059570.609-100000@david.lcv.es>
Hi Larry,
Thanks again for your reply.
On Mon, 24 Apr 2000, Larry Rosler wrote:
> After you have read the documentation and tried some experiments, if any
> questions remain please ask them.
I assume I havd asked some FAQ questions. I beg you pardon and all others
at the list.
I will try to find them in the documentation.
Best regards,
Javi, _____ fjherna@europa3.com
| http://www.europa3.com/users/fjherna
\_________(_)_________/ http://www.valux.org/
____________!___!___!___________ Valencia
--------------------------------------------------------------------
If you want to read about love and marriage you've got to buy two separate
books.
-- Alan King
------------------------------
Date: Mon, 24 Apr 2000 14:22:19 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Confusion between bitwise and stringwise & ?
Message-Id: <MPG.136e5ae64293269498a970@nntp.hpl.hp.com>
I am following up on a thread from last week,
"bits and bits" !~ /scambled eggs for brain/;
But my newsfeed has lost the previous posts, so I can't respond in the
same thread.
I isolated the problem to a strange confusion between bitwise and
stringwise &. If the confusion is in my mind, perhaps someone can clear
it up. If it is perl, I want to submit a perlbug report.
#!/usr/bin/perl -w
use strict;
my $x = '002';
my $y = 10;
$y = '010';
print qq{ $x & $y is ${\( $x & $y )}\n};
print qq{ $x & "$y" is ${\( $x & "$y")}\n};
print qq{"$x" & $y is ${\("$x" & $y )}\n};
print qq{"$x" & "$y" is ${\("$x" & "$y")}\n};
print "\n";
my $z = 10;
$z = '0' . $z; # Or "0$z"; no difference.
print qq{ $x & $z is ${\( $x & $z )}\n};
print qq{ $x & "$z" is ${\( $x & "$z")}\n};
print qq{"$x" & $z is ${\("$x" & $z )}\n};
print qq{"$x" & "$z" is ${\("$x" & "$z")}\n};
print "\n";
print qq{ $x & $y is ${\( $x & $y )}\n};
print qq{ $x & "$y" is ${\( $x & "$y")}\n};
print qq{"$x" & $y is ${\("$x" & $y )}\n};
print qq{"$x" & "$y" is ${\("$x" & "$y")}\n};
__END__
Output:
002 & 010 is 000
002 & "010" is 000
"002" & 010 is 000
"002" & "010" is 000
002 & 010 is 2
002 & "010" is 2
"002" & 010 is 2
"002" & "010" is 000
002 & 010 is 2
002 & "010" is 2
"002" & 010 is 2
"002" & "010" is 000
Interpretation:
Part 1: $y has a number value and a string value. Perl does stringwise
&; no problem.
Part 2: $z seems to have the same number value and string value as $y,
though created slightly differently. But perl now does bitwise &, and
something happens to $x so that it too now needs explicit
stringification.
Part 3: Same code and variables as Part 1, but $x is now different, so
the code behaves like Part 2.
Questions:
Why are $y and $z different?
Why does anding $x with $z cause $x to acquire a number value, which
messes up anding it with $y?
Conclusion:
I too have 'scambled (sic) eggs for brain'.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Tue, 25 Apr 2000 02:51:35 GMT
From: Elaine Ashton <elaine@chaos.wustl.edu>
Subject: Re: Crypt module suggestions
Message-Id: <B52A80B6.2FA1%elaine@chaos.wustl.edu>
in article Pine.GSO.4.10.10004241522130.25963-100000@user2.teleport.com, Tom
Phoenix at rootbeer@redcat.com quoth:
> My favorite encryption module is, of course, Crypt::Rot13. What I like
> most is the author's attempts to keep it up-to-date: It's already at
> version 0.6!
http://search.cpan.org/search?dist=Crypt-Rot13
I did a double take and thought no way could this be more than a joke ...Why
am I not surprised? :)
"BUGS - The rot13 algorithm is not easy to understand"
e.
------------------------------
Date: Tue, 25 Apr 2000 01:21:38 GMT
From: drode@my-deja.com
Subject: Re: Date standardization without Date::Manip
Message-Id: <8e2rur$qka$1@nnrp1.deja.com>
Your *opinion* on the proper method to quote is noted.
To your point: Yes, I did read the Date::Manip Perldoc and the "SHOULD I
USE DATE::MANIP" section. I read this prior to my initial post.
My question remains unanswered. Has anyone done anything similar and
would that person be willing to share a brief note on how the problem
was solved.
The reply from Tom Phoenix was on target, and I appreciate the advice,
but I had already done this.
-Dan Rode
>
> Place your response *after* the quoted text. Properly quote the
message
> so that the author is attributable.
>
> Did you bother following Tom Phoenix's advice? Well, you should.
>
> HTH. HAND.
>
> - Tom
>
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Tue, 25 Apr 2000 02:44:00 GMT
From: Elaine Ashton <elaine@chaos.wustl.edu>
Subject: Re: Date standardization without Date::Manip
Message-Id: <B52A7EEF.2F9F%elaine@chaos.wustl.edu>
in article 8e2rur$qka$1@nnrp1.deja.com, drode@my-deja.com at
drode@my-deja.com quoth:
> My question remains unanswered. Has anyone done anything similar and
> would that person be willing to share a brief note on how the problem
> was solved.
Well...Date::Manip is like the car that gets you there but isn't exactly a
ferrari. Your original question was asking about taking several known
formats and mushing them into one single format. If you are bothered by the
overhead of Date::Manip you might write a smaller custom filter of your own
or see http://search.cpan.org/search?mode=module&query=Date%3A%3A
Also, you might try it with Date::Manip as unless you are converting
something really hairy, it probably won't make an extreme difference, but
then again, everyone has a different measure of things.
e.
------------------------------
Date: Tue, 25 Apr 2000 02:50:45 GMT
From: alexandria_sarkut@my-deja.com
Subject: Re: Date standardization without Date::Manip
Message-Id: <8e3162$vq7$1@nnrp1.deja.com>
In article <8dt0av$nkq$1@nnrp1.deja.com>,
danrode@my-deja.com wrote:
> I need to filter dates and store them in a comon format
> (likely epoch time). The input could be one of several
> date formats. MM/DD/YY, MM/DD/YY HH:MM, WDAY MON MDAY
> HH:MM:SS YYYY, and a few others. For dates that lack
> HH:MM:SS, I would like to use the current time or some
> standard time like "00:00:00" as a "filler".
>
> Date::Manip seems to be capable of dealing with much
> of the work, but it's large size would cause performance
> problems. Has anyone done something similar? Any suggestions?
You have presented a problem with no solution. There
are no modules nor any code which can handle a problem
this complex. Enough possible combinations have been
cited along with "...a few others." to cast this into
a realm of exponential solution sets.
Rather than deal with so many different formats coming
into your program, consider exercising control over the
sources of these various date formats. Should you have
multiple data sources, each with a unique date format,
your problem is solved by addressing specific data
entering from a specific data source. Sort your data
sources uniquely and treat each individually.
Should you be working with a data base containing these
highly randomized date formats, two things should come
to mind for you. First is to not create a data base
without strict standardization. Other is a hard task
but in the long run would save you time, effort and
lower potential for mistakes; clean up your data
base manually with a program editor or with custom
scripts to be used for this task then discarded
when finished. Straighten out each format type,
globally, one format type at a time.
Consider casting aside a method of placing a Band-Aid
on this problem and treat the root cause, your data
sources or your data base.
Andrea Alexandria Sarkut
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 24 Apr 2000 18:15:04 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: emulate a browser
Message-Id: <3904F198.D5E8182@vpservices.com>
Jonah wrote:
>
> 1) customer fills out the form and presses submit
>
> 2) my script writes data to a file
>
> 3) my script passes the orginal form data, untouched, as if it came straight
> from the form (because that's what it
> expects) to the other script
>
> 4) the script (whatever language) processes the order
>
> 5) the script returns the response, which, under normal circumstances, is a
> confirmation
> message as an html page to be viewed by the customer with a browser, but,
> instead, it will return that same response
> to my script and,
>
> 6) my script in turn, then receives and prints this response and everything
> is fine?
>
> If it can be that simple, I'm jumping up and down in excitement!
Jump!
> I'm asking because I can't go out and test every single order form that's on
> the net.
If the order form works from a user sending it info, it will work with
LWP sending it info. Unless it is a very bright script, it won't know
that LWP is any different from any other user. Ok, I lied, even if it
is a very, very bright script, it won't know that.
--
Jeff
------------------------------
Date: Tue, 25 Apr 2000 15:34:10 +1000
From: Scotty <scotnet@sympac.com.au>
Subject: Has anyone used the pro ver of Perl Scripting Tool if so is it any good?
Message-Id: <39052E52.4096E1E5@sympac.com.au>
Hi there,
I was looking into buying the pro version of the program Perl Scripting
Tool just wondering if
other have found it worth the money?
http://www.perlscriptingtool.com/
Scott Laughton
------------------------------
Date: Tue, 25 Apr 2000 01:32:08 -0400
From: "Huy Vu" <huyv@usa.net>
Subject: How to replace these strings in a html file (2nd post)
Message-Id: <e0aN4.3959$qY2.70095@newscontent-01.sprint.ca>
Hi all,
I'm newbie in perl and have difficulty in trying to replace the string1
below:
>·</FONT><FONT size=2 style="font-family:'Arial'; font-size:10pt; " >
with string2=
>·</FONT><FONT size=2 style="font-family:'Arial'; font-size:9pt; "
> </FONT><FONT size=2
style="font-family:'Arial'; font-size:10pt; " >
in file.htm
I tried the command below with Perl on NT4 but not successful
I have difficulty in escaping the metacharacters in these strings.
Thanks in advance for any help.
H.V
------------------------------
Date: Tue, 25 Apr 2000 05:56:44 GMT
From: Joshua Cheng <joshuadharmawan@hotmail.com>
Subject: HOW? auto execute perl on start session
Message-Id: <8e3c2q$a74$1@nnrp1.deja.com>
Hi..
does PERL have features like global.asa (in ASP) (to execute command
lines on start session) ? plz let me know the filename?
Joshua
--
APL-JKT-EDP
plz reply to joshuadharmawan@hotmail.com as well
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 24 Apr 2000 18:16:41 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: I'm about to lose a client!!! SOMEBODY HELP ME!!!
Message-Id: <Pine.GSO.4.10.10004241813300.25963-100000@user2.teleport.com>
On Tue, 25 Apr 2000, Lobo wrote:
> Subject: I'm about to lose a client!!! SOMEBODY HELP ME!!!
Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.
http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
> I keep receiving Internal Server Errors!!!!
When you're having trouble with a CGI program in Perl, you should first
look at the please-don't-be-offended-by-the-name Idiot's Guide to solving
such problems. It's available on CPAN.
http://www.perl.com/CPAN/
http://www.cpan.org/
http://www.cpan.org/doc/FAQs/cgi/idiots-guide.html
http://www.cpan.org/doc/manual/html/pod/
> $temp=$ENV{'QUERY_STRING'};
> @pairs=split(/&/,$temp);
Don't do it like this. Use CGI.pm. Not only are you doing it the hard
way...
> foreach $item(@pairs) {
> ($key,$content)=split (/=/,$item,2);
> $content=~tr/+/ /;
> $content=~ s/%(..)/pack("c",hex($1))/ge;
> $fields{$key}=$content;
> }
...you're doing it the wrong way.
> open (TXT, '$txt');
Even when your script is "just an example" (and perhaps especially in that
case!) you should _always_ check the return value after opening a file.
And does your file's name really contain a dollar sign?
If you're still stuck, add '-w' and 'use strict' to your program and do
your best to fix any problems they report. Then, if you've checked the
docs and you're _still_ stuck, you could ask again here. Good luck with
it!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 25 Apr 2000 11:29:43 +1000
From: Peter Hill <phill@modulus.com.au>
Subject: Re: I'm about to lose a client!!! SOMEBODY HELP ME!!!
Message-Id: <3904F507.5204@modulus.com.au>
Lobo wrote:
>
> Please, it can't be THAT hard...
>
> I'm trying to display the contents of a Pipe Separeted Values TXT file
> to a page, but I keep receiving Internal Server Errors!!!!
>
> Here's my COMPLETE code:
>
> #!/usr/bin/perl
>
> $temp=$ENV{'QUERY_STRING'};
> @pairs=split(/&/,$temp);
> foreach $item(@pairs) {
> ($key,$content)=split (/=/,$item,2);
> $content=~tr/+/ /;
> $content=~ s/%(..)/pack("c",hex($1))/ge;
> $fields{$key}=$content;
> }
>
> $txt = $fields{'file'}.".txt";
>
> print "Content-type:text/html\n\n";
>
> open (TXT, '$txt');
> @array = <TXT>;
> foreach $line(@array) {
> chomp($line);
> print "$line\n";
> }
> close (TXT);
[snip]
A slightly cleaned up version:
#!/usr/bin/perl -w
use strict;
my %fields;
my @pairs=split(/&/,$ENV{'QUERY_STRING'});
foreach my $item(@pairs) {
my ($key,$content) = split(/=/,$item,2);
$content=~tr/+/ /;
$content=~ s/%(..)/pack("c",hex($1))/ge;
$fields{$key}=$content;
}
my $txt = $fields{'file'}.".txt";
print "Content-type: text/html\n\n";
open (TXT, $txt) || die "Cannot open $txt for read...$!";
# ^^^^ main problem was '$txt'
my @array = <TXT>;
foreach (@array) {
tr/|/ /;
print "$_<BR>\n";
}
close (TXT);
Remaining problems which *you* should address:
- the CGI.pm module will perform parsing of GET and POST input data more
reliably than hand coding
- you are not validating the input received as QUERY_STRING to ensure
that it does not contain system commands etc.; the example above as is
potentially allows users to do unpleasant things to your system
- you have, or expect to have, (by implication) your data files in the
cgi-bin directory :- this yields 2 risks
1. The current directory is not necessarily cgi-bin, depending on the
UID of the user
2. Data files in an executable directory are an avoidable security risk
You should really address these issues before putting this code into a
production environment.
Espero que isto lhe ajude.
--
Peter Hill,
Modulus Pty. Ltd.,
http://www.modulus.com.au/
------------------------------
Date: Mon, 24 Apr 2000 22:47:23 -0500
From: Sid Mal <sid@eurekanet.com>
Subject: Re: I'm about to lose a client!!! SOMEBODY HELP ME!!!
Message-Id: <39050747$0$35177@news.eurekanet.com>
Try to compile the program in your shell instead of executing it through
the web server. You might get better error reporting by the system.
Sid.
Lobo wrote:
>
> Please, it can't be THAT hard...
>
> I'm trying to display the contents of a Pipe Separeted Values TXT file
> to a page, but I keep receiving Internal Server Errors!!!!
>
> Here's my COMPLETE code:
>
> #!/usr/bin/perl
>
> $temp=$ENV{'QUERY_STRING'};
> @pairs=split(/&/,$temp);
> foreach $item(@pairs) {
> ($key,$content)=split (/=/,$item,2);
> $content=~tr/+/ /;
> $content=~ s/%(..)/pack("c",hex($1))/ge;
> $fields{$key}=$content;
> }
>
> $txt = $fields{'file'}.".txt";
>
> print "Content-type:text/html\n\n";
>
> open (TXT, '$txt');
> @array = <TXT>;
> foreach $line(@array) {
> chomp($line);
> print "$line\n";
> }
> close (TXT);
>
> This should, I guess, display the contents WITH the pipes... but it
> doesn't work.
>
> And please folks, if you cand be this kind to me, explain how to
> remove the pipes too, PLEASE!
>
> It has something to do with "=~tr/|/ /;", right???
>
> PLEAAAASE!!!!!!!
------------------------------
Date: Tue, 25 Apr 2000 06:24:50 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: I'm about to lose a client!!! SOMEBODY HELP ME!!!
Message-Id: <sgaehinocdo178@corp.supernews.com>
Lobo (er@matrix.com.br) wrote:
: Please, it can't be THAT hard...
It's not. Read the doc, read this newsgroup. The errors in your code are
mostly things discussed daily here.
: I'm trying to display the contents of a Pipe Separeted Values TXT file
: to a page, but I keep receiving Internal Server Errors!!!!
If you used CGI.pm, you could easily test it from the command line. Or
CGI::Carp would let you send fatal errors as valid pages to the browser.
: Here's my COMPLETE code:
:
: #!/usr/bin/perl
Opinions differ on whether -w should be used on production code. I like
making my code -w clean, so I leave it in. Ditto 'use strict'. These let
the compiler find your problems rather than letting them become runtime
errors.
: $temp=$ENV{'QUERY_STRING'};
: @pairs=split(/&/,$temp);
: foreach $item(@pairs) {
: ($key,$content)=split (/=/,$item,2);
: $content=~tr/+/ /;
: $content=~ s/%(..)/pack("c",hex($1))/ge;
: $fields{$key}=$content;
: }
Proper indentation and a little vertical whitespace here and there would
make that easier to read -- and hence easier to debug. Also, you're
reinventing the CGI.pm wheel here.
: $txt = $fields{'file'}.".txt";
:
: print "Content-type:text/html\n\n";
For this kind of output, you probably want text/plain instead.
: open (TXT, '$txt');
You don't check the return value of open, which is why you didn't find out
you were trying to open a file call $txt. Single quotes don't interpolate
variables.
: @array = <TXT>;
: foreach $line(@array) {
: chomp($line);
: print "$line\n";
: }
Why do you chomp the newline off, then print it back on? Also, this whole
thing could be rewritten as
print <TXT>;
If your concern is that the whole file might not fit into memory, do
print while <TXT>
instead.
: close (TXT);
:
: This should, I guess, display the contents WITH the pipes... but it
: doesn't work.
Nope. How did you get into a position of being contracted to do this?
: And please folks, if you cand be this kind to me, explain how to
: remove the pipes too, PLEASE!
:
: It has something to do with "=~tr/|/ /;", right???
Have you tried that in a small example program? My guess is you actually
want split, but that depends on your application.
--
| Craig Berry - cberry@cinenet.net
--*-- http://www.cinenet.net/users/cberry/home.html
| "The road of Excess leads to the Palace
of Wisdom" - William Blake
------------------------------
Date: Mon, 24 Apr 2000 18:09:47 -0700
From: Makarand Kulkarni <makarand_kulkarni@My-Deja.com>
Subject: Re: man2html
Message-Id: <3904F05B.120025D5@My-Deja.com>
> Has anyone else gotten this perl script to work?
yes. I got it to work. It works !!
--
------------------------------
Date: Tue, 25 Apr 2000 02:05:23 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: Oracle DBI DBM memory leak
Message-Id: <D37N4.66396$hT2.294390@news1.rdc1.ct.home.com>
taric@purpletunic.com wrote:
> Hi. I may have found a memory leak in DBI or DBM:Oracle,
> has anyone else run into this?
> My system is: DEC Alpha, Perl version 5.004_04, and
> Oracle 8.0.5.
What OS? VMS? OSF/1? Digital Unix? Tru64? Linux?
Also, what version of DBI and DBD::Oracle?
> I wrote a program to test and illustrate the problem. It is
> just a continuous loop that connects and disconnects with Oracle.
> Memory use appears to start at 23M and then increase about 1M every
> 5 seconds. Eventually it crashes the machine of course.
This may well be problems in most of the components involved here. Make
sure you're at the latest version of DBI and DBD::Oracle and go from
there. Given the magnitude of the leak I'd guess it's probably in the
Oracle or DBD::Oracle code, but it's tough to be sure.
If this is a boiled-down version of a problem you've encountered in
another program, you might want to try and rework your code to reuse
database handles rather than disconnecting and reconnecting. It'll get
around this leak issue, but it'll also make things snappier as making a
connection to Oracle isn't cheap, especially if you're connecting over the
network.
Dan
------------------------------
Date: Mon, 24 Apr 2000 22:44:47 -0500
From: "yoon" <yoonjung@cs.tamu.edu>
Subject: oral perl problem( I can't update table!)
Message-Id: <8e33sp$ngv$1@news.tamu.edu>
I can't update the table. I don't know why.
I could do "select " statment using &ora_open;
$query1= "update $data_DB_Nm set pre_dept='$data{'pre_dept'}',
pre_courseno='$data{'pro_no'}',instructor='$data{'inst_tamu_id'}',
instruid='$data{'inst_logid'}' where courseno = $data{'course_id'} and
sectionno = $data{'course_section'} and term='$semester' and dept =
'$data{'dept'}';";
# I printed the $query1.The content is
update courseData set pre_dept='240', pre_courseno='23',instructor='123455',
instruid='yoonjung' where courseno = 631 and sectionno = 600 and
term='1999C' and dept = 'CPSC';
$csr = &ora_open($lda, $query1) || die $ora_errstr;
warn "$ora_errstr" if $ora_errno;
print "MIDDLE OPEN<br>";
&ora_close($csr) || die $ora_errstr;
I executed "sql command that is the value of $query1" manually.It works.
So i don't know why it does not work.
Thanks!
------------------------------
Date: Tue, 25 Apr 2000 02:09:07 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: Out of memory!
Message-Id: <777N4.66397$hT2.294390@news1.rdc1.ct.home.com>
vinman72@my-deja.com wrote:
> $contents = \0;
> $newcontents = \0;
This sets both of these variables to references to the constant zero. You
probably didn't want to do that.
> binmode <COLL>;
This reads in a line from the filehandle COLL and uses it as a symbolic
reference for a filehandle name and binmodes *that* file. So basically
here you just created a variable with a name ~35M long.
Don't do that.
> $contents = <COLL>;
This may well have done nothing--it's likely empty since you set $/ to
undef, so the first read (which was used to binmode) slurped the whole
file in.
Fix those two problems and you might find things work a bit better.
Dan
------------------------------
Date: Tue, 25 Apr 2000 02:30:52 GMT
From: Elaine Ashton <elaine@chaos.wustl.edu>
Subject: Re: Out of memory!
Message-Id: <B52A7BDA.2F9B%elaine@chaos.wustl.edu>
in article Pine.GSO.4.10.10004241550470.25963-100000@user2.teleport.com, Tom
Phoenix at rootbeer@redcat.com quoth:
>> $contents = \0;
>> $newcontents = \0;
>
> "I do not think that means what you think it means."
Certainly it gets one of the more interesting uses of anonymous scalars.
Try 'perldoc perlopentut' paying special attention to 'while(<>)'.
e.
------------------------------
Date: 25 Apr 2000 06:08:23 GMT
From: msouth@fulcrum.org
Subject: Re: Perl & Fortran
Message-Id: <8e3con$9q6$1@inxs.ncren.net>
Logean Antoine <alogean@pharma.ethz.ch> wrote:
> Hy,
[snip]
> format-parameters. The third one is the file to be formated). The source
> code of the Fortran program looks like :
>
> PROGRAM PDBGEN
> DOUBLE PRECISION CD
> CHARACTER*80 FILNAM
> C
> C ----- PROGRAM TO OUTPUT THE DYNAMICS COORDINATES IN PDB
> C FORM FOR SPECIFIED NUMBER OF INTERVALS -----
> C
> DIMENSION C(60000),IGRAPH(20000),IPRES(5000),LBRES(5000)
> DIMENSION ITITL(20)
> C
> 9008 FORMAT(//5X,'PROGRAM TO OUTPUT PDB FILES FROM',
> 1 /5X,'THE MINIMISATION OR DYNAMICS RUN',/)
> 9028 FORMAT(/2X,'Input Topology File> ',$)
> 9308 FORMAT(/2X,'Is topology file binary(0) or formatted(1)?> ',$)
> 9318 FORMAT(/2X,'Is Amber coordinate file binary(0) or formatted(1)?>
> ',$)
[snip]
> thanks
No, thank you! Thank you for reminding all of us former fortran
programmers what a beautiful language we're using now....
:)
--
Michael South | http://fulcrum.org
Head Mathophile, | 101 Canyon Run
fulcrum.org | Cary NC 27513 USA
(msouth@fulcrum.org) | (919) 465-9074
------------------------------
Date: Tue, 25 Apr 2000 01:49:14 GMT
From: Pierre Turmel <pturmel@synapse.net>
Subject: Perl Install on NT Wrokstation
Message-Id: <3904F95A.C80DC158@synapse.net>
Hello,
I have a problem and I wonder If somebody has a clue.
I try to install a directory software system on my machine (Windows NT
4.0 Workstation, SP5, French), and each time the install software
reaches the Perl part, perl.exe runs into a problem, and NT gives me a
system error with this message:
«An invalid parameter was passed as third argument to the service or the
function.»
Does anybody have a clue? Is this Perl or NT related?
Thanks.
Pierre Turmel
pturmel@synapse.net
------------------------------
Date: Mon, 24 Apr 2000 18:57:08 -0700
From: Tom Phoenix <rootbeer@redcat.com>
Subject: Re: Perl Install on NT Wrokstation
Message-Id: <Pine.GSO.4.10.10004241855320.25963-100000@user2.teleport.com>
On Tue, 25 Apr 2000, Pierre Turmel wrote:
> «An invalid parameter was passed as third argument to the service or
> the function.»
>
> Does anybody have a clue? Is this Perl or NT related?
Doesn't sound like a Perl error message; it's way too vague! Perl's error
messages are listed in the perldiag manpage. I'd suspect your message
coming from somewhere else. Cheers!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 25 Apr 2000 05:14:20 GMT
From: David Ness <DNess@Home.Com>
Subject: Re: Perl Install on NT Wrokstation
Message-Id: <390529AE.BF8538F4@Home.Com>
Pierre Turmel wrote:
>
> Hello,
>
> I have a problem and I wonder If somebody has a clue.
>
> I try to install a directory software system on my machine (Windows NT
> 4.0 Workstation, SP5, French), and each time the install software
> reaches the Perl part, perl.exe runs into a problem, and NT gives me a
> system error with this message:
>
> «An invalid parameter was passed as third argument to the service or the
> function.»
>
> Does anybody have a clue? Is this Perl or NT related?
>
You might indicate which version of perl you are attempting to install and
you might be more clear when you say
` each time the install software reaches the perl part, perl.exe runs
into a problem'
This is too vague to be of any use (to me, at least) in trying to help.
Offhand I'd say it is neither Perl nor NT related, but more likely `Installer'
related, but definite word on that awaits more detail on what your problem
actually looks like.
------------------------------
Date: Mon, 24 Apr 2000 21:09:57 -0400
From: "Brian Gordon" <administrator@westelcom.com>
Subject: Perl on NT anyone?
Message-Id: <3904f1aa@news.westelcom.com>
Hey anyone got a FAQ/ or newbie instructions for setting up Perl on a NT
machine with IIS 4 running?
Thanks,
Brian Gordon
Supervisor Of Internet Operations
Westelcom Family of Companies
http://www.westelcom.com
fla5h2001@spamcop.net
"We will exceed our customers' expectations in providing
competitively priced, superior quality, state-of-the-art
communications and information services."
------------------------------
Date: Mon, 24 Apr 2000 18:08:48 -0700
From: Makarand Kulkarni <makarand_kulkarni@My-Deja.com>
Subject: Re: Perl on NT anyone?
Message-Id: <3904F01F.4B00FB7F@My-Deja.com>
> Hey anyone got a FAQ/ or newbie instructions for setting up Perl on a NT
> machine with IIS 4 running?
http://www.activestate.com/
------------------------------
Date: Tue, 25 Apr 2000 05:16:02 GMT
From: David Ness <DNess@Home.Com>
Subject: Re: Perl on NT anyone?
Message-Id: <39052A14.D7E9998C@Home.Com>
Makarand Kulkarni wrote:
>
> > Hey anyone got a FAQ/ or newbie instructions for setting up Perl on a NT
> > machine with IIS 4 running?
>
> http://www.activestate.com/
Yes, and read the instructions _carefully_ as the install procedure has
changed quite recently and several installers have gone wrong by `
thinking they knew what they were doing when actually things have changed.
------------------------------
Date: Tue, 25 Apr 2000 08:05:04 +0200
From: "Björn Comhaire" <bjorn@xfertipro.com>
Subject: Running script from hyperlink ?
Message-Id: <8e3cgr$a7j$1@news0.skynet.be>
Hi,
Does anyone know how to run a cgi script (using POST) from a simple
hyperlink in stead of some kind of input field ?
Thanks for the help,
Björn
--
________________________________
Björn Comhaire
FertiPro N.V. - Your partner in IVF and ART
www.fertipro.com
------------------------------
Date: Mon, 24 Apr 2000 18:07:54 -0700
From: Makarand Kulkarni <makarand_kulkarni@My-Deja.com>
Subject: Re: SQL get values by column name?
Message-Id: <3904EFEA.D9C4ED09@My-Deja.com>
> How can I do the same in perl? Get the results from the select by column name
> not $row[0] as I usually do.
check the documentation for DBI
The function you need is fetchrow_hashref ()
--
------------------------------
Date: Mon, 24 Apr 2000 18:08:40 -0700
From: Jeff Zucker <jeff@vpservices.com>
Subject: Re: SQL get values by column name?
Message-Id: <3904F018.CEA64511@vpservices.com>
Ken Williams wrote:
>
> The following is in PHP I think:
>
> <?
> $sql_result = mysql_query($sql,$connection)
> or die("Couldn't execute query");
>
> while ($row = mysql_fetch_array($sql_result)) {
> // more code here
> }
>
> $coffee_name = $row["COFFEE_NAME"];
> $roast_type = $row["ROAST_TYPE"];
> $quantity = $row["QUANTITY"];
> ?>
>
> How can I do the same in perl? Get the results from the select by column name
> not $row[0] as I usually do.
Well you didn't mention what database you are using or what $row[0]
refers to in what script, but let's assume it is something accessible by
DBI, which most are. There are several ways, here's one:
my $dbh = DBI->connect(your-connection-info);
my $sth = $dbh->prepare(your-query);
$sth->execute(your-params);
while(my $row = $sth->fetchrow_hashref) {
print $row->{COFFEE_NAME}, " ", $row->{ROAST_TYPE}, "\n"
# whatever else you want to do with data from that row
}
you could also do while(my($COFFEE_NAME,$ROAST_TYPE) =
$sth->fetchrow_array) or use bind_columns (see the DBI docs).
--
Jeff
--
Jeff
------------------------------
Date: 24 Apr 2000 23:51:28 EDT
From: gene <gene01@smalltime.com>
Subject: undefined value as a symbol reference
Message-Id: <gene01-FF615A.20512824042000@news.concentric.net>
I'm puzzled by a little perl module of mine. It's been working
fine until I transferred it to a different computer running
a slightly newer version of perl (_05 instead of _02 I think).
The module is used to create html output based on template files.
The problem I'm getting is with the filehandle that gets saved
be the module so that successive parts of the input file can
be read at different times. Checking the syntax of a script
which calls this module produces this error:
Can't use an undefined value as a symbol reference at HTMLTemplate.pm
line 31
The line in question is indicated below. Checking the syntax
of this module alone produces no errors. I've tried re-writing
this to use FileHandle.pm and that just gives me different errors.
The best I've been able to get after several tries at rewriting
the code is a general 'module doesn't return true' error.
Here is the code with some bits removed for clarity:
#!/usr/bin/perl -w
package HTMLTemplate;
use strict;
use vars qw($TOKEN_SYMBOL $TXT_FILE $fh);
$TOKEN_SYMBOL = "%";
$TXT_FILE = "";
sub new { ... }
sub start {
my $this = shift;
$TXT_FILE = shift or return 0;
open ( FH, $TXT_FILE )or return 0;
$fh = \*FH;
return 1;
}
subparseNext {
my $lines = "";
my $token = "";
if (eof($fh)) { # <--- error here
close $fh;
return "";
}
while (<$fh>) { ... }
return $lines;
}
1;
__END__
--
------------------------------
Date: Tue, 25 Apr 2000 06:01:21 GMT
From: jlamport@calarts.edu
Subject: Re: using CPAN: what's all this junk!?
Message-Id: <8e3cbe$an4$1@nnrp1.deja.com>
In article <slrn8g8rfi.n77.elaine@chaos.wustl.edu>,
elaine@chaos.wustl.edu (Elaine -HFB- Ashton) wrote:
> In article <8e0sac$o17$1@nnrp1.deja.com>, jlamport@calarts.edu wrote:
> >I just used CPAN for the first time. It seems to have worked, but now I
> >want to know: what are all of these extra files and directories that got
>
> 'perldoc CPAN' should explain how it works quite nicely.
>
> e.
>
Actually, I *read* perldoc CPAN, and it doesn't really answer my
questions. I mean, after installing the modules, there are probably 30+
directories and 100+ files in my account that weren't there before. Most
of them I haven't the foggiest clue what they have to do with the modules
I just installed. As I said, the install worked, I can use the modules
just fine -- that's not my problem. My problem is, for example: what the
hell are all these .3pm files that got installed in ~/.cpan/build/IO-
stringy-1.207/blib/man3/ and do I really need them? And why did the
modules appear to have gotten installed in two different places: one set
in ~/.cpan/build/IO-stringy-1.207/lib/IO/ and one set in ~/.cpan/build/
IO-stringy-1.207/blib/lib/IO/ and are these two sets of files really
identical (as they appear to be) or is there some subtle difference
between them that I'm missing? Do I need both sets, or can I trash one
of the sets? I mean, it *looks* to me like the only files I really need
to keep (for functionality) are those in ~/.cpan/build/IO-stringy-1.207/
lib/ , but I could be wrong. I was *hoping* that someone might point me
to some documentation that would explain these things in a little more
detail.
While, with all the dumb questions that get posted here, I understand the
temptation to respond to every post with RTFperldocM -- there are,
believe it or not, a lot of questions that the perldoc *doesn't* answer.
That's why they invented newsgroups.
-jason
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 25 Apr 2000 06:23:37 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: using CPAN: what's all this junk!?
Message-Id: <slrn8gaef9.34e.sholden@pgrad.cs.usyd.edu.au>
On Tue, 25 Apr 2000 06:01:21 GMT, jlamport@calarts.edu wrote:
>In article <slrn8g8rfi.n77.elaine@chaos.wustl.edu>,
> elaine@chaos.wustl.edu (Elaine -HFB- Ashton) wrote:
>> In article <8e0sac$o17$1@nnrp1.deja.com>, jlamport@calarts.edu wrote:
>> >I just used CPAN for the first time. It seems to have worked, but now I
>> >want to know: what are all of these extra files and directories that got
>>
>> 'perldoc CPAN' should explain how it works quite nicely.
>>
>> e.
>>
>
>Actually, I *read* perldoc CPAN, and it doesn't really answer my
>questions. I mean, after installing the modules, there are probably 30+
>directories and 100+ files in my account that weren't there before. Most
>of them I haven't the foggiest clue what they have to do with the modules
>I just installed. As I said, the install worked, I can use the modules
>just fine -- that's not my problem. My problem is, for example: what the
>hell are all these .3pm files that got installed in ~/.cpan/build/IO-
>stringy-1.207/blib/man3/ and do I really need them?
From perldoc CPAN:
Currently the cache manager only keeps track of the build
directory ($CPAN::Config->{build_dir}). It is a simple FIFO
mechanism that deletes complete directories below build_dir
as soon as the size of all directories there gets bigger
than $CPAN::Config->{build_cache} (in MB). The contents of
this cache may be used for later re-installations that you
intend to do manually, but will never be trusted by CPAN
itself. This is due to the fact that the user might use
these directories for building modules on different archi-
tectures.
Assumming you didn't actually set the install location to ~/.cpan/build and
didn't change to many of the default set up options then ~/.cpan/build is the
value of $CPAN::Config->{build_dir}. The CPAN module will delete the stuff
at some point, you can delete it too. It should be noted that some modules
(Tk comes to mind) have lots of demo scripts that don't get moved out of the
build directory (to my knowledge anyway) and thus disappear unless you copy
them.
In summary - you should be able to delete everything in the build subdirectory,
unless you did strange (and bad) things with your install prefix...
--
Sam
Many modern computer languages aspire to be minimalistic. They either
succeed in being minimalistic, in which case they're relatively useless,
or they don't succeed in being truly minimalistic, in which case you can
actually solve real problems with them. --Larry Wall
------------------------------
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 2857
**************************************