[19962] in Perl-Users-Digest
Perl-Users Digest, Issue: 2157 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 19 18:06:07 2001
Date: Mon, 19 Nov 2001 15:05:12 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <1006211112-v10-i2157@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 19 Nov 2001 Volume: 10 Number: 2157
Today's topics:
Re: (Newbie question) Premature end of script headers <wrightkevin@ntlworld.com>
Re: (Newbie question) Premature end of script headers <godzilla@stomp.stomp.tokyo>
Re: (Newbie question) Premature end of script headers a <echang@netstorm.net>
Re: (Newbie question) Premature end of script headers a <comdog@panix.com>
An optional output filter/pager module? <scs@di.org>
Re: An optional output filter/pager module? <rereidy@indra.com>
Error Fetching Long Column Using Perl DBI <asolleti@cisco.com>
Re: Error Fetching Long Column Using Perl DBI <rereidy@indra.com>
Re: Find files?? <jurgenex@hotmail.com>
gtk perl and fork... ? <slegros@mandrakesoft.com>
Re: Handling browser windows. <jurgenex@hotmail.com>
Re: How do I extract the rest of a string when encounte <krahnj@acm.org>
How do I extract the rest of a string when encounter a (ThichTatCa)
Re: How do I extract the rest of a string when encounte <pix@yahoo.it>
Re: How do I extract the rest of a string when encounte <rsherman@ce.gatech.edu>
Re: How do I extract the rest of a string when encounte (Tad McClellan)
Re: How do I extract the rest of a string when encounte <5l259r001@sneakemail.com>
Re: How do I extract the rest of a string when encounte <Tassilo.Parseval@post.rwth-aachen.de>
How to Insert Value in Long Columns of Oracle Table <asolleti@cisco.com>
How to load my configuration setting from a file ? <robert_loui@yahoo.com>
Re: How to load my configuration setting from a file ? <rereidy@indra.com>
Re: How to load my configuration setting from a file ? <robert_loui@yahoo.com>
Re: How to load my configuration setting from a file ? (Owain McGuire)
Re: How to load my configuration setting from a file ? <5l259r001@sneakemail.com>
moving modules on Windows (John Menke)
Re: New user question (Richard J. Rauenzahn)
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 19 Nov 2001 16:12:26 -0000
From: "wrightkevin" <wrightkevin@ntlworld.com>
Subject: Re: (Newbie question) Premature end of script headers arggggggggggggggggg!
Message-Id: <KbaK7.16939$9Q4.2770243@news2-win.server.ntlworld.com>
Hi Josef
I tried this:
File is called s4.cgi
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "<html>";
print "<body>";
print "They dont get much simpler than this";
print "</body>";
print "</html>";
With the resulting error log.
[Mon Nov 19 08:03:55 2001] [error] [client 62.252.0.5] Premature end of
script headers: /data/wrightkevin/s4.cgi
[Mon Nov 19 08:03:55 2001] [error] [client 62.252.0.5] MOD_VR9: Error 500
occured while processing : /data/wrightkevin/s4.cgi
[Mon Nov 19 08:04:17 2001] [error] [client 62.252.0.5] Premature end of
script headers: /data/wrightkevin/cgi-bin/s4.cgi
[Mon Nov 19 08:04:17 2001] [error] [client 62.252.0.5] MOD_VR9: Error 500
occured while processing : /data/wrightkevin/cgi-bin/s4.cgi
[Mon Nov 19 08:07:54 2001] [error] [client 62.252.0.5] Premature end of
script headers: /data/wrightkevin/s4.cgi
"Josef Möllers" <josef.moellers@fujitsu-siemens.com> wrote in message
news:3BF8D543.C6840EA6@fujitsu-siemens.com...
wrightkevin wrote:
>
> Hi,
>
> Apologies if this is the wrong group.
>
> I've tried to write the simplest perl cgi-script I could come up with
> I have transferred it in ascii mode. Think the permissions are ok!
>
> Here is the code:
>
> #!/usr/bin/perl
> print "Content-type: text/html\n\n";
> print "They dont get much simpler than this";
>
> Here is the error log:
>
> [Mon Nov 19 00:13:15 2001] [error] [client 62.252.0.5] Premature end of
> script headers: /data/wrightkevin/s2.pl
> [Mon Nov 19 00:13:15 2001] [error] [client 62.252.0.5] MOD_VR9: Error 500
> occured while processing : /data/wrightkevin/s2.pl
> [Mon Nov 19 00:13:29 2001] [error] [client 62.252.0.5] Premature end of
> script headers: /data/wrightkevin/s2.pl
> [Mon Nov 19 00:13:29 2001] [error] [client 62.252.0.5] MOD_VR9: Error 500
> occured while processing : /data/wrightkevin/s2.pl
> [Mon Nov 19 00:14:31 2001] [error] [client 62.252.0.5] Premature end of
> script headers: /data/wrightkevin/cgi-bin/s2.pl
> [Mon Nov 19 00:14:31 2001] [error] [client 62.252.0.5] MOD_VR9: Error 500
> occured while processing : /data/wrightkevin/cgi-bin/s2.pl
> [Mon Nov 19 00:33:07 2001] [error] [client 62.252.0.5] Premature end of
> script headers: /data/wrightkevin/cgi-bin/s2.pl
> [Mon Nov 19 00:33:07 2001] [error] [client 62.252.0.5] MOD_VR9: Error 500
> occured while processing : /data/wrightkevin/cgi-bin/s2.pl
> [Mon Nov 19 00:41:58 2001] [error] [client 62.252.0.5] Premature end of
> script headers: /data/wrightkevin/cgi-bin/s2.pl
> [Mon Nov 19 00:41:58 2001] [error] [client 62.252.0.5] MOD_VR9: Error 500
> occured while processing : /data/wrightkevin/cgi-bin/s2.pl
I'm no HTML expert, but what your program outputs doesn't really look
html to me. I'm missing the usual tags:
<html>
<head>
</head>
<body>
</body>
</html>
Since the error message complains about a premature end of script
header, you might try to output the necessary tags.
HTH,
--
Josef Möllers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize
-- T. Pratchett
------------------------------
Date: Mon, 19 Nov 2001 13:34:11 -0800
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: (Newbie question) Premature end of script headers arggggggggggggggggg!
Message-Id: <3BF97AD3.DB1F18D4@stomp.stomp.tokyo>
brian d foy wrote:
> Godzilla! wrote:
> > brian d boy unknowingly wrote in a different group:
> > > Godzilla! wrote:
> > > > brian d boy wrote:
> *plonk*
Ostrich Syndrome.
Godzilla!
------------------------------
Date: Mon, 19 Nov 2001 16:54:27 GMT
From: "E.Chang" <echang@netstorm.net>
Subject: Re: (Newbie question) Premature end of script headers arggggggggggggggggg!
Message-Id: <Xns915E7A2F7F5ABechangnetstormnet@207.106.92.86>
[posted and mailed]
"wrightkevin" <wrightkevin@ntlworld.com> wrote in
news:Ow3K7.16656$%p4.2101124@news6-win.server.ntlworld.com:
> Hi,
>
> Apologies if this is the wrong group.
(Apologies to the group for perpetuating off-topic thread. Kevin
switched to ciwac but I have been unsuccesful in replying there.)
> I've tried to write the simplest perl cgi-script I could come up
> with I have transferred it in ascii mode. Think the permissions are
> ok!
>
> Here is the code:
>
>#!/usr/bin/perl
> print "Content-type: text/html\n\n";
> print "They dont get much simpler than this";
>
> Here is the error log:
>
> [Mon Nov 19 00:13:15 2001] [error] [client 62.252.0.5] Premature
> end of script headers: /data/wrightkevin/s2.pl
[duplicates snipped]
> I have tried ftp'ing the file to home home and home/cgi-bin
> directories. (No difference)
>
> I have looked up this error on google and elsewhere and have found
> that I am not the first programmer to encounter this message but I
> am still none the wiser.
"Premature end of script headers:" is a generic server error message
indicating that the server did not receive the Content-type header line
as the very first output from the script. Since you are printing the
line correctly (although your output is more accurately described as
text/plain, not text/html), it most likely means some sort of error
message is being sent before it receives the line.
Can you log into a shell on the server? (You mention trying perl -c,
so it would seem so.) Test running your program from the command line
with the command "./scriptname" to find out if the shebang line giving
the location of the Perl interpreter is correct - if it's not you'll
get an error.
Assuming the location is indeed /usr/bin/perl, then there is something
wrong with the end of line on that line, suggesting that it did not get
uploaded correctly. (You can type "which perl" to double-check the
correct location.) I have heard that some FTP clients do not always
handle ASCII mode upload correctly, though I"ve not had that experience
myself. In this case you can a) use a different FTP client, b) use an
editor that will save the file with the correct end of line, or c) edit
the file on the remote host.
If the program runs from the command line when invoked directly, then
there may some sort of problem with permissions.
--
EBC
------------------------------
Date: Mon, 19 Nov 2001 14:02:08 -0600
From: brian d foy <comdog@panix.com>
Subject: Re: (Newbie question) Premature end of script headers arggggggggggggggggg!
Message-Id: <comdog-7148F0.14020819112001@news.panix.com>
In article <3BF8F985.FD568654@stomp.stomp.tokyo>, "Godzilla!"
<godzilla@stomp.stomp.tokyo> wrote:
> brian d boy unknowingly wrote in a different group:
>
> > Godzilla! wrote:
> > > brian d boy wrote:
> > > > > Apologies if this is the wrong group.
> > > > indeed it is. try comp.infosystems.www.authoring.cgi :)
> > > The cgi group auto-bot is still screwed up. One of
> > > its more noticable problems is sending posts to
> > > Never Never Land rather than propagating them.
> > it has been fixed for awhile. indeed, your post showed up there
> This is untrue as evidenced by recent articles between
> Ms. King and myself discussing this problem I cite.
> She has indicated no resolution for this problem.
well, your posts show up. mine show up. other people's
post show up. deny reality all you like.
*plonk*
--
brian d foy <comdog@panix.com> - Perl services for hire
CGI Meta FAQ - http://www.perl.org/CGI_MetaFAQ.html
Troubleshooting CGI scripts - http://www.perl.org/troubleshooting_CGI.html
------------------------------
Date: 19 Nov 2001 18:49:25 GMT
From: Steve Simmons <scs@di.org>
Subject: An optional output filter/pager module?
Message-Id: <3bf95435$0$20896$724ebb72@reader2.ash.ops.us.uu.net>
I've run thru CPAN and the FAQs and the cookbook and not found it.
Clearly I'm missing something... :-)
I'm looking for a module or hack that will let me push a pager onto
a data stream (STDOUT, usually) that will let the stock print/printf
functions continue to work as they had previously. Thus a code fragment
like
if ( $pager ) {
# user wants a pager imposed
magic_function( STDOUT, $ENV{PAGER} ? $ENV{PAGER} : "less" );
}
print "This goes to stdout (pager if actived)\n";
print STDOUT "This goes to stdout (pager if actived)\n";
printf "Formats? %s don't need no stinking formats!\n", $user;
printf STDERR "Pagers? We can bypass the pager if our shell is good!\n";
And so on. Any ideas? Remember, the two points here are *optional*
(which lets out IO::Page), and properly works with STDOUT.
--
`Have you noticed that, when we were young, we were told that "everybody
else is doing it" was a really stupid reason to do something, but now it's
the standard reason for picking a particular software package?' -- Barry Gehm
------------------------------
Date: Mon, 19 Nov 2001 13:52:48 -0700
From: Ron Reidy <rereidy@indra.com>
Subject: Re: An optional output filter/pager module?
Message-Id: <3BF97120.8239E05A@indra.com>
Steve Simmons wrote:
>
> I've run thru CPAN and the FAQs and the cookbook and not found it.
> Clearly I'm missing something... :-)
>
> I'm looking for a module or hack that will let me push a pager onto
> a data stream (STDOUT, usually) that will let the stock print/printf
> functions continue to work as they had previously. Thus a code fragment
> like
>
> if ( $pager ) {
> # user wants a pager imposed
> magic_function( STDOUT, $ENV{PAGER} ? $ENV{PAGER} : "less" );
> }
> print "This goes to stdout (pager if actived)\n";
> print STDOUT "This goes to stdout (pager if actived)\n";
> printf "Formats? %s don't need no stinking formats!\n", $user;
> printf STDERR "Pagers? We can bypass the pager if our shell is good!\n";
>
> And so on. Any ideas? Remember, the two points here are *optional*
> (which lets out IO::Page), and properly works with STDOUT.
> --
> `Have you noticed that, when we were young, we were told that "everybody
> else is doing it" was a really stupid reason to do something, but now it's
> the standard reason for picking a particular software package?' -- Barry Gehm
There is a very simple module in Object Oriented Perl by Damian Conway
that does this. Buy the book - it is worth every cent!
--
Ron Reidy
Oracle DBA
Reidy Consulting, L.L.C.
------------------------------
Date: Mon, 19 Nov 2001 11:32:55 -0800
From: Arun Solleti <asolleti@cisco.com>
Subject: Error Fetching Long Column Using Perl DBI
Message-Id: <3BF95E67.8DBBF383@cisco.com>
Hi
Can some please help me, how to fetch the value of Long Column using
Perl DBI.
Table Info
-------------
Table Name : LONGTABLE
Table Columns : long_name VARCHAR2(30)
long_value LONG
Script
--------------
$query = "select long_value from longtable" ;
$sth = $dbh->prepare($query, ) || die $dbh->errstr ;
$sth->execute() ;
Error
---------
DBD::Oracle::st fetchrow_array failed: ORA-01406: fetched column value
was truncated (DBD: ofetch error on field 1 (of 1), ora_type 8,
LongReadLen too small and/or LongTruncOk not set) at test.pl line 23.
Thanks
Arun
------------------------------
Date: Mon, 19 Nov 2001 13:54:11 -0700
From: Ron Reidy <rereidy@indra.com>
Subject: Re: Error Fetching Long Column Using Perl DBI
Message-Id: <3BF97173.29041424@indra.com>
Arun Solleti wrote:
>
> Hi
>
> Can some please help me, how to fetch the value of Long Column using
> Perl DBI.
>
> Table Info
> -------------
> Table Name : LONGTABLE
> Table Columns : long_name VARCHAR2(30)
> long_value LONG
>
> Script
> --------------
> $query = "select long_value from longtable" ;
> $sth = $dbh->prepare($query, ) || die $dbh->errstr ;
> $sth->execute() ;
>
> Error
> ---------
> DBD::Oracle::st fetchrow_array failed: ORA-01406: fetched column value
> was truncated (DBD: ofetch error on field 1 (of 1), ora_type 8,
> LongReadLen too small and/or LongTruncOk not set) at test.pl line 23.
>
> Thanks
> Arun
Did you read the DBI docs? Look for LongTruncOK.
--
Ron Reidy
Oracle DBA
Reidy Consulting, L.L.C.
------------------------------
Date: Mon, 19 Nov 2001 12:27:37 -0800
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Find files??
Message-Id: <3bf96ba5@news.microsoft.com>
"Donavon" <djlerman@yahoo.com> wrote in message
news:97ba267a.0111151449.736bf37e@posting.google.com...
> How can I do the following on a win32 system? I found a reference to
> a module called 'FILE::FIND' but a could not find it anywhere...
It's called "File::Find" and can be found on CPAN, of course.
http://search.cpan.org/search?mode=module&query=File%3A%3AFind
jue
------------------------------
Date: Mon, 19 Nov 2001 18:40:50 +0100
From: slegros <slegros@mandrakesoft.com>
Subject: gtk perl and fork... ?
Message-Id: <9tbg5u$nhc$1@alliance.mandrakesoft.com>
Hello.
I search to make a small front-end whith gtk-perl.
I'd like to call an application from the front-end whithout
freezing the front-end. I've tried whith a fork() but when
child die, the gtk front-end dies also.
Is-there a gtk-perl function that permit me to call a sub function
in background and detect the end of this sub function ?
Merci.
--
slegros@mandrakesoft.com - legros_s@epitech.net
Samuel Legros - {epitech}. - Promotion 2005
------------------------------
Date: Mon, 19 Nov 2001 12:31:22 -0800
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Handling browser windows.
Message-Id: <3bf96cec@news.microsoft.com>
"Spidah" <hamilton@nospam.ihug.co.nz> wrote in message
news:9t9p17$7g5$1@lust.ihug.co.nz...
> Is there a way to close a browser window with perl?
>
> My webpage opens a popup window. My perl script is run when a user clicks
> the submit button on this popup window. Can I close the popup from my perl
> script after it has finished doing its job?
If the Perl script is running locally then you may want to check Win32::API.
However, if this is a stealth CGI question then please note that the browser
never sees the Perl script and the Perl script has no access to the client
computer whatsoever.
In this case you may want to ask in a CGI or webauthoring NG.
jue
------------------------------
Date: Mon, 19 Nov 2001 22:25:41 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: How do I extract the rest of a string when encounter a specific word?
Message-Id: <3BF986E6.5073E3FE@acm.org>
ThichTatCa wrote:
>
> Hi all,
>
> I've been struggling with this:
>
> myfile.txt
> /usr/local/mysource/root/src/apache/modules
> /usr/local/mysource/root/src/apache/modules/samples
> /usr/local/mysource/root/src/apache/modules/include
> ...
>
> Is there anyway I can extract just whatever beyond "root" to new a $string?
> For example:
> $current string=/usr/local/mysource/root/src/apache/modules/samples
> $new string=root/src/apache/modules/samples
$current_string = '/usr/local/mysource/root/src/apache/modules/samples';
$new_string = substr $current_string, rindex $current_string, 'root/';
John
--
use Perl;
program
fulfillment
------------------------------
Date: 19 Nov 2001 09:14:55 -0800
From: thichtatca@yahoo.com (ThichTatCa)
Subject: How do I extract the rest of a string when encounter a specific word?
Message-Id: <7fb01bbe.0111190914.240cce51@posting.google.com>
Hi all,
I've been struggling with this:
myfile.txt
/usr/local/mysource/root/src/apache/modules
/usr/local/mysource/root/src/apache/modules/samples
/usr/local/mysource/root/src/apache/modules/include
...
Is there anyway I can extract just whatever beyond "root" to new a $string?
For example:
$current string=/usr/local/mysource/root/src/apache/modules/samples
$new string=root/src/apache/modules/samples
Thanks for your help
------------------------------
Date: Mon, 19 Nov 2001 18:42:13 +0100
From: Federico Feroldi <pix@yahoo.it>
Subject: Re: How do I extract the rest of a string when encounter a specific word?
Message-Id: <offbt9.9a91.ln@federico.milano.yahoo.com>
ThichTatCa wrote:
> Is there anyway I can extract just whatever beyond "root" to new a
> $string? For example:
> $current string=/usr/local/mysource/root/src/apache/modules/samples
sure,
$current =~ m/root(.*)$/;
$new = $1;
--
~ Federico Feroldi
yahoo! engineer team
------------------------------
Date: Mon, 19 Nov 2001 17:47:08 +0000 (UTC)
From: Robert Sherman <rsherman@ce.gatech.edu>
Subject: Re: How do I extract the rest of a string when encounter a specific word?
Message-Id: <9tbgis$ghf$2@news-int.gatech.edu>
In article <7fb01bbe.0111190914.240cce51@posting.google.com>, ThichTatCa wrote:
> Hi all,
>
> I've been struggling with this:
>
> myfile.txt
> /usr/local/mysource/root/src/apache/modules
> /usr/local/mysource/root/src/apache/modules/samples
> /usr/local/mysource/root/src/apache/modules/include
> ...
>
>
> Is there anyway I can extract just whatever beyond "root" to new a $string?
> For example:
> $current string=/usr/local/mysource/root/src/apache/modules/samples
> $new string=root/src/apache/modules/samples
>
> Thanks for your help
perl -e '$x="/foo/root/baz/widget/bar";$x =~ /\/.*(root\/.*$)/; print $1."\n";'
--
robert sherman
css, cee
georgia institute of technology
atlanta, ga, usa
------------------------------
Date: Mon, 19 Nov 2001 19:01:59 GMT
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: How do I extract the rest of a string when encounter a specific word?
Message-Id: <slrn9vij4m.gij.tadmc@tadmc26.august.net>
ThichTatCa <thichtatca@yahoo.com> wrote:
>Is there anyway I can extract just whatever beyond "root" to new a $string?
>For example:
> $current string=/usr/local/mysource/root/src/apache/modules/samples
> $new string=root/src/apache/modules/samples
(my $new = $current) =~ s#.*/root/#root/#s;
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Mon, 19 Nov 2001 20:00:09 +0100
From: "Steffen Müller" <5l259r001@sneakemail.com>
Subject: Re: How do I extract the rest of a string when encounter a specific word?
Message-Id: <9tbn08$cs$07$1@news.t-online.com>
"ThichTatCa" <thichtatca@yahoo.com> schrieb im Newsbeitrag
news:7fb01bbe.0111190914.240cce51@posting.google.com...
| Hi all,
|
| I've been struggling with this:
|
| myfile.txt
| /usr/local/mysource/root/src/apache/modules
| /usr/local/mysource/root/src/apache/modules/samples
| /usr/local/mysource/root/src/apache/modules/include
| ...
|
|
| Is there anyway I can extract just whatever beyond "root" to new a
$string?
| For example:
| $current string=/usr/local/mysource/root/src/apache/modules/samples
| $new string=root/src/apache/modules/samples
Hi,
others suggested something along the lines of /root(.*)/; which will match
the first occurance of root and capture everything thereafter.
First, I would suggest looking into the File::Basename module though it
might not be exactly what you're looking for.
You seem to be looking for a way to determine a location within a specified
directory regardless of what's above that directory.
The original approach above would break on
/usr/root/blah/root/src/apacke/modules/samples
and match
/blah/root/src/apacke/modules/samples
instead of the desired
/src/apacke/modules/samples
Unlike some regulars, I'm not a regex master, but what comes to my mind
would be either:
my $match = ( split(/root/, $path) )[-1];
which would split the path at each match of /root/ and take the last
element. The ()'s are there intentionally.
Or
$path =~ s/.*root//;
Which would modify the path inplace.
HTH,
Steffen
--
$_=q;0cb212c210b0bb010c0113bb0c410c0b516c0bb3d212c2b0b0b016b6cb2b2c21010c0
b41110b3bba0e0c0d2c4b2b6bc013d2c0d0b01012b0b0;;s/\n//g;s/(\d)/$1<2?$1:'0'x
$1/ge;s/([a-f])/'1'x(ord($1)-97)/ge;$o=$_;push@o,substr($o,$_*8,8) for(0..
24);for(@o){print"\0"x(26-$i).chr(oct('0b'.($_)))."\r";$i++};print"\n"#stm
------------------------------
Date: Mon, 19 Nov 2001 20:51:10 +0100
From: "Tassilo v. Parseval" <Tassilo.Parseval@post.rwth-aachen.de>
Subject: Re: How do I extract the rest of a string when encounter a specific word?
Message-Id: <9tbnre$vid$06$1@news.t-online.com>
On 19 Nov 2001 09:14:55 -0800, ThichTatCa wrote:
> Is there anyway I can extract just whatever beyond "root" to new a $string?
> For example:
> $current string=/usr/local/mysource/root/src/apache/modules/samples
> $new string=root/src/apache/modules/samples
Others suggested regexes. I think this would be a better job for substr()
along with index():
ethan@ethan:~$ perl
my $s = "/usr/local/mysource/root/src/apache/modules";
my $substring = substr $s, index $s, "root";
print $substring, "\n";
__END__
root/src/apache/modules
As a thumb-rule, one should use substr and/or index if a regex is not
really needed since it is quicker.
Tassilo
--
"You're a creature of the night, Michael. Wait'll Mom hears about this."
-- from the movie "The Lost Boys"
------------------------------
Date: Mon, 19 Nov 2001 11:04:04 -0800
From: Arun Solleti <asolleti@cisco.com>
Subject: How to Insert Value in Long Columns of Oracle Table
Message-Id: <3BF957A3.5813542@cisco.com>
Hi
Would like to know how can i insert value into a long column of my
Oracle Table,
using Perl DBI.
I doing the following :
Table Name : longtable
Table Cols : LONG_NAME Varchar2(100)
LONG_VALUE LONG
Script
-------------------------------------------------
$longname =3D "URL" ;
$longvalue =3D
"http://csee.usf.edu/cgi-bin/testreporter/tpresult.cgi?plName=3D1124\@per=
centOrNum=3Dnumbers\@exPlan1=3D\@hsecName1=3D\#6.0.1\#,\#6.0.2\#,\#6.0.3\=
#,\#6.0.4\#\@tc1=3D\#REDUNC0012M\#,\#REDUNC0013M\#,\#REDUNC0014M\#\@legen=
d=3DPASS\@legend=3DFAIL\@legend=3DBLOCKED\@legend=3DNOTVALID\@legend=3DNO=
TTESTED\@legend=3DDAPROG\@legend=3DUNQEXEC\@legend=3DDWRKONH\@reportType=3D=
Summary\@reportDetial=3DSectionhttp://wwwin-mitte.cisco.com/cgi-bin/testr=
eporter/tpresult.cgi?plName=3D1124\@percentOrNum=3Dnumbers\@exPlan1=3D\@h=
secName1=3D\#6.0.1\#,\#6.0.2\#,\#6.0.3\#,\#6.0.4\#\@tc1=3D\#REDUNC0012M\#=
,\#REDUNC0013M\#,\#REDUNC0014M\#\@legend=3DPASS\@legend=3DFAIL\@legend=3D=
BLOCKED\@legend=3DNOTVALID\@legend=3DNOTTESTED\@legend=3DDAPROG\@legend=3D=
UNQEXEC\@legend=3DDWRKONH\@reportType=3DSummary\@reportDetial=3DSectionht=
tp://wwwin-mitte.cisco.com/cgi-bin/testreporter/tpresult.cgi?plName=3D112=
4\@percentOrNum=3Dnumbers\@exPlan1=3D\@hsecName1=3D\#6.0.1\#,\#6.0.2\#,\#=
6.0.3\#,\#6.0.4\#\@tc1=3D\#REDUNC0012M\#,\#REDUNC0013M\#,\#REDUNC0014M\#\=
@legend=3DPASS\@legend=3DFAIL\@legend=3DBLOCKED\@legend=3DNOTVALID\@legen=
d=3DNOTTESTED\@legend=3DDAPROG\@legend=3DUNQEXEC\@legend=3DDWRKONH\@repor=
tType=3DSummary\@reportDetial=3DSection";
$query =3D "insert into longtable(long_name, long_value) values
('$longname','$longvalue')" ;
$sth =3D runQuery($query, $dbh) ;
-------------------------------------------------
Error
--------
DBD::Oracle::st fetchrow_array failed: ORA-01406: fetched column value
was truncated (DBD: ofetch error on field 1 (of 1), ora_type 8,
LongReadLen too small and/or LongTruncOk not set) at test.pl line 23.
Would like to know how can i insert a long value without truncating it.
Thanks
Arun
------------------------------
Date: Mon, 19 Nov 2001 17:06:02 +0100
From: "Robert" <robert_loui@yahoo.com>
Subject: How to load my configuration setting from a file ?
Message-Id: <9tb9cp$rar$1@newstoo.ericsson.se>
Hi all
I have a program calling many files, and depended on some files located on
different directories. So at the beginig of my program i have some
configuration setting like :
my $MyFiles =$ENV{HOME}."/MyDir";
my @search_path =("/opt/etc", $ENV{HOME}, '.');
push @INC, "$ENV{HOME}/WORK/DATA";
I want to put all these declarations in a separate file and load it when I
am starting my program. But I don't know how can I load these configuration
file. For example how can load these configuration if they were declared in
a file called "myconfig.cfg".
Thanks allot Robert
------------------------------
Date: Mon, 19 Nov 2001 09:23:35 -0700
From: Ron Reidy <rereidy@indra.com>
Subject: Re: How to load my configuration setting from a file ?
Message-Id: <3BF93207.888A87B4@indra.com>
Robert wrote:
>
> Hi all
>
> I have a program calling many files, and depended on some files located on
> different directories. So at the beginig of my program i have some
> configuration setting like :
>
> my $MyFiles =$ENV{HOME}."/MyDir";
> my @search_path =("/opt/etc", $ENV{HOME}, '.');
> push @INC, "$ENV{HOME}/WORK/DATA";
>
> I want to put all these declarations in a separate file and load it when I
> am starting my program. But I don't know how can I load these configuration
> file. For example how can load these configuration if they were declared in
> a file called "myconfig.cfg".
>
> Thanks allot Robert
Look at Config::IniFiles
--
Ron Reidy
Oracle DBA
Reidy Consulting, L.L.C.
------------------------------
Date: Mon, 19 Nov 2001 17:36:43 +0100
From: "Robert" <robert_loui@yahoo.com>
Subject: Re: How to load my configuration setting from a file ?
Message-Id: <9tbb6c$30l$1@newstoo.ericsson.se>
> Look at Config::IniFiles
Hi,
What is Config::IniFiles and where can i find it ?
/Robert
------------------------------
Date: Mon, 19 Nov 2001 19:00:10 GMT
From: owain@nospam.demon.co.uk (Owain McGuire)
Subject: Re: How to load my configuration setting from a file ?
Message-Id: <3bf956a8.349422883@news.demon.co.uk>
http://theoryx5.uwinnipeg.ca/CPAN/data/Config-IniFiles/IniFiles.html#NAME
On Mon, 19 Nov 2001 17:36:43 +0100, "Robert" <robert_loui@yahoo.com>
wrote:
>
>> Look at Config::IniFiles
>
>Hi,
>
>What is Config::IniFiles and where can i find it ?
>
>/Robert
>
>
>
------------------
Owain McGuire owain@nospam.demon.co.uk (Minus the nospam.)
------------------------------
Date: Mon, 19 Nov 2001 20:02:00 +0100
From: "Steffen Müller" <5l259r001@sneakemail.com>
Subject: Re: How to load my configuration setting from a file ?
Message-Id: <9tbn08$cs$07$2@news.t-online.com>
"Robert" <robert_loui@yahoo.com> schrieb im Newsbeitrag
news:9tbb6c$30l$1@newstoo.ericsson.se...
|
| > Look at Config::IniFiles
|
| Hi,
|
| What is Config::IniFiles and where can i find it ?
It is a Perl module and you can find it on the CPAN (Comprehensive Perl
Archive Network) which is *the* great resource of "free" Perl functionality.
Have a look at cpan.org
HTH,
Steffen
--
$_=q;0cb212c210b0bb010c0113bb0c410c0b516c0bb3d212c2b0b0b016b6cb2b2c21010c0
b41110b3bba0e0c0d2c4b2b6bc013d2c0d0b01012b0b0;;s/\n//g;s/(\d)/$1<2?$1:'0'x
$1/ge;s/([a-f])/'1'x(ord($1)-97)/ge;$o=$_;push@o,substr($o,$_*8,8) for(0..
24);for(@o){print"\0"x(26-$i).chr(oct('0b'.($_)))."\r";$i++};print"\n"#stm
------------------------------
Date: 19 Nov 2001 11:04:59 -0800
From: jmenke@scsnet.csc.com (John Menke)
Subject: moving modules on Windows
Message-Id: <3a2d73ac.0111191104.743804ef@posting.google.com>
I need to compile Modules from CPAN on one machine and move them to
another machine. Is this possible?
------------------------------
Date: 19 Nov 2001 19:26:12 GMT
From: nospam@hairball.cup.hp.com (Richard J. Rauenzahn)
Subject: Re: New user question
Message-Id: <1006197972.176666@hpvablab.cup.hp.com>
Memory leak -- see below:
"Mina Naguib" <spam@thecouch.homeip.net> writes:
>#!/usr/bin/perl
>
>use strict;
>
>my $directory = "/home/mina/music";
>my $player = "/bin/wavplay";
>my $maxwait = 3600;
>
>my @T;
>my $filename;
>my $temp;
>
>fork && exit;
>
>while (1) {
Move "my @T;" here or you'll have a memory leak.
> sleep(rand($maxwait));
> opendir(DH, $directory) || die "Error opendir() $directory: $!\n";
> while ($filename = readdir(DH)) {
> if ($filename =~ /\.wav$/i) {
> push (@T, $filename);
> }
> }
> closedir(DH);
> $filename = $T[rand(@T)] || next;
> $filename = "$directory/$filename";
> $temp = fork();
> if ($temp == 0) {
> exec("$player $filename");
> exit;
> }
> elsif (!defined $temp) {
> die "Error forking: $!\n";
> }
> }
>
>#############################
>#
># The above was written in 2.5 minutes with clearness in mind, and has not
>been tested even for syntax.
># Now go learn perl.
>
>
--
Rich Rauenzahn ----------+xrrauenza@cup.hp.comx+ Hewlett-Packard Company
Technical Consultant | I speak for me, | 19055 Pruneridge Ave.
Development Alliances Lab| *not* HP | MS 46TU2
ESPD / E-Serv. Partner Division +--------------+---- Cupertino, CA 95014
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.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 V10 Issue 2157
***************************************