[11728] in Perl-Users-Digest
Perl-Users Digest, Issue: 5328 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Apr 8 11:35:00 1999
Date: Thu, 8 Apr 99 08:00:21 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 8 Apr 1999 Volume: 8 Number: 5328
Today's topics:
Advanced Mailform script wanted! <katigaebler@hotmail.com>
Re: Advanced Mailform script wanted! (Jonathan Stowe)
Re: Advanced Mailform script wanted! <katigaebler@hotmail.com>
CGI [Advanced tables] WYSIWYG ?? <jerryp.usenet@connected.demon.co.uk>
Re: CGI [Advanced tables] WYSIWYG ?? (David Turley)
Chicago.pm meeting (Jim Allenspach)
Re: convert IP to country of origin: See VisualRoute's (Jonathan Stowe)
Re: determining the browser? <Philip.Newton@datenrevision.de>
Directory traversing <adickinson@barr.com>
Re: Directory traversing <ffchopin@worldnet.att.net>
Re: Enclosing a binary within perl <Philip.Newton@datenrevision.de>
Re: How do you pass cmd line parameter? (Abigail)
Re: How to close all file descriptors ? (RJ)
Re: how to dereference a package variable (Christopher Allene)
IO:SOCKET to SMTP connection problem <kskvarci@bbnplanet.com>
Re: Multi search engine search on NT marlon-shakespeare@hotbot.com
Re: my random doesn't return number!! <Philip.Newton@datenrevision.de>
Re: my random doesn't return number!! (Bart Lateur)
Newbie questions <arogers@rational.com>
Re: Newbie questions <ffchopin@worldnet.att.net>
Re: Problem passing variables to NT command file (Keith Phillips)
Re: Quantum Variable (Erica Coffin)
Re: Quantum Variable (Erica Coffin)
Re: question on $ENV{'abc'} <vvb@NO_SPAMibm.net>
Re: random number ( -w ) <Philip.Newton@datenrevision.de>
Re:Problem viewing PERL data in browser <vinod.kudva@eds.com>
system-command under Win98 (Matti Johannes Kdrki)
Re: system-command under Win98 (Jonathan Stowe)
Re: Threads: ready for real applications? Perl Internal <spam@oyt.oulu.fi>
Re: wanted: elegant inverse operation for vec <Wm.Blasius@ks.sel.alcatel.de>
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 08 Apr 1999 13:16:03 +0200
From: Kati Gdbler <katigaebler@hotmail.com>
Subject: Advanced Mailform script wanted!
Message-Id: <370C8FF3.4540D36D@hotmail.com>
Hello,
I am looking for a mailform processor that includes the following
features: A PREVIEW button in addition to SEND button. If preview has
been clicked instead of Send, the preview page should obviously print
out a preview, PLUS include the following two functions: CORRECT, -->
simply returns visitor to the form with current draft inset. Or if
hitting "OK SEND" --> Sends the result AS is. After hitting SEND, the
standard "Thank you for submission page" should also print out the
result of the mailform. There should also be a checkbox that visitors
can select if they want a copy of the message sent to themselves,
(obviously using the servers sendmail program).
I would also like some ADMIN functions preferably configurable via a
Web based admin form: possibility of composing an AUTO responder that
e-mails the user/visitor a standard message. The feature should also be
possible to toggle on or off.
The possibility of e-mailing the results to multiply administrators.
Has anyone seen a freeware or shareware that can perform some or all
of these functions, or a similar script that could be modified? I use
the latest Apache server with latest version of Perl, and SSI/XSSI
features included.
Kati Gdbler
katigaebler@hotmail.com
------------------------------
Date: Thu, 08 Apr 1999 12:43:14 GMT
From: gellyfish@gellyfish.com (Jonathan Stowe)
Subject: Re: Advanced Mailform script wanted!
Message-Id: <370ca3fd.17430985@news.dircon.co.uk>
On Thu, 08 Apr 1999 13:16:03 +0200, Kati Gdbler
<katigaebler@hotmail.com> wrote:
>Hello,
>
>I am looking for a mailform processor that includes the following
>features:
Hold it right there.
Check out:
<http://www.altavista.com/cgi-bin/query?pg=q&kl=XX&q=mailform>
This newsgroup is not the place to look for free software.
/J\
------------------------------
Date: Thu, 08 Apr 1999 16:32:40 +0200
From: Kati Gdbler <katigaebler@hotmail.com>
To: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Advanced Mailform script wanted!
Message-Id: <370CBE08.4B5ACB13@hotmail.com>
Jonathan Stowe wrote:
>
> On Thu, 08 Apr 1999 13:16:03 +0200, Kati Gdbler
> <katigaebler@hotmail.com> wrote:
>
> >Hello,
> >
> >I am looking for a mailform processor that includes the following
> >features:
>
> Hold it right there.
>
> Check out:
> <http://www.altavista.com/cgi-bin/query?pg=q&kl=XX&q=mailform>
>
> This newsgroup is not the place to look for free software.
>
I didn't know that its a criteria for posting on this newsgroup (or that
comp.lang.perl.misc is a job hunting newsgroup). Just in case it counts:
I DID mention shareware, although I have noticed that many perl
programmers (good or bad) are primarely money driven and willing to lend
their expertise to deep pocketed clients only. I did NOT mention (as I
generally don't make money offers directly on newgroups), that in case a
perl hacker turns up a similar program that could be modified to suit
the purpose I would also be happy to pay for their work.
Kati
> /J\
------------------------------
Date: Thu, 8 Apr 1999 13:10:15 +0100
From: Jerry Pank <jerryp.usenet@connected.demon.co.uk>
Subject: CGI [Advanced tables] WYSIWYG ??
Message-Id: <wvC3PAAnyJD3Ewo3@connected.demon.co.uk>
I'm using CGI.pm in a big way now [Thanks Lincoln, One of the best!]
I often need to create *very* complicated table layouts which I find
quite tricky to write in CGI.pm and wondered if anyone has built a
'reverse parser' that will create a `CGI.pm script template' from raw
html?
It would be so nice to knock up a complicated page layout with a
WYSIWYG editor and convert that to `Perl-speak'.
Until then, back to vi !
-- Jerry Pank http://www.netconnected.com/
jerryp.usenet@netconnected.com
So far we've managed to avoid turning Perl into APL. :-)
-- Larry Wall in <199702251904.LAA28261@wall.org>
------------------------------
Date: Thu, 08 Apr 1999 12:40:43 GMT
From: dturley@binary.net (David Turley)
Subject: Re: CGI [Advanced tables] WYSIWYG ??
Message-Id: <370ca311.4840312@news.erols.com>
On Thu, 8 Apr 1999 13:10:15 +0100, Jerry Pank
<jerryp.usenet@connected.demon.co.uk> wrote:
[Courtesy copy to Jerry Pank.]
>I'm using CGI.pm in a big way now [Thanks Lincoln, One of the best!]
>
>I often need to create *very* complicated table layouts which I find
>quite tricky to write in CGI.pm and wondered if anyone has built a
>'reverse parser' that will create a `CGI.pm script template' from raw
>html?
>
Well, you've got several choices. You could read the perl
documentation on here docs, and simple paste in your HTML code,
between the HERE delimeters:
print <<HTML;
<table> yadada
</table>
HTML
Or you could use the HTML to CGI converter that Randal Schwartz wrote
about in Web Techiques.
http://www.stonehenge.com/merlyn/WebTechniques/col30.html
--
David Turley
dturley@pobox.com
http://www.binary.net/dturley/
------------------------------
Date: 8 Apr 1999 08:49:57 -0500
From: jima@MCS.COM (Jim Allenspach)
Subject: Chicago.pm meeting
Message-Id: <7eic65$l0c@Venus.mcs.net>
Keywords: chicago,pm
The Chicago PM chapter will be having its next meeting on Monday,
April 19, at the offices of American Information Systems (161 N. Clark,
suite 1350), starting at 7:30 PM. Information on the group or on how to
get to the meeting can be found at the group's Website,
http://chicago.pm.org/ .
------------------------------
Date: Thu, 08 Apr 1999 12:26:55 GMT
From: gellyfish@gellyfish.com (Jonathan Stowe)
Subject: Re: convert IP to country of origin: See VisualRoute's site
Message-Id: <370c9ed1.16106905@news.dircon.co.uk>
On Thu, 8 Apr 1999 11:37:31 +0100, "Christopher Spry"
<cspry@sghms.ac.uk> wrote:
><nguyen.van@imvi.bls.com> wrote in message
>news:7eg8g3$gnk$1@nnrp1.dejanews.com...
>> I just wonder there is any way to convert IP address to country of origin.
>... By the way, is
>> there any company doing this kind of work ? ..
>
>See VisualRoute <http://www.visualroute.com/technotes.html#modifydb> which
>has some information on this topic.
>
Er. As I see it there are several drawbacks to this :
A) it is a commercial java application
B) You will need to know the physical location of every router on the
internet.
C) using traceroute to achieve the posters aims is going to get shot
away because of the very way that the internet works - circumstances
might dictate that some circuitous route will be taken to the host.
The best thing to say to the question is that it cant be done to any
degree of reliability that would make the enterprise worthwhile.
/J\
------------------------------
Date: Thu, 08 Apr 1999 16:25:52 +0200
From: Philip Newton <Philip.Newton@datenrevision.de>
Subject: Re: determining the browser?
Message-Id: <370CBC70.1249577E@datenrevision.de>
David L. Cassell wrote:
>
> to write non-portable html. Not a good idea, IMHO.
I second the notion.
Cheers,
Philip
------------------------------
Date: Thu, 08 Apr 1999 07:45:52 -0700
From: Aaron Dickinson <adickinson@barr.com>
Subject: Directory traversing
Message-Id: <370CC120.C8CE7DA9@barr.com>
I am working on a PERL script that does global search and replace on an
NT system... unfortunately I do not know how to get it to follow the
subdirectories under the location the program executes from.
Can someone provide a code example for this?
If so, please CC: to my email address.
------------------------------
Date: Thu, 8 Apr 1999 10:16:18 -0400
From: "Jason Simms" <ffchopin@worldnet.att.net>
Subject: Re: Directory traversing
Message-Id: <7eiemq$69o$1@bgtnsc02.worldnet.att.net>
> I am working on a PERL script that does global search and replace on an
> NT system... unfortunately I do not know how to get it to follow the
> subdirectories under the location the program executes from.
Use the File::Find module, which comes with the standard Perl distribution.
Read the docs, but basically you give it a start directory and point it to a
subroutine to be executed for each file it comes across. Then it will
traverse the tree...
Jason Simms
------------------------------
Date: Thu, 08 Apr 1999 16:51:30 +0200
From: Philip Newton <Philip.Newton@datenrevision.de>
Subject: Re: Enclosing a binary within perl
Message-Id: <370CC272.10441D86@datenrevision.de>
Larry Rosler wrote:
>
> Also, the faster 'match a fixed string' algorithm (also used by perl's
> grep function) is available via the 'grep -F' option.
I've heard that 'grep -E' or 'egrep' is faster than 'grep -F' or
'fgrep'. Never benchmarked the two, though. If that's the case, maybe
the only use for grep -F is searching for strings containing regex
characters such as *+[] etc.
Cheers,
Philip
------------------------------
Date: 8 Apr 1999 14:53:02 GMT
From: abigail@fnx.com (Abigail)
Subject: Re: How do you pass cmd line parameter?
Message-Id: <7eifse$k8j$1@client2.news.psi.net>
Steve Swett (swett@ncats.net) wrote on MMXLV September MCMXCIII in
<URL:news:01be8091$1a3bea20$68e4b0c7@bcs.newaygo.mi.us>:
!! How do you pass a command line parameter from one program to another?
system ("otherprogram", "command", "line", "parameter");
Abigail
--
%0=map{reverse+chop,$_}ABC,ACB,BAC,BCA,CAB,CBA;$_=shift().AC;1while+s/(\d+)((.)
(.))/($0=$1-1)?"$0$3$0{$2}1$2$0$0{$2}$4":"$3 => $4\n"/xeg;print#Towers of Hanoi
------------------------------
Date: Thu, 08 Apr 1999 14:44:22 GMT
From: raymondj@removethis.raleigh.ibm.com (RJ)
Subject: Re: How to close all file descriptors ?
Message-Id: <370cc05c.476046@mdnews.btv.ibm.com>
On 7 Apr 1999 22:08:51 GMT, abigail@fnx.com (Abigail) wrote:
Reread the original question.
You can not exit and then fork a new process!
>RJ (raymondj@removethis.raleigh.ibm.com) wrote on MMXLV September
>MCMXCIII in <URL:news:370cc7b1.24538875@mdnews.btv.ibm.com>:
>^^
>^^ Question: How in perl can you close all file handles?
>
>
>exit;
>
>
>
>Abigail
raymondj@removethis.raleigh.ibm.com
------------------------------
Date: Thu, 8 Apr 1999 14:07:36 +0100
From: cwis@dial.oleane.com (Christopher Allene)
Subject: Re: how to dereference a package variable
Message-Id: <1dpxohv.1wxoi0k1vsosg4N@[192.168.1.2]>
<evrim@my-dejanews.com> wrote:
> $x=$$z::i;
Using
$x = ${"$z::i"};
will do the work.
--
cw|s
------------------------------
Date: Thu, 08 Apr 1999 13:14:27 GMT
From: "kskvarci" <kskvarci@bbnplanet.com>
Subject: IO:SOCKET to SMTP connection problem
Message-Id: <TY1P2.399$kM2.46731@burlma1-snr2>
I have written a script that connects to an SMTP server and sends mail, as
well as creating an HTML page that tells whether or not the server is
accepting connections. This generated page is then monitored with URL
monitoring software, so an alert will pop if the smtp server is down.
The script connects beautifully to unix sendmail SMTP servers, but when I
point it at IIS SMTP server on NT, it wont work.
When pointing it at a NT SMTP server, and printing the filehandle from
io:socket, it stops at the following:
ESMTP spoken here
The rest of the script does not execute. Its as though I am unable to print
to the filehandle.
Below is the script. Any suggestions would be GREAT!
#Connects to SMTP server and sends mail.
#HTML page is generated that tells if connection to SMTP server was
succesfull o
use IO::Socket;
#---------------------------------------------------
# Fill in these variables
$SMTPserver="cam-mail-relay1.free.com";
$Port="25";
#Make this an HTML filename
$outputfile="outputfile.html";
$Message="This is a test message for SMTP, please ignore";
$recipient="kskvarci\@bbnplanet.com";
mailto:$sender="SMTPscript\@SMTP.com;
#---------------------------------------------------
if ($pipe = IO::Socket::INET->new( Proto => "tcp",
PeerAddr => $SMTPserver,
PeerPort => $Port,
)
){
$pipe->autoflush(1);
print $pipe "HELO 127.0.0.1\n";
print $pipe "MAIL FROM:$sender\n";
print $pipe "RCPT TO:$recipient\n";
print $pipe "DATA\n";
print $pipe "$Message\n";
print $pipe ".\n";
print $pipe "QUIT\n";
close $pipe;
open (nocon, ">$outputfile");
print nocon <<endsymb;
<html>
<head>
<title>SMTP Check</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF">
<p><font size="+3">This is A monitoring page.</font></p>
<p> </p>
<p>SMTP server is accepting connections. </p>
</body>
</html>
endsymb
close (nocon);
} else {
open (nocon, ">$outputfile");
print nocon <<endsymb;
<html>
<head>
<title>SMTP Check</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF">
<p><font size="+3">This is A monitoring page.</font></p>
<p> </p>
<p>SMTP server is not accepting connections. </p>
</body>
</html>
endsymb
close (nocon);
}
------------------------------
Date: Thu, 08 Apr 1999 11:42:37 GMT
From: marlon-shakespeare@hotbot.com
Subject: Re: Multi search engine search on NT
Message-Id: <7ei4nc$3b1$1@nnrp1.dejanews.com>
Hi,
Not entirely sure what you're trying to achieve. If you're trying to search
through a set of sites locally on your NT machine, a crude way is to use Perl
and recursively process all directories where you have content, reading in
each file line by line and performing a regular expression using your 'Search
String'.
The File::Find module is helpful for this. Any comments on a more efficient
way to do this would appreciated.
Marlon
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Thu, 08 Apr 1999 16:21:17 +0200
From: Philip Newton <Philip.Newton@datenrevision.de>
Subject: Re: my random doesn't return number!!
Message-Id: <370CBB5D.C0E8D0C1@datenrevision.de>
Ronald J Kimball wrote:
>
> Philip Newton <Philip.Newton@datenrevision.de> wrote:
>
> > Bart Lateur wrote:
> > >
> > > The "keyword step" is unnecessary, anyway. The keyword itself is never
> > > retained! Just an array of the *values* of the hash is enough!
> > >
> > > @value = values %hash;
> > > return $value[int(rand @values)];
> >
> > The "@value" step is unnecessary, anyway. The array itself is never
> > retained! Just writing the two lines in one is enough!
> >
> > return $value[int(rand values %hash)];
> >
> > Unless I am missing something?
>
> Yes. You're missing the initialization of the array @value.
>
> Just because it isn't retained doesn't mean it isn't used. ;)
Oh. Now I see it. Woops. There's still an error regarding the two arrays
@value and @values in the original code.
Cheers,
Philip
------------------------------
Date: Thu, 08 Apr 1999 14:54:11 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: my random doesn't return number!!
Message-Id: <370cc244.165873@news.skynet.be>
Philip Newton wrote:
>Oh. Now I see it. Woops. There's still an error regarding the two arrays
>@value and @values in the original code.
Yes.
Many people use the mutliple for arrays (@values), while I generally
prefer the singular (@value). Much nicer if you take just one element.
$value[5]
is the sixth value.
Anyway, I made that error when switching from one concept to the other
(but apparently not just everywhere).
Bart.
------------------------------
Date: Thu, 08 Apr 1999 12:45:01 -0700
From: alan rogers <arogers@rational.com>
Subject: Newbie questions
Message-Id: <370D073D.B4CD1426@rational.com>
Hi,
What I trying to do is.
I am creating some files and then putting the result of a search into a
temp file.
It is next step that is causing me problems.
What I want to do is take each line of the file and then place data in
the file and repeat as many times as I have in the resultant file from
the search.
So if I have 5 lines in the file and then I need to loop 5 times and
place the data in 5 times.
Sorry for being a basic question.
Many thanks if you can help
Alan Rogers
------------------------------
Date: Thu, 8 Apr 1999 10:11:27 -0400
From: "Jason Simms" <ffchopin@worldnet.att.net>
Subject: Re: Newbie questions
Message-Id: <7eiee4$5b2$1@bgtnsc02.worldnet.att.net>
> So if I have 5 lines in the file and then I need to loop 5 times and
> place the data in 5 times.
Well, in the Perl FAQ, part 5, there is a section on writing/appending lines
in a file... But here is a real quick example of one way it could be done,
though there are probably others:
...SNIP...
# Open a filehandle with the file you want to change
open (CURRENTFILE, "myfile.txt") || die "Couldn't open myfile.txt: $!";
# Read all the lines into an array - used this way, each line
# is read into a separate line of the array
@file = <CURRENTFILE>;
close (CURRENTFILE);
# Loop through each "line" in the array, performing a RegEx to
# find/replace text, though you can pretty much do anything
# you want to the lines at this point.
foreach $i (@file) {
$i =~ s/string1/string2/gi;
}
# Delete the original (though you may want to write a backup copy
# of the original first...)
unlink myfile.txt;
# Open a new filehandle for the new copy of the file, write it, and close it
open (CURRENTFILE, ">myfile.txt") || die "Couldn't open myfile.txt:
$!";
print CURRENTFILE @file;
close (CURRENTFILE);
# END SCRIPT
Anyway, there it is... Play around with it, though ALWAYS back up your
files first...
Jason Simms
------------------------------
Date: 8 Apr 1999 06:04:05 -0500
From: kdp@nntp.hom.net (Keith Phillips)
Subject: Re: Problem passing variables to NT command file
Message-Id: <370c7f15@news.hom.net>
How are you passing the variable? If you just want the value
to go to the .CMD file, something like the following should work:
system(("mycmd.cmd " . $my_scalar))
Of course, in your command file, you reference the value as
'%1'.
On Wed, 7 Apr 1999 15:59:16 -0500, Turbo <rperez2@gte.net>
spoke unto us, saying:
>I am trying to pass a perl variable to a NT command file. The command file
>is not taking the variable, does anybody know if this is possible and how?
---------------------------------------------------------------
| Keith Phillips User: "Um, I can't find my files..." |
| kdp@hom.net Admin: "Files? What files?" |
---------------------------------------------------------------
------------------------------
Date: 8 Apr 1999 13:51:17 GMT
From: ecoffin@allegro.cs.tufts.edu (Erica Coffin)
Subject: Re: Quantum Variable
Message-Id: <7eic8l$grt$1@news3.tufts.edu>
Andrew Allen (ada@fc.hp.com) wrote:
: erica@coffin.org wrote:
: : The variable containing this unusual string is called $country.
: : It appears to have some mysterious escaped character on the end that does not
: : allow me to concatenate other strings onto the end (they disappear), yet,
: : executing things along the lines of:
: what does 'print ord chop $country;' yield?
: Andrew
115 (s). We have now come to name this "the anti-char". I'm now trying to modify the way this variable is passed to the script.
erica
------------------------------
Date: 8 Apr 1999 13:59:39 GMT
From: ecoffin@allegro.cs.tufts.edu (Erica Coffin)
Subject: Re: Quantum Variable
Message-Id: <7eicob$grt$2@news3.tufts.edu>
Ronald J Kimball (rjk@linguist.dartmouth.edu) wrote:
: What exactly are you doing with this string that leads you to believe
: the other strings "disappear"? How are you concatenating these other
: strings onto the end? What do you do with the string after you
: concatenate these other strings onto the end?
: Where is your code???
Right here:
local($machine,$country) = @_;
local($date,$file);
#mystery character at the end of $country was clipping
#any concatenation following $country
$country =~ m/(.*\w)/;
$country = $1;
$file = "../dir/dir/dir/".$country."_".$machine;
Testing the value of $file; generates "../dir/dir/dir/United States". (Yes, $machine is being set, and even if it weren't, I should at least be getting "../dir/dir/dir/United States_").
So, no laughing! At least not yet.
: You realize, of course, that I'll be forced to laugh at you if it turns
: out you're doing
: $country . $string;
: instead of
: $country .= $string;
------------------------------
Date: Thu, 8 Apr 1999 14:00:31 +0200
From: "Vincent Vanbiervliet" <vvb@NO_SPAMibm.net>
Subject: Re: question on $ENV{'abc'}
Message-Id: <370c99ee@news.uk.ibm.net>
To see all variables for %ENV, just try the following script:
foreach $item (sort keys %ENV) {
print "$item\t$ENV{$item}\n";
}
------------------------------
Date: Thu, 08 Apr 1999 16:47:46 +0200
From: Philip Newton <Philip.Newton@datenrevision.de>
Subject: Re: random number ( -w )
Message-Id: <370CC192.E7288D6C@datenrevision.de>
IndexFinger.com wrote:
>
> > You'd think people would at least read the 'perl' manpage/perldoc
> > if not the rest...
>
> Can't you just tell me?
"Tell a man what -w means, and he will be filled for one day. Teach him
how to read the documentation, and he will never go hungry".
-- Chinese proverb
Sam's just trying to be nice to you.
HTH, HAND
Cheers,
Philip
------------------------------
Date: Thu, 08 Apr 1999 08:16:04 -0400
From: vinod kudva <vinod.kudva@eds.com>
Subject: Re:Problem viewing PERL data in browser
Message-Id: <370C9E04.31F@eds.com>
PROBLEM DEFINATION: My PERL program retrieves data at the UNIX prompt,
but
does not display at the browser. (My best guess is because the data is
retrieved slowly from the database)
This is a copy of my program.
#!/usr/local/bin/perl
print "Content-type:text/html\n\n";
print "<HTML><head><title>TEST</title></head>\n";
print "<body>";
print "Hello";
use DBI;
use DBI::DBD;
my $dbh =
DBI->connect('xidbi:Oracle:adb_STUDENT.world','xxxxxx','xxxxx');
my $cursor = ($dbh)->prepare("select br_id from branch_tb");
$cursor->execute;
while (($branch_id) = $cursor->fetchrow()) {
print "$branch_id\n";
print "Hello1";
}
$cursor->finish;
$dbh->disconnect;
print "Hello3";
print "</body></HTML>";
--------x------------x-----------x-----------x--------x------
Here is the output of my program at the UNIX prompt:
Content-type:text/html
<HTML><head><title>TEST</title></head>
<body>Hello301
Hello1302
Hello1303
Hello1304
Hello1305
Hello1306
Hello1307
Hello1308
Hello1309
Hello1310
Hello1311
Hello1312
Hello1Hello3</body></HTML>
--------x------------x---------x---------x----------
The browser shows just 'Hello' at the screen and the document source of
the browser shows
<HTML><head><title>TEST</title></head>
<body>Hello
----x-----------x---------x---------x-----------
Thanks
vinod kudva
------------------------------
Date: 8 Apr 1999 10:53:48 GMT
From: makarki.NOSPAM@news.hit.fi (Matti Johannes Kdrki)
Subject: system-command under Win98
Message-Id: <7ei1rs$c5h$1@news.hit.fi>
What is wrong with ActivePerl? I'm trying start a program with following
command:
system('start index.html');
That command starts Internet Explorer and loads the index.html file.
But there is some strange delay between calling that system command and
starting the Explorer. My perl script stops for about ten seconds and it
seems that the Perl interpreter is doing nothing. What is causing that
delay? And how can I get rid of it?
Thanks in advance for all help. This 'feature' is very annoying.
--
Matti J. Kdrki
------------------------------
Date: Thu, 08 Apr 1999 12:39:10 GMT
From: gellyfish@gellyfish.com (Jonathan Stowe)
Subject: Re: system-command under Win98
Message-Id: <370ca0e4.16637965@news.dircon.co.uk>
On 8 Apr 1999 10:53:48 GMT, makarki@news.hit.fi (Matti Johannes Kdrki)
wrote:
>
>What is wrong with ActivePerl? I'm trying start a program with following
>command:
>
> system('start index.html');
>
>That command starts Internet Explorer and loads the index.html file.
>
Yes we knew that.
>But there is some strange delay between calling that system command and
>starting the Explorer. My perl script stops for about ten seconds and it
>seems that the Perl interpreter is doing nothing. What is causing that
>delay? And how can I get rid of it?
>
>Thanks in advance for all help. This 'feature' is very annoying.
>
Its your system matey - and as its windows I wouldnt care to
prognosticate what might be causing it.
On my system there is no perceptible difference in starting Internet
Explorer whether I run "start blah.html" at the command prompt or run
it with system() from within Perl. Because of the impoverished nature
of the Windows system I cant put any figures to it beyond a gnats
cock's difference.
P:\>perl -v
This is perl, version 5.005_02 built for MSWin32-x86-object
(with 1 registered patch, see perl -V for more detail)
Copyright 1987-1998, Larry Wall
Binary build 509 provided by ActiveState Tool Corp.
http://www.ActiveState.com
Built 13:37:15 Jan 5 1999
P:\>ver
Windows 98 [Version 4.10.1998]
/J\
------------------------------
Date: 08 Apr 1999 14:59:52 +0300
From: Janne Himanka <spam@oyt.oulu.fi>
Subject: Re: Threads: ready for real applications? Perl Internals.
Message-Id: <x4yak3nwzr.fsf@kyklos.oulu.fi>
I find the biggest obstacle to using threads with Perl to be the lack
of well-behaving modules. Most of the modules I most frequently use
(e.g. LWP) fail miserably when used in a multithreaded perl program.
It would be very nice to easily find out which modules can be used in
a threaded program.
Janne
--
Verba iactas + shem@oyt.erasethis.oulu.fi
ut imber aquas + Oulu University, Learning
at cave! vacca volat. + and Research Services
------------------------------
Date: Thu, 08 Apr 1999 16:02:51 +0200
From: William Blasius #42722 <Wm.Blasius@ks.sel.alcatel.de>
Subject: Re: wanted: elegant inverse operation for vec
Message-Id: <370CB70B.2781E494@ks.sel.alcatel.de>
Tad McClellan wrote:
>
> William Blasius #42722 (Wm.Blasius@ks.sel.alcatel.de) wrote:
>
> : the Subject pretty much says it all. I'm trying to come up with an
> : elegant way to turn a sparse bitfield into a set of "bit numbers".
> : ie: 00100100 becomes 2 5
> : I'd happily settle for an algorithm to get the number for a single
> : bit, but I'm having a bit of a bad brain day. There must be a good
> : popular idiom for this, iteration seems so...so...so...repetitive!
>
> I dunno how to do it without iteration, so here it is with
> iteration.
>
> It is not clear whether you want to manipulate a real bit vector,
> or a string of one and zero chars, so I did both.
>
> Note that this destroys the vector, but hopefully it will
> get you past your bad day.
>
> ---------------------
> #!/usr/bin/perl -w
> use strict;
>
<string algorithm snipped>
>
> ### bits are real bits
> $_ = 0x24;
> for (my $pos=0; $_; $_>>=1, $pos++) {
> print "$pos " if $_ & 1;
> }
> print "\n";
> ---------------------
> --
> Tad McClellan SGML Consulting
Unfortunately, this doesn't work for real bit vectors. Perl
doesn't seem to be smart enough to realize that bit vectors
are subject to bitwise operations. Hence:
#!/tools/gnu/bin/perl5 -w
use strict;
my $bits = "";
vec($bits, 2, 1) = 1; # set bits = '$'
vec($bits, 5, 1) = 1;
printf STDERR "\$bits=%s\n", $bits;
my @bits2;
for (my $pos=0; $bits; $bits >>= 1, $pos++) {
push(@bits2,$pos) if $bits & 1;
};
__END__
prints:
$bits=$
Argument "$" isn't numeric in bit_and at ...
I would have expected Perl to and them as either numbers or
strings - not bail! Is this a known bug? Already fixed? Not
having access to CPAN, I have no easy way to find out. FWIW
I'm running perl version 5.004.
Wm Blasius
Stuttgart
--
...now I'm <wm.blasius@ks.sel.alcatel.de> - no matter what my mail
server says!
------------------------------
Date: 12 Dec 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Dec 98)
Message-Id: <null>
Administrivia:
Well, after 6 months, here's the answer to the quiz: what do we do about
comp.lang.perl.moderated. Answer: nothing.
]From: Russ Allbery <rra@stanford.edu>
]Date: 21 Sep 1998 19:53:43 -0700
]Subject: comp.lang.perl.moderated available via e-mail
]
]It is possible to subscribe to comp.lang.perl.moderated as a mailing list.
]To do so, send mail to majordomo@eyrie.org with "subscribe clpm" in the
]body. Majordomo will then send you instructions on how to confirm your
]subscription. This is provided as a general service for those people who
]cannot receive the newsgroup for whatever reason or who just prefer to
]receive messages via e-mail.
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 5328
**************************************