[23469] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 5683 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Oct 20 06:05:44 2003

Date: Mon, 20 Oct 2003 03:05:06 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 20 Oct 2003     Volume: 10 Number: 5683

Today's topics:
    Re: Any thought on "Perl Database" based on "Tie:File"? <bart.lateur@pandora.be>
        Do I open a http connection then close it without waiti <no@no.no>
    Re: Help me with is code <no@no.no>
    Re: Help me with is code <tom@nosleep.net>
    Re: How do I make a standalone WIN32 executable from Pe <jwillmore@remove.adelphia.net>
    Re: How do I make a standalone WIN32 executable from Pe <cyde@umd.edu>
    Re: How Do I Use Proxy in Net:HTTP? <no@no.no>
    Re: How Do I Use Proxy in Net:HTTP? <no@no.no>
    Re: HTML whitespace/commnets cruncher <andy@shitov.ru>
        Installing DBD::Sybase on MAC (Vijoy Varghese)
        my first perl script! (Matthias Wille)
    Re: Newbie dumb but quick question <grazz@pobox.com>
        Perl & Apache: modifying index.html while it's used (brendan)
    Re: Perl & Apache: modifying index.html while it's used <grazz@pobox.com>
    Re: Perl on AS400 (Michel)
    Re: Perl security guru needed for a quick, 2 hr, job. <no@no.no>
    Re: Rookie: Constructing a large SQL INSERT statement <jwillmore@remove.adelphia.net>
    Re: Rookie: Constructing a large SQL INSERT statement <tore@aursand.no>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Mon, 20 Oct 2003 09:15:02 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: Any thought on "Perl Database" based on "Tie:File"?
Message-Id: <to97pvg2q0gp651u5pg73rk4hobg3cicks@4ax.com>

Public Interest wrote:

>Here is what my friend told me: Database sucks and MySQL too. Try program
>without using database. Database is a file system. It is slow, take more
>space...
>
>But still there is many things I can not do with just simple text file, such
>as updating a record....

A file system is slow, so instead you use... the file system?!? And in
the slowest possible way, no less? You realize you do have to rewrite
the entire file (database), as soon as you  change *one* record, do you?

Databases are designed for this kind of stuff, so necessary rewrites of
the file are minimized, and as fast as possible.

-- 
	Bart.


------------------------------

Date: Mon, 20 Oct 2003 06:37:12 GMT
From: "Public Interest" <no@no.no>
Subject: Do I open a http connection then close it without waiting for reply?
Message-Id: <soLkb.186239$0v4.14374591@bgtnsc04-news.ops.worldnet.att.net>

Both Net:Http and Lwp:UserAgent require some kind of check before deciding
if the connection is needed to be closed, such as based on header or
length...

What I need is something like I open a connection to a site requesting a
page, then close it without getting any info from the site. The server will
see an incoming connection but then it sees it droped. From the client, it
minimalize the traffics. I am looking at Net::Cmd, but I can not find any
useful info.

By the way, I am not doing a DOS. I am doing such to make test how yahoo is
reacting to traffics. One of my research project is: Is Yahoo Finance
selling who is checking which stock to big funds to let them know the retail
interests on certain stocks? To me, yahoo is a blackbox, and I need put my
input in and see what output will come. Hope police will not knock my door
and think I am doing a DOS.





------------------------------

Date: Mon, 20 Oct 2003 06:10:21 GMT
From: "Public Interest" <no@no.no>
Subject: Re: Help me with is code
Message-Id: <h%Kkb.186169$0v4.14374681@bgtnsc04-news.ops.worldnet.att.net>

Dear Tom,
I work for nobody. I mainly two things:
1 scan stocks: I scan the whole yahoo for dataming. I can also scan other
websites for some paid data. For instance, yahoo asks me to pay $ for an
advanced screening and I don't want to pay it, so I scan the whole website
to get the data and save it on my PC. I indeed try to sell the screen result
on it. For instance, I scan stocks greater than .9 and less than 10 with
volume more than 50K and P/B less than 10, then I use the data to scan
another Hedge Fund database to see how much hedge funds bought on those
shares... Every info I scan is public, but I just use Perl to do an EYE job.
I also do complicated scans such as finding the real price/book value=
marketcap/(equity-goodwill-intengible). This ratio is no where to be found,
but it is super good at picking value stocks...
2 I run a website, which compete with nobody. I use a free classfies to
attrach visitors then I get paid by clicks...
I indeed have done great deals on stock research. I am a super Bear who
makes money in stocks. I know many are trading like me, but they have no
idea on programming. I have not known anyone makes less than 50% average a
year. The best makes 200% this year the worst lost 10% when Nasdaq/S&P lost
40%. My program can pin-point intraday highs and lows with 85% accuracy. I
play spreads to make money easiler to make 3% per 2-3 days... Too easy to
make money in stocks. I managed a big stock fund in China, several years
ago. It is too easy to make money in US stock market.

I guess your AI has a lot of datamining, because Perl is the best
programming lang for datamining: Simple to think, less to program. Dataming
does not require speed or memory functions very much.

If you could help me with my code, just show me what is wrong here. Thank
you.
My voicemail is 603-316-2556. You will not talk to me personally, but you
can leave a message. I don't post my real email here, but I got 10-60 virus
spam per day after I did so last time.

I did not steal your idea. My idea was totally mine. I started doing that
way back in 96-97.


> Just curious, but was wondering where you got your idea?
> I'm working on something similar, but artificially intelligent and with
> features no one has ever done before.
> I did tell a few people about my idea, so it could have spread.
>
> Doesn't really matter though, since all that can happen is the more people
> with this the better it works.
>
> Mine is almost fully functional, but my regular job is preventing me from
> finishing this for some time to come.
>
> Depending on what you are doing, possibly we could share some ideas, or
> possibly some of the work.
> I'll have to think about it; depends on who you work for and what your
goal
> is, etc.
>
> Post a contact here if interested.
>
>




------------------------------

Date: Mon, 20 Oct 2003 00:31:33 -0700
From: "Tom" <tom@nosleep.net>
Subject: Re: Help me with is code
Message-Id: <3f938e92@nntp0.pdx.net>


"Public Interest" <no@no.no> wrote in message
news:h%Kkb.186169$0v4.14374681@bgtnsc04-news.ops.worldnet.att.net...
> Dear Tom,
> I work for nobody. I mainly two things:
> 1 scan stocks: I scan the whole yahoo for dataming. I can also scan other
> websites for some paid data. For instance, yahoo asks me to pay $ for an
> advanced screening and I don't want to pay it, so I scan the whole website
> to get the data and save it on my PC. I indeed try to sell the screen
result
> on it. For instance, I scan stocks greater than .9 and less than 10 with
> volume more than 50K and P/B less than 10, then I use the data to scan
> another Hedge Fund database to see how much hedge funds bought on those
> shares... Every info I scan is public, but I just use Perl to do an EYE
job.
> I also do complicated scans such as finding the real price/book value=
> marketcap/(equity-goodwill-intengible). This ratio is no where to be
found,
> but it is super good at picking value stocks...
> 2 I run a website, which compete with nobody. I use a free classfies to
> attrach visitors then I get paid by clicks...
> I indeed have done great deals on stock research. I am a super Bear who
> makes money in stocks. I know many are trading like me, but they have no
> idea on programming. I have not known anyone makes less than 50% average a
> year. The best makes 200% this year the worst lost 10% when Nasdaq/S&P
lost
> 40%. My program can pin-point intraday highs and lows with 85% accuracy. I
> play spreads to make money easiler to make 3% per 2-3 days... Too easy to
> make money in stocks. I managed a big stock fund in China, several years
> ago. It is too easy to make money in US stock market.
>
> I guess your AI has a lot of datamining, because Perl is the best
> programming lang for datamining: Simple to think, less to program.
Dataming
> does not require speed or memory functions very much.
>
> If you could help me with my code, just show me what is wrong here. Thank
> you.
> My voicemail is 603-316-2556. You will not talk to me personally, but you
> can leave a message. I don't post my real email here, but I got 10-60
virus
> spam per day after I did so last time.
>
> I did not steal your idea. My idea was totally mine. I started doing that
> way back in 96-97.

I never said you stole any ideas.
It doesn't even matter anyway. It's not going to change the market, or what
my AI can pick.
I have features no one else has come up with before, but I'm a long ways
from being done.
All I know is the research I did up front, as well as prelim results I am
calculating, I am confident I can do better than 1 or 2 % each trading day.
That's all anyone needs, as I'm sure you know.
However, I have reason to believe I can even do better than that, we'll see.
I answered your email with the addy you posted and it was a borkers, for a
big firm.
I'm not interested in helping the enemy. :)
I'm not sure how I can help you via voice messaging.




>
>
> > Just curious, but was wondering where you got your idea?
> > I'm working on something similar, but artificially intelligent and with
> > features no one has ever done before.
> > I did tell a few people about my idea, so it could have spread.
> >
> > Doesn't really matter though, since all that can happen is the more
people
> > with this the better it works.
> >
> > Mine is almost fully functional, but my regular job is preventing me
from
> > finishing this for some time to come.
> >
> > Depending on what you are doing, possibly we could share some ideas, or
> > possibly some of the work.
> > I'll have to think about it; depends on who you work for and what your
> goal
> > is, etc.
> >
> > Post a contact here if interested.
> >
> >
>
>




------------------------------

Date: Mon, 20 Oct 2003 04:40:44 GMT
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: How do I make a standalone WIN32 executable from Perl?
Message-Id: <20031020004044.73427f01.jwillmore@remove.adelphia.net>

On Sun, 19 Oct 2003 19:41:55 -0400
Jeff W <perlnews@kwcpa.com> wrote:

Top posting for this group is rude - please don't do it :-)

> thanks James - I think you are saying I should run unix perl under
> cygwin and use the perlcc provided with that perl.  Will that really
> give me a WIN executable?
> /j
> 
> James Willmore wrote:
> 
> >On Sun, 19 Oct 2003 15:14:22 -0400
> >Jeff W <perlnews@kwcpa.com> wrote:
> >
> >> Hi - Since I'm not a programmer, and OOP C++ is a bit beyond me,
> >but> i AM a UNIX perl hacker, I was thinking of learning Perl/TK on
> >WIN32> so I could write PC scripts and utilities.  I downloaded
> >ActivePerl> and looked at it.   However, it appears that I would
> >need a perl> installation on every target machine.  Is there any
> >easy, (and low> or zero cost) way to generate standalone Perl/Tk
> >executables?   
> >
> >In the land of *NIX, you could use perlcc to compile an
> >application. In Windows land, you _may_ have to get a comercial
> >application -or- use Cygwin, compile Perl, and then you _should_
> >have perlcc available to you.
> >
> >I can't speak from experience, but that's my understanding.

It _should_.  Like I mentioned in the previous post, I haven't done it
:-(

Worse case is you have to put out $$$ for a commercial product - like
perl2exe.  However, if you're like me, you'll try the free route
first.

HTH

-- 
Jim

Copyright notice: all code written by the author in this post is
 released under the GPL. http://www.gnu.org/licenses/gpl.txt 
for more information.

a fortune quote ...
Dear Lord:  I just want *one* one-armed manager so I never have
<to hear "On the other hand", again. 


------------------------------

Date: Mon, 20 Oct 2003 00:52:45 -0400
From: Cyde Weys <cyde@umd.edu>
Subject: Re: How do I make a standalone WIN32 executable from Perl?
Message-Id: <bmvpmt$mb0$2@grapevine.wam.umd.edu>

Jeff W wrote:

> thanks!!!! - And from someone with the same name as my favorite
> Folk/Rock Artist 8-}

Can you please stop top-posting ... please ... think of the kittens.



------------------------------

Date: Mon, 20 Oct 2003 06:25:13 GMT
From: "Public Interest" <no@no.no>
Subject: Re: How Do I Use Proxy in Net:HTTP?
Message-Id: <ddLkb.186216$0v4.14374636@bgtnsc04-news.ops.worldnet.att.net>

Dear Master Bart,

Thank YOU.
My own code was:
 my $s = Net::HTTP->new(Host => '64.161.246.100:8080') || die $@;
 $s->write_request(GET => 'http://quote.yahoo.com', 'User-Agent' =>
'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)' );

So I did not know the syntax of using proxy, because it was not said in it.

My final question on this: Why do I have to put host here? Because I put
peeradd which is proxy server, peerport and the abs url. Your said the Host
is important for virtual domain, but you already has the full url to let
httpd to know? Can I do?

> my $s = Net::HTTP->new(
>   PeerAddr => 'proxy.pandora.be', PeerPort => 8080) or die $@;
> $s->write_request(GET =>
>   "http://httpd.apache.org/docs/misc/FAQ.html");

or

> my $s = Net::HTTP->new(Host => "httpd.apache.org",
>   PeerAddr => 'proxy.pandora.be', PeerPort => 8080) or die $@;
> $s->write_request(GET =>
>   "/docs/misc/FAQ.html");


 .




------------------------------

Date: Mon, 20 Oct 2003 06:54:13 GMT
From: "Public Interest" <no@no.no>
Subject: Re: How Do I Use Proxy in Net:HTTP?
Message-Id: <pELkb.186272$0v4.14377198@bgtnsc04-news.ops.worldnet.att.net>

One of things I don't undertand is you and I both read the same document on
Net::Http, there is no such info as what I need, but you can write a correct
code and I could not. Do you have a better documation file or a better cook
book? What you explained to me on how to use the proxy is no where found.
Don't know how you first guessed the syntax right.




------------------------------

Date: Mon, 20 Oct 2003 10:26:07 +0400
From: Andrew Shitov <andy@shitov.ru>
Subject: Re: HTML whitespace/commnets cruncher
Message-Id: <bmvv5v$3fk$3@gavrilo.mtu.ru>

> Can anyone recommend a perl script for crunching HTML whitespace and
> comments? I wish to make duplicates of HTML files for uploading.

Look at the code on this page: http://webcode.ru/cgi/despace1/



------------------------------

Date: 19 Oct 2003 22:51:51 -0700
From: viijv@thedifferenZ.com (Vijoy Varghese)
Subject: Installing DBD::Sybase on MAC
Message-Id: <4c08aaff.0310192151.469283f0@posting.google.com>

Hello Group,

I want to access a MSSQL database(on WIN-NT) from my MAC. 
After some googling I found that for this I have to install
DBD:Sybase. But before that I need to install the 'Sybase OpenClient
Libraries' and then edit the SYBASE variablein CONFIG file of
DBD:Sybase installation so that it points to the 'Sybase OpenClient
Libraries'.
So first of all I had to install the OpenClient libraries, for this
after some googling i found that I can get it from
http://linux.sybase.com. But with my little knowledge about Sybase, I
was lost in that webpage and confused about what to download.

Then again some googling and found this link
http://www.linuxgazette.com/issue18/sybase.html, even though it is a
bit aged page(most links are broken), I got the name
'ctlib-linux-elf.tar.gz'. Did some googling on that name and found
this link
URL http://ring.csi.ad.jp/archives/net/www/php/extra/ctlib-linux-elf.tar.gz,
the file is that of 1997. I extracted the contents to /usr/local
Everything fine upto this...

Then I tried to install DBD::Sybase
Edited the SYBASE variable in CONFIG to '/usr/local/sybase' and then
ran perl Makefile.PL
This is what I got as output

##### Start ###########
[diffe:Documents/vijoy/DBD-Sybase-1.01] admin# perl Makefile.PL
Sybase OpenClient 10.0.3 found.
The DBD::Sybase module need access to a Sybase server to run the
tests.
To clear an entry please enter 'undef'
Sybase server to use (default: troll): undef
User ID to log in to Sybase (default: sa): undef
Password (default: undef): undef
Sybase database to use on undef (default: undef): undef
Checking if your kit is complete...
Looks good
Note (probably harmless): No library found for -ldl
Multiple copies of Driver.xst found in: /Library/Perl/darwin/auto/DBI
/Library/Perl/darwin/auto/DBI at Makefile.PL line 55
Using DBI 1.37 installed in /Library/Perl/darwin/auto/DBI
Writing Makefile for DBD::Sybase
###### End ###########

About multiple copis of Driver.xst, I can see only one copy out there.
Contents of /Library/Perl/darwin/auto/DBI
#### Start ####
-rw-r--r--  1 root  admin   1976 Jul  1 12:55 .packlist
-r--r--r--  1 root  admin      0 Jul  1 12:55 DBI.bs
-r-xr-xr-x  1 root  admin  93680 Jul  1 12:55 DBI.bundle
-r--r--r--  1 root  admin  18391 May 13 06:54 DBIXS.h
-r--r--r--  1 root  admin  15513 May 13 07:00 Driver.xst
-r--r--r--  1 root  admin   3254 Sep 13  2002 Driver_xst.h
-r--r--r--  1 root  admin   2531 Feb 26  2003 dbd_xsh.h
-r--r--r--  1 root  admin   3475 Feb  6  2002 dbi_sql.h
-r--r--r--  1 root  admin  14789 Jul 15  2002 dbipport.h
#### End ####

So I thought this is some 'harmless' error and continued with the
installation.
Next was 'make', and I got this
#### Start ####
[thediffe:Documents/vijoy/DBD-Sybase-1.01] admin# make
cp dbd-sybase.pod blib/lib/DBD/dbd-sybase.pod
cp Sybase.pm blib/lib/DBD/Sybase.pm
/usr/bin/perl -p -e "s/~DRIVER~/Sybase/g" <
/Library/Perl/darwin/auto/DBI/Driver.xst > Sybase.xsi
/usr/bin/perl /Library/Perl/ExtUtils/xsubpp  -typemap
/Library/Perl/ExtUtils/typemap  Sybase.xs > Sybase.xsc && mv
Sybase.xsc Sybase.c
cc -c  -I/usr/local/sybase/include -I/Library/Perl/darwin/auto/DBI
-pipe -fno-common -no-cpp-precomp -fno-strict-aliasing -O3  
-DVERSION=\"1.01\" -DXS_VERSION=\"1.01\" 
"-I/Library/Perl/darwin/CORE"   Sybase.c
cc -c  -I/usr/local/sybase/include -I/Library/Perl/darwin/auto/DBI
-pipe -fno-common -no-cpp-precomp -fno-strict-aliasing -O3  
-DVERSION=\"1.01\" -DXS_VERSION=\"1.01\" 
"-I/Library/Perl/darwin/CORE"   dbdimp.c
Running Mkbootstrap for DBD::Sybase ()
chmod 644 Sybase.bs
rm -f blib/arch/auto/DBD/Sybase/Sybase.bundle
LD_RUN_PATH="/usr/local/sybase/lib:/usr/lib" cc 
-L/usr/local/sybase/lib  -flat_namespace -bundle -undefined suppress
Sybase.o dbdimp.o  -o blib/arch/auto/DBD/Sybase/Sybase.bundle  
-L/usr/local/sybase/lib -lct -lcs -ltcl -lcomn -lintl -linsck -lm
ld: malformed table of contents in: /usr/local/sybase/lib/libct.a
(ranlib struct 0 library member offset not a multiple of 4 bytes,
can't load from it)
ld: malformed table of contents in: /usr/local/sybase/lib/libcs.a
(ranlib struct 1 library member offset not a multiple of 4 bytes,
can't load from it)
ld: malformed table of contents in: /usr/local/sybase/lib/libcomn.a
(ranlib struct 0 library member offset not a multiple of 4 bytes,
can't load from it)
ld: malformed table of contents in: /usr/local/sybase/lib/libintl.a
(ranlib struct 0 library member offset not a multiple of 4 bytes,
can't load from it)
make: *** [blib/arch/auto/DBD/Sybase/Sybase.bundle] Error 1
#### End ####

What could be wrong?

Please help,

Thanking you
Vijoy Varghese


------------------------------

Date: 20 Oct 2003 00:34:47 -0700
From: m.wille@gmx.ch (Matthias Wille)
Subject: my first perl script!
Message-Id: <3395b56f.0310192334.a66a044@posting.google.com>

Hello

I just started to learn perl and wrote my first program today (a big
step for me, a small step for mankind...). Actually it does what it is
supposed to do except for the part which is supposed to match a
certain string. I would appreciate if some perl cracks in this group
could take a short look at my script an tell me if it is good perl
style and tell me some improvements and shortcuts I can make. After
all I like to be a good perl programmer in the end... :-)

I'm wondering if there is a simpler way for replacing strings in a
file without creating temp files.
Oh yes, the code should be as portable as possible, as it should run
also on windows...

Thanks very much!
Matthias

----

#!/usr/bin/perl

use Cwd;
use File::Copy;
use File::Basename;
use File::Path;
#use strict;
#use warnings;

sub printUsage();

# find out current working directory
$cwd = Cwd::cwd();

# check that we are in the right directory
unless (basename(dirname($cwd)) eq "control") {
  die "please run this skript from inside a test family folder, i.e.
'thread'";
}

# get command line  arguments
($oldcase, $newcase) = @ARGV;

# require at least one argument
unless (defined $oldcase) {
  printUsage();
  exit 1;
}

$newcase = "$oldcase_COPY" unless defined $newcase;
$family = basename($cwd);

# check if .pm file of oldcase exists
die "Testcase $oldcase does not exist in this folder" unless (-e
"$oldcase.pm");

# try to open .pm files
open(OLD, "<$oldcase.pm") or die "could not open file $oldcase.pm for
reading: $!";
open(NEW, ">$newcase.pm") or die "could not open file $newcase.pm for
writing: $!";

# read in old file and change all occurances of $oldcase to $newcase
while($line = <OLD>) {
  $line =~ s/$oldcase/$newcase/g;
  print NEW $line;
}

# now the same again with the html file, if any present
if (-e "$oldcase.html") {
	open(OLD, "<$oldcase.html") or die "could not open file $oldcase.html
for reading: $!";
	open(NEW, ">$newcase.html") or die "could not open file $newcase.html
for writing: $!";
	while($line = <OLD>) {
		$line =~ s/$oldcase/$newcase/g;
		print NEW $line;
	}
}
else {
	print STDOUT "html file for testcase $oldcase is missing. you shoul
add one...";
}

# add a new Case section for the new test in the isildap.ini file
open(OLD, "<isildap.ini") or die "could not open file isildap.ini for
reading: $!";
open(NEW, ">isildap.ini.new") or die "could not open file isildap.ini
for writing: $!";

# read all lines of isildap.ini file
$lines = join("", <OLD>);

# find matching 'Case = $oldcase { }' block and duplicate it 
print STDOUT "found match\n" if $lines =~
m/Case.*=.*$oldcase.*\{(.*?)\}/s;
print NEW $lines;
print NEW "\n";
$newpattern = $&;
$newpattern =~ s/$oldcase/$newcase/g;
print NEW $newpattern;

# delete old isildap.ini file and rename new one
#unlink("isildap.ini") or die "could not delete old isildap.ini file";
#File::Copy::move("isildap.ini.new", "isildap.ini") or die "could not
rename file";

# add a new addVariants entry for the new test in the <family>.pm file
open(OLD, "<$family.pm") or die "could not open file $family.pm for
reading: $!";
open(NEW, ">$family.pm.new") or die "could not open file $family.pm
for writing: $!";

while($line = <OLD>) {
  print NEW $line;
  if($line =~ s/'$oldcase'/'$newcase'/g) {
    print NEW $line;
  }
}

# delete old $family.pm file and rename new one
# unlink("$family.pm") or die "could not delete old $family.pm file";
# File::Copy::move("$family.pm.new", "$family.pm") or die "could not
rename file";

exit 0;

# print some help on usage of this skript
sub printUsage() {
  select STDOUT;
  print "SYNOPSIS:\n";
  print "\ttbcopytest testcasename [ newname ]\n";
}


------------------------------

Date: Mon, 20 Oct 2003 06:51:29 GMT
From: Steve Grazzini <grazz@pobox.com>
Subject: Re: Newbie dumb but quick question
Message-Id: <RBLkb.4897$Vf7.2504@nwrdny02.gnilink.net>

Jeff W <perlnews@kwcpa.com> wrote:
> Sam Holden wrote:
>> Though it isn't labelled "top posting", see the section headed 
>> "Use an effective followup style" in the guidelines
> 
> ok - got it - guess it's a personal style thing 

It's more of a "When in Rome" thing.

> i hate scrolling to the bottom so I assume others do too.

Oh, but they do.  That's why you're also going to trim the text,
quoting only enough to place your response in context.

-- 
Steve


------------------------------

Date: 19 Oct 2003 23:51:38 -0700
From: brendan@symonty.org (brendan)
Subject: Perl & Apache: modifying index.html while it's used
Message-Id: <282ee219.0310192251.604b0415@posting.google.com>

hi there,

I have a little Perl script which will run as an Apache CGI script. 
This script will modify the contents of index.html.

What happens to users who hit index.html while the script is modifying
it?  Will they see a half-constructed page?

What's the best way to ensure that Apache doesn't display the modified
file until it's fully written?

thanks!


------------------------------

Date: Mon, 20 Oct 2003 06:59:19 GMT
From: Steve Grazzini <grazz@pobox.com>
Subject: Re: Perl & Apache: modifying index.html while it's used
Message-Id: <bJLkb.4913$Vf7.2741@nwrdny02.gnilink.net>

brendan <brendan@symonty.org> wrote:
> What's the best way to ensure that Apache doesn't display the modified
> file until it's fully written?

You could write a temporary file and then close and rename() it.

-- 
Steve


------------------------------

Date: 20 Oct 2003 01:00:13 -0700
From: mbr@petercam.be (Michel)
Subject: Re: Perl on AS400
Message-Id: <c8f5d58b.0310200000.2729e3cb@posting.google.com>

James Willmore <jwillmore@remove.adelphia.net> wrote in message news:<20031015131011.1e3968f3.jwillmore@remove.adelphia.net>...
> 
> If the AS400 is anything like the S390 in any way, you _may_ want to
> check the translation table for the machine.  And also make sure the
> Perl binary was installed properly.
> 
Thanks Jim, and you are right the problem state in the conversion
tables… When I use ‘qshell' with the  CCSID 37 (US code page) perl
seems to work !  So I do not understand why it didn't work with CCSID
500 (French Belgium, Canada, Switzerland) !
Anyway I still have problems with the result of  query.
Problems are with characters fields or varchar , date etc .. except
numeric field
I give a example :
1) in CCSID 37 the query (in direct) works
> db2 'select * from mbr.junk '   
                                
JUNK1             JUNKTXT       
----------------- --------------
               1  Message un    
              26  Message 26    
              25  Message 25    
                                
  3 RECORD(S) SELECTED.          

Now with this little perl script
> cat mbdb.pl     
 #! /usr/bin/perl
 use DBI;                                                        
 use DBD::DB2::Constants;                                        
 use DBD::DB2;                                                   
 $dbh = DBI->connect("dbi:DB2:DBBABY") or die;                   
 $stmt = 'SELECT *  FROM MBR.junk';
 $cur = $dbh->prepare($stmt);                              
 $cur->execute();                                                
 die "Prepare error: $DBI::err ... $DBI::errstr" if $DBI::err;   
 DBI::dump_results($cur);                                        
 $cur->finish();  

And the result is:
> mbdb.pl   
 1, undef  
 26, undef 
 25, undef 
 3 rows   
So here am I, trying to resolve the 2 problems a) CCSID 500 and 2) Why
characters based fields are not be taken correctly by the constants
definition module.
Again many thanks to you.


------------------------------

Date: Mon, 20 Oct 2003 06:49:08 GMT
From: "Public Interest" <no@no.no>
Subject: Re: Perl security guru needed for a quick, 2 hr, job.
Message-Id: <EzLkb.186262$0v4.14377453@bgtnsc04-news.ops.worldnet.att.net>


"RMallonday" <rmallonday@aol.com> дÈëÓʼþ
news:20031018140613.10366.00000857@mb-m14.aol.com...
> I am using LWP, but I can't get to the data page any longer, some new
features.
>  I think there are varibles stored in hidden fields that bounce you out if
> they're not set.

Mostlikely, they are sending you a cookie and then read the cookie. If you
are a UserAgent, then your cookie is not set correctly. Another way to block
you is to use javascript. Javascript only works in IE, not in perl. Don't
forget to tell the server which UserAgent you are from. If you use default:
lwp-www/perl5... then they can block you in no time.




------------------------------

Date: Mon, 20 Oct 2003 04:51:35 GMT
From: James Willmore <jwillmore@remove.adelphia.net>
Subject: Re: Rookie: Constructing a large SQL INSERT statement
Message-Id: <20031020005134.22880a23.jwillmore@remove.adelphia.net>

On Mon, 20 Oct 2003 01:50:08 GMT
"sdfgsd" <sdfg@sdg.com> wrote:

> Disclaimer: I've googled and searched Perldoc/CPAN.
> 
> The format of the INSERT statement is:
> 
> INSERT INTO mytable (field_1, field_2, field_3)
> VALUES (value_1, value_2, value_3),
> (value_1, value_2, value_3),
> (value_1, value_2, value_3),
> (value_1, value_2, value_3),
> etc. ;
> 
> In Delphi I just keep looping through the constrution process and
> keep adding to a string variable like this:
> 
>   sqlstatement := sqlstatement + newrow;
> 
> Is this the right approach to take in perl? Just keep adding to a
> scalar, or would some sort of list/hash construct be better?

PL/SQL?  SQL92?  I'm a little fuzy on what you're trying to do.

What I got out off your post is this - you want to do multiple
inserts.  Using the DBI module, you have several ways to do it.  The
"quick and dirty" way to do it is to use a here doc and use the 'do'
DBI method (not to be confused with the 'do' function).  You could
also build a string and then use the DBI 'prepare' and execute'
methods.  You could also 'prepare' a simple SQL statement, loop
through what you want to insert and 'execute' each value (or values).

You should look over the DBI documentation to get a feel for what it
can do - post if you have specific questions on what you read.

HTH


-- 
Jim

Copyright notice: all code written by the author in this post is
 released under the GPL. http://www.gnu.org/licenses/gpl.txt 
for more information.

a fortune quote ...
A large number of installed systems work by fiat.  That is, they 
work by being declared to work.   -- Anatol Holt 


------------------------------

Date: Mon, 20 Oct 2003 09:26:24 +0200
From: Tore Aursand <tore@aursand.no>
Subject: Re: Rookie: Constructing a large SQL INSERT statement
Message-Id: <pan.2003.10.20.06.20.06.732381@aursand.no>

On Mon, 20 Oct 2003 01:50:08 +0000, sdfgsd wrote:
> The format of the INSERT statement is:
> 
> INSERT INTO mytable (field_1, field_2, field_3)
> VALUES (value_1, value_2, value_3),
> (value_1, value_2, value_3),
> (value_1, value_2, value_3),
> (value_1, value_2, value_3),
> etc. ;

Is this valid SQL?  The reason I'm askin is that I really don't know,
because I've never tried to do INSERT queries like the one above.

It seems to me, however, that you should do this in a loop, bind'ing the
data to into the query. Example:

  my $stInsert = $dbh->prepare('INSERT INTO mytable
                                       (field_1, field_2, field_3)
                                VALUES (?, ?, ?)');
  while ( ... ) {
      $stInsert->execute( $value_1, $value_2, $value_3 );
  }
  $stInsert->finish();

This really depends on how you have chosen to structure the data you're
about to insert into the database.  Some more information about that would
cause us to give you a better advice.


-- 
Tore Aursand <tore@aursand.no>


------------------------------

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 5683
***************************************


home help back first fref pref prev next nref lref last post