[13331] in Perl-Users-Digest
Perl-Users Digest, Issue: 741 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Sep 8 13:07:22 1999
Date: Wed, 8 Sep 1999 10:05:16 -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 Wed, 8 Sep 1999 Volume: 9 Number: 741
Today's topics:
Announce: DBD::Ingres 0.20 released <ht000@foa.dk>
ANNOUNCE: DBD::Sybase 0.20 <mpeppler@peppler.org>
ANNOUNCE: MPEG::MP3Play 0.06 <joern@netcologne.de>
ANNOUNCE: MPEG::MP3Play 0.07 <joern@netcologne.de>
ANNOUNCE: Tie::Syslog <bseib@jade.cc.purdue.edu>
Re: Array of array. <doveNOruSPAM@stanfordalumni.org>
Re: Array of array. (Bill Moseley)
CGI scripts that dont return headers (Pablo Liska)
Code 39 barcode font available <stj5@my-deja.com>
Re: converting a number into a binary? (Greg Snow)
Re: coroutines in Perl (Sam Holden)
Re: edit this perl script (Larry Rosler)
Re: How to display milliseconds (Larry Rosler)
Re: integer mistery (Larry Rosler)
Re: mod_perl? help! <eyounes@aol.com>
Re: Old Script Doesn't Like My New Perl? Help! <sariq@texas.net>
Re: Password Problem <madebeer@igc.apc.org>
Re: Perl & mysql <eyounes@aol.com>
Re: perl Ad (Randal L. Schwartz)
Re: perl question <rhardicr@gw.ford.com>
Re: perl question <doveNOmxSPAM@stanfordalumni.org>
Re: Programmer's Editor (Randal L. Schwartz)
table of win32 script lang (revised) nielsenjf@my-deja.com
TempDir module 1.1 <sanface@sanface.com>
Re: Tries to download script when running <sariq@texas.net>
Re: Writing Oracle SQL for DBD-Oracle? <eyounes@aol.com>
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 8 Sep 1999 16:43:30 GMT
From: Henrik Tougaard <ht000@foa.dk>
Subject: Announce: DBD::Ingres 0.20 released
Message-Id: <7r63ni$j6a$1@play.inetarena.com>
I have just uploaded the Perl database driver for Ingres
database systems DBD::Ingres 0.20 to CPAN.
See <http://www.cpan.org/>.
It should be on its way
round the world now, and will arrive in
<http://www.cpan.org/modules/by-authors/Henrik_Tougaard/DBD-Ingres-0.20.tar.gz>
shortly.
Major changes:
- Added support for updateable cursors.
- Upgrade to support DBI 1.00.
- Now commits after inquiring for autocommit-state after connect.
- first bash at type_info_all
- added $dbh->table_info
- added $dbh->ping
- Don't export $sql_dbh etc as default. (Ingperl.pm)
Please see the README file for further information.
---
Henrik Tougaard ht@datani.dk (a.k.a. ht000@foa.dk)
WM-Data Datani A/S, Software Consultants, Copenhagen, Denmark
#include <disclaim.std>
------------------------------
Date: 8 Sep 1999 16:44:39 GMT
From: Michael Peppler <mpeppler@peppler.org>
Subject: ANNOUNCE: DBD::Sybase 0.20
Message-Id: <7r63pn$j6k$1@play.inetarena.com>
The uploaded file
DBD-Sybase-0.20.tar.gz
has entered CPAN as
file: $CPAN/authors/id/MEWP/DBD-Sybase-0.20.tar.gz
size: 51529 bytes
md5: 76828b634e260210f32a71b509e55f7e
>From the CHANGES file:
Release 0.20
Fix code to allow prepare, execute, execute, execute... on
statements that don't include ?-style placeholders.
Fix LENGTH/PRECISION/SCALE $sth attributes to be closer to the
DBI spec.
Fix core dump problem when binding undef values and having
trace >= 2.
Add syb_quoted_identifier connection/database handle attribute.
Add syb_oc_version read-only database handle attribute, returns the
Sybase library version that this binary is currently using.
Added the syb_rowcount $dbh attribute.
Added $sth->cancel().
Call the syb_err_handler (if one is defined) for client-side
errors.
Michael
--
Michael Peppler -||- Data Migrations Inc.
mpeppler@peppler.org -||- http://www.mbay.net/~mpeppler
Int. Sybase User Group -||- http://www.isug.com
Sybase on Linux mailing list: ase-linux-list@isug.com
------------------------------
Date: 8 Sep 1999 16:44:32 GMT
From: User um mit Netscape News zu lesen <joern@netcologne.de>
Subject: ANNOUNCE: MPEG::MP3Play 0.06
Message-Id: <7r63pg$j6j$1@play.inetarena.com>
I just uploaded MPEG::MP3Play 0.06 to CPAN.
http://www.perl.com/CPAN/modules/by-authors/id/J/JR/JRED/MPEG::MP3Play-0.06.tar.gz
Version 0.06 is a bugfix release eliminating a memory leak problem. You
should upgrade from earlier versions. There are no changes to the
interface.
NAME
MPEG::MP3Play - Perl extension for playing back MPEG music
SYNOPSIS
use MPEG::MP3Play;
my $mp3 = new MPEG::MP3Play;
$mp3->open ("test.mp3");
$mp3->play;
$mp3->message_handler;
DESCRIPTION
This Perl module enables you to playback MPEG music.
PREREQUISITES
Xaudio SDK
MPEG::MP3Play is build against the 3.0 version of the Xaudio SDK
and uses the async interface of the Xaudio library.
I don't know if older versions will work properly. The SDK is
not part of this distribution, so get and install it first
(http://www.xaudio.com/).
Perl
I built and tested this module using Perl 5.005_03. It should
work also with Perl 5.004_04 and above, but I did not test this.
If someone builds MPEG::MP3Play successfully with other versions
of Perl, plesase drop me a note.
Optionally used Perl modules
samples/play.pl uses Term::ReadKey if it's installed.
samples/handler.pl requires Term::ReadKey.
samples/gtk*.pl require Gtk.
INSTALLATION
First, generate the Makefile:
perl Makefile.PL
You will be prompted for the location of the Xaudio SDK. The
directory must contain the include and lib subdirectories, where
the Xaudio header and library files are installed.
make
make test
./runsample play.pl
./runsample handler.pl
./runsample gtk.pl
./runsample gtkhandler.pl
make install
SAMPLE SCRIPTS
There are some small test scripts in the samples directory. You
can run these scripts before 'make install' with the runsample
script (or directly with 'perl', after running 'make install').
For runsample usage: see above.
All scripts expect a mp3 file 'test.mp3' in the actual
directory.
play.pl Textmodus playback. Displays the timecode. Simple volume
control with '+' and '-' keys.
handler.pl
Does generally the same as play.pl, but uses the builtin
message handler. You'll see, that this solution is much
more elegant. It *requires* Term::ReadKey.
This script makes use of the debugging facility and is
best documented so far.
gtk.pl This script demonstrates the usage of MPEG::MP3Play with the
Gtk module. It produces a simple window with a progress
bar while playing back the test.mp3 file.
gtkhandler.pl
This script does the same as gtk.pl but uses the builtin
message handler concept instead of implementing message
handling by itself. Advantage of using the builtin
message handler: no global variables are necessary
anymore.
synopsis.pl
This one proves that the usage shown in the SYNOPSIS
*really* works ;)
BASIC CONCEPT
The concept of the Xaudio async API is based on forking an extra
process (or thread) for the MPEG decoding and playing. The
parent process controls this process by sending and recieving
messages. This message passing is asynchronous.
This module interface provides methods for sending common
messages to the MPEG process, eg. play, pause, stop. Also it
implements a message handler to process the messages sent back.
Eg. every message sent to the subprocess will be acknowledged by
sending back an XA_MSG_NOTIFY_ACK message (or XA_MSG_NOTIFY_NACK
on error). Error handling must be set up by handling this
messages.
You will find detailed information about the interface of
this module in its POD documentation
TODO
- Testing of all methods.
- Testing under Win32
- support of the full Xaudio API, with input/output
modules, etc.
- documentation: more details about the messages
hashes
- runsample.bat for Win32
Ideas, code and any help are very appreciated.
BUGS
- samples/gtk*.pl throw some Gdk messages on exit.
(not really a MPEG::MP3Play bug, I fear it documents
that I'm a beginner in coding Gtk+ applications ;)
- the runsample script currently works only under
Unix, it will fail under Win32
If you find a bug please send me a report. I will fix this as
soon as possible. Also I'm very interested to know, if someone
write applications based on this module. So don't hesitate to
send me an email, if you like (or not like ;) this module.
AUTHOR
Joern Reder, joern@netcologne.de
COPYRIGHT
Copyright (C) 1999 by Joern Reder, All Rights Reserved.
This library is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
The Xaudio SDK is copyright by MpegTV,LLC. Please refer to the
LICENSE text published on http://www.xaudio.com/.
SEE ALSO
perl(1), MPEG::MP3Info.
CHANGES
Revision history for Perl extension MPEG::MP3Play.
0.06 Mon Sep 06 1999, joern
- fixed a memory leak in the get_message* methods.
Thanks to Gene Senyszyn <scatt@goes.com> for the
detailed bug report
------------------------------
Date: 8 Sep 1999 16:44:47 GMT
From: Joern Reder <joern@netcologne.de>
Subject: ANNOUNCE: MPEG::MP3Play 0.07
Message-Id: <7r63pv$j6l$1@play.inetarena.com>
I just uploaded MPEG::MP3Play 0.07 to CPAN.
Its final destination is:
http://www.perl.com/CPAN/modules/by-authors/id/J/JR/JRED/MPEG::MP3Play-0.07.tar.gz
Version 0.07 is a bugfix release. You should upgrade from earlier
versions. There are no changes to the interface.
NAME
MPEG::MP3Play - Perl extension for playing back MPEG music
SYNOPSIS
use MPEG::MP3Play;
my $mp3 = new MPEG::MP3Play;
$mp3->open ("test.mp3");
$mp3->play;
$mp3->message_handler;
DESCRIPTION
This Perl module enables you to playback MPEG music.
PREREQUISITES
Xaudio SDK
MPEG::MP3Play is build against the 3.0 version of the Xaudio SDK
and uses the async interface of the Xaudio library.
I don't know if older versions will work properly. The SDK is
not part of this distribution, so get and install it first
(http://www.xaudio.com/).
Perl
I built and tested this module using Perl 5.005_03. It should
work also with Perl 5.004_04 and above, but I did not test this.
If someone builds MPEG::MP3Play successfully with other versions
of Perl, plesase drop me a note.
Optionally used Perl modules
samples/play.pl uses Term::ReadKey if it's installed.
samples/handler.pl requires Term::ReadKey.
samples/gtk*.pl require Gtk.
INSTALLATION
First, generate the Makefile:
perl Makefile.PL
You will be prompted for the location of the Xaudio SDK. The
directory must contain the include and lib subdirectories, where
the Xaudio header and library files are installed.
make
make test
./runsample play.pl
./runsample handler.pl
./runsample gtk.pl
./runsample gtkhandler.pl
make install
SAMPLE SCRIPTS
There are some small test scripts in the samples directory. You
can run these scripts before 'make install' with the runsample
script (or directly with 'perl', after running 'make install').
For runsample usage: see above.
All scripts expect a mp3 file 'test.mp3' in the actual
directory.
play.pl Textmodus playback. Displays the timecode. Simple volume
control with '+' and '-' keys.
handler.pl
Does generally the same as play.pl, but uses the builtin
message handler. You'll see, that this solution is much
more elegant. It *requires* Term::ReadKey.
This script makes use of the debugging facility and is
best documented so far.
gtk.pl This script demonstrates the usage of MPEG::MP3Play with the
Gtk module. It produces a simple window with a progress
bar while playing back the test.mp3 file.
gtkhandler.pl
This script does the same as gtk.pl but uses the builtin
message handler concept instead of implementing message
handling by itself. Advantage of using the builtin
message handler: no global variables are necessary
anymore.
synopsis.pl
This one proves that the usage shown in the SYNOPSIS
*really* works ;)
BASIC CONCEPT
The concept of the Xaudio async API is based on forking an extra
process (or thread) for the MPEG decoding and playing. The
parent process controls this process by sending and recieving
messages. This message passing is asynchronous.
This module interface provides methods for sending common
messages to the MPEG process, eg. play, pause, stop. Also it
implements a message handler to process the messages sent back.
Eg. every message sent to the subprocess will be acknowledged by
sending back an XA_MSG_NOTIFY_ACK message (or XA_MSG_NOTIFY_NACK
on error). Error handling must be set up by handling this
messages.
You will find detailed information about the interface of
this module in its POD documentation.
TODO
- Testing of all methods.
- Testing under Win32
- support of the full Xaudio API, with input/output
modules, etc.
- documentation: more details about the messages
hashes
- runsample.bat for Win32
Ideas, code and any help are very appreciated.
BUGS
- samples/gtk*.pl throw some Gdk messages on exit.
(not really a MPEG::MP3Play bug, I fear it documents
that I'm a beginner in coding Gtk+ applications ;)
- the runsample script currently works only under
Unix, it will fail under Win32
If you find a bug please send me a report. I will fix this as
soon as possible. Also I'm very interested to know, if someone
write applications based on this module. So don't hesitate to
send me an email, if you like (or not like ;) this module.
AUTHOR
Joern Reder, joern@netcologne.de
COPYRIGHT
Copyright (C) 1999 by Joern Reder, All Rights Reserved.
This library is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
The Xaudio SDK is copyright by MpegTV,LLC. Please refer to the
LICENSE text published on http://www.xaudio.com/.
SEE ALSO
perl(1), MPEG::MP3Info.
CHANGES
Revision history for Perl extension MPEG::MP3Play.
0.07 Wed Sep 08 1999, joern
- Bugfix: $mp3->get_message was broken in Version 0.06,
among other things the gtk* samples suffered from this
bug and did not function
- the creation of the message hash in MP3Play.xs and
conv_msg.c is now much more elegant. Thanks to
Dan Sugalski <dan@tuatha.sidhe.org> for the hint.
------------------------------
Date: 8 Sep 1999 16:43:40 GMT
From: Broc Seib <bseib@jade.cc.purdue.edu>
Subject: ANNOUNCE: Tie::Syslog
Message-Id: <7r63ns$j6b$1@play.inetarena.com>
Keywords: tie syslog error capture logging perl CGI
The module Tie::Syslog version 1.03 should soon be available on a CPAN
server near you. It is immediately available at http://vyking.com/CPAN.
Full documentation: http://vyking.com/CPAN/Tie-Syslog.html
-b
Tie::Syslog
===========
Copyright (C) 1999 Broc Seib. All rights reserved. This program
is free software; you can redistribute it and/or modify it under
the same terms as Perl itself.
Broc Seib, bseib@vyking.com
SYNOPSIS
========
use Tie::Syslog;
tie *MYLOG, 'Tie::Syslog', 'local0.error', 'my_program', 'pid';
print MYLOG "I made an error."; ## this will be syslogged
printf MYLOG "Error %d", 42; ## syslog as "Error 42"
untie *MYLOG;
DESCRIPTION
===========
This module allows you to tie a filehandle (output only) to
syslog. This becomes useful in general when you want to
capture any activity that happens on STDERR and see that it
is syslogged for later perusal. You can also create an arbitrary
filehandle, say LOG, and send stuff to syslog by printing to
this filehandle. This module depends on the Sys::Syslog module
to actually get info to syslog.
When used with STDERR, combined with the good habit of using
the perl -w switch, this module happens to be useful in
catching unexpected errors in any of your code, or team's
code. Tie::Syslog is pretty brain-dead. However, it can
become quite flexible if you investigate your options with
the actual syslog daemon. Syslog has a variety of options
available, including notifying console, logging to other
machines running syslog, or email support in the event of
Bad Things. Consult your syslog documentation to get
/etc/syslog.conf setup by your sysadmin and use Tie::Syslog
to get information into those channels.
------------------------------
Date: Wed, 08 Sep 1999 09:43:48 -0700
From: dove <doveNOruSPAM@stanfordalumni.org>
Subject: Re: Array of array.
Message-Id: <00372b38.46d82236@usw-ex0107-049.remarq.com>
Hi Christian,
I'm not sure if I can help, but I'll give it a try.
First of all, I'm not sure what types of variable d is so
I'm assuming it's an array (as indicated by @d).
@d is going to be an array of arrays. What this means is
that each element of @d will hold a reference to an
anonymous array.
The way this program is set up here, there will be three
anonymous arrays created of only one element long.
The variable 'test' should be @test, an array.
So the code here (I modified it just a bit.)
my @d = undef;
my @test = ("1","2","3");
for (my $i = 0; $i <= 2; $i++){
push @{$d[$i]},$test[i]; }
So this push line breaks down as follows.
The @{$d[$i]} part says to create an anonmous array and
store it's address in $d[$i]. The push part says to put the
i'th element of the test array into the 0th element of the
anonymous array who's address is stored in $d[$i].
If you added this code
for (my $i = 0; $i <= 2; $i++){
print "$i : $d[$i]\n"; }
You'd get output something like this:
0: ARRAY(0x2774)
1: ARRAY(0x3345)
2: ARRAY(0x4544)
This is the address of the three anonymous arrays.
If you added this code
for (my $i = 0; $i <= 2; $i++){
print "$i : $d[$i] : ${$d[$i]}[0]\n"; }
You'd get output that looked like this:
0: ARRAY(0x2774) : 1
1: ARRAY(0x3345) : 2
2: ARRAY(0x4544) : 3
For more information on this take a look at Recipe 11.1 in
the Perl Cookbook by Tom Christiansen and Nathan Torkington.
Hope this helps.
-=dav
In article <7r60am$k81$1@nnrp1.deja.com>,
christian.sylvestre@cetelem.fr wrote:
>Can somebody give me a bit of explanation for these couple
of lines of
>code....
>
>@d = ();
>@test = ("1","2","3");
>
>for (my $i = 0; $i <= 2; $i++){
> push @{$d[$i]},$test[i];
>}
>
>I am trying to understand this line : push
@{$d[$i]},$test[i];
>
>Thanks,
>
>Christian Sylvestre
>
>
>Sent via Deja.com http://www.deja.com/
>Share what you know. Learn what you don't.
>
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
------------------------------
Date: Wed, 8 Sep 1999 09:51:13 -0700
From: moseley@best.com (Bill Moseley)
Subject: Re: Array of array.
Message-Id: <MPG.124033dfcf4e4c7298971c@nntp1.ba.best.com>
christian.sylvestre@cetelem.fr (christian.sylvestre@cetelem.fr) seems to
say...
>
> @d = ();
> @test = ("1","2","3");
>
> for (my $i = 0; $i <= 2; $i++){
> push @{$d[$i]},$test[i];
> }
$\ = "\n";
print ref $_ foreach @d;
Each element of @d is a reference to an array;
foreach ( @d ) {
print $_ foreach @$_;
}
prints out their contents.
BTW my guess is that you didn't cut-n-past your code:
> push @{$d[$i]},$test[i];
^- bareword;
use strict;
I seem to rarely use a C-type for loop in my programs. Is that just me,
or is it perl?
--
Bill Moseley mailto:moseley@best.com
pls note the one line sig, not counting this one.
------------------------------
Date: Wed, 08 Sep 1999 16:56:06 GMT
From: "Pabs (Pablo Liska)" <liskajp@gusun.georgetown.edu>
Subject: CGI scripts that dont return headers
Message-Id: <Pine.SOL.3.96.990908124800.22889D-100000@gusun>
I have a script that takes votes from a website and records them on a
flatfile. I don't want to send anything back to the browser because i
dont want the page the user is on to reload. I wouldnt mind sending back
the totals on votes, but i dont want to have to reload the entire
page.
is there a way to either
1) not return headers without getting an error message
2) return some information (not headers, really) to a javascript that
would change the displayed page (dHtml) without forcing a reload?
Thanks,
Pablo
------------------------------
Date: Wed, 08 Sep 1999 16:21:04 GMT
From: Steve Jones <stj5@my-deja.com>
Subject: Code 39 barcode font available
Message-Id: <7r62d1$lo8$1@nnrp1.deja.com>
Hi All,
I've posted this message cos it seems there are a lot of people who are
looking for a barcode font.
I've found one for Code 39 (Code 3 of 9) barcodes, available for free
from this URL:
http://user.online.be/gd33771/barcode.html
I'm afraid there aren't any other symbologies that I found at this site.
Hope this helps some of you.
Cheers
Steve
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 8 Sep 1999 16:39:26 GMT
From: snow@statsci.com (Greg Snow)
Subject: Re: converting a number into a binary?
Message-Id: <7r63fu$aoi$1@junior.statsci.com>
In article <37D661F5.1293E218@ic.sunysb.edu>,
Z. Huang <zhuang@ic.sunysb.edu> wrote:
> can anyone tell me how to convert a number (integer or float) into a
>binary? For, example:
> 8 ---> 100
> 0.125---> 0.001
>
Here is a module I wrote a while back that handles conversions for bases
up to 62 (someday I'll expand beyond that) and it handles non-integers
(floats). I don't know if it's ready for CPAN or not (I know of some
improvements it needs, including docs), but you are welcome to either use
it as is or steal pieces of code from it to roll your own.
====================================
package Base;
require Exporter;
@ISA = qw(Exporter);
@EXPORT=('num_to_base', 'base_to_num', 'base_to_base');
use strict;
use Carp;
use vars qw(%num %char);
@char{0..61} = (0..9,'A'..'Z','a'..'z');
%num = reverse %char;
sub base_to_num {
my($orig,$base)=@_;
# first argument is the number to be converted, second is base converted from.
my $num = 0;
my $frac=1;
my $sign=1;
my ($seen_point,$digit);
$num =~ s/^\s+//;
$num =~ s/\s+$//;
$sign = -1 if tr/-//d;
$num =~ tr/a-z/A-Z/ if $base<37;
# we can be lazy and use either case for base 36 and below.
for (split //,$orig) {
if ( $_ eq '.' ) {
$seen_point=1;
next;
}
unless ( ($digit=$num{$_}) && ($digit<$base) ) {
carp "Illeagle digit $_ found, stopped conversion\n";
last;
}
if ($seen_point) {
$frac /= $base;
$num += $digit*$frac;
} else {
$num *= $base;
$num += $digit;
}
}
return $num*$sign;
}
sub num_to_base{
my $orig = shift;
my $base = shift;
my $decimal;
if ( @_ ) {
$decimal=shift;
} else {
$decimal=10;
}
# first argument is number to be converted, second is base,
# optional third is how many decimal places to go to
my $num = '';
my $exponent =0;
my $digit;
if ($orig<0) {
$num = '-';
$orig *= -1;
}
if ($orig==0) {
$num = '0';
return $num;
}
if ( $orig >= 1 ) {
$exponent++ while $orig >= $base**($exponent+1);
} else {
$exponent-- until $orig >= $base**$exponent;
$num .= '0';
if ($exponent < -1) {
$num .= '.'.('0' x (-1 * ($exponent+1)));
}
}
while ( $exponent>(-1*$decimal-1) ){
$num .='.' if $exponent == -1;
$digit=0;
while ($orig >= $base**$exponent){
$digit++;
$orig -= $base**$exponent;
}
$num .= $char{$digit};
$exponent--;
}
return $num;
}
sub base_to_base {
my $num = shift;
my $from = shift;
my $to = shift;
my $decimal;
if ( @_ ) {
$decimal = shift;
} else {
$decimal = 10;
}
return num_to_base( base_to_num($num,$from), $to, $decimal );
}
--
-------------------------------------------------------------------------------
Gregory L. Snow | Inertia makes the world go round,
(Greg) | Love makes the trip worth taking.
snow@statsci.com |
------------------------------
Date: 8 Sep 1999 16:22:08 GMT
From: sholden@pgrad.cs.usyd.edu.au (Sam Holden)
Subject: Re: coroutines in Perl
Message-Id: <slrn7td39g.ll1.sholden@pgrad.cs.usyd.edu.au>
On Wed, 08 Sep 1999 15:24:20 GMT, misha26@my-deja.com wrote:
>Hello,
>
>This should be easy but I just can't figure it
>out. I am trying to run a background process,
>write to its input, read from its output, maybe
>write to input again, etc.
>
>My first thouhg was
>
>open (F, "| command |");
>
>but that doesn't work. I spent a couple of hours
>reading manuals but the second thouhgt has not
>come yet.
Most people would read the manual that is about the subject at hand.
Which in this case would be 'perlipc'
>
>Does anyone have any idea how to do this?
perldoc perlipc has a few.
--
Sam
Many modern computer languages aspire to be minimalistic. They either
succeed in being minimalistic, in which case they're relatively useless,
or they don't succeed in being truly minimalistic, in which case you can
actually solve real problems with them. --Larry Wall
------------------------------
Date: Wed, 8 Sep 1999 09:14:58 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: edit this perl script
Message-Id: <MPG.12402b5d98b04cae989f2d@nntp.hpl.hp.com>
In article <si906hldly.fsf@cre.canon.co.uk> on Wed, 8 Sep 1999 13:47:05
GMT, Gareth Rees <garethr@cre.canon.co.uk> says...
> W. Lyle Hayhurst <wlhst6+@pitt.edu> wrote:
> > Perl script to find the longest word in the dictionary that only uses
> > the top row of the keyboard for letters.
>
> $ perl -ne '$w = $_, $l = length if /^[qwertyuiop]+$/i && length > $l;
> END { print $w }' < words
If you care how long it takes to run, you might consider replacing the
regex with
!tr/QqWwEeRrTtYyUuIiOoPp\n//c
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 8 Sep 1999 09:31:29 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: How to display milliseconds
Message-Id: <MPG.12402f392c3f0851989f2e@nntp.hpl.hp.com>
In article <7r5qrb$fpj$1@nnrp1.deja.com> on Wed, 08 Sep 1999 14:12:07
GMT, curtisbeard@my-deja.com <curtisbeard@my-deja.com> says...
> Can anyone help me?
>
> I need to display the time in a program I am making.
> I can display everything except for the milliseconds.
> e.g. the hours, minutes, and seconds
>
> I want to add the milliseconds.
This is a repeat post. I think the reason you didn't get an answer the
first time is that no one understood what you are asking for. I still
don't.
Possibly the answer to your question will be founr in perlfaq8: "How can
I measure time under a second?"
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 8 Sep 1999 09:43:40 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: integer mistery
Message-Id: <MPG.12403218813b1043989f2f@nntp.hpl.hp.com>
In article <7r5leh$7ra$1@lublin.zrz.tu-berlin.de> on 8 Sep 1999 12:39:45
-0000, Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> says...
> Larry Rosler <lr@hpl.hp.com> wrote in comp.lang.perl.misc:
>
> >That subtracts two numbers that are relatively close in magnitude. Kiss
> >precision goodbye.
>
> I tend to mix up the two myself, but wouldn't that be accuracy you
> lose? The precision is still that of a float, but it's inaccurate.
>
> If I'm wrong, I'm sure someone will soon teach me to apply common
> sense to technical terminology.
I understand it differently.
When one subtracts two floating-point numbers of nearly equal magnitude,
the precision of the result is not that of a float -- it may be much
less, down to zero precision. Some number of the low-order bits of the
mantissa are going to be zero always, depending on how close the two
numbers are.
However, the *accuracy* of the result will always be exact, within the
precision of the result.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Wed, 8 Sep 1999 18:10:24 +0200
From: "Ysteric's" <eyounes@aol.com>
Subject: Re: mod_perl? help!
Message-Id: <7r61k4$iai@news.vtcom.fr>
I've made an installation guide ... in French. I can't translate it (no
time).
Do you want it anyway ?
Eric - France
------------------------------
Date: Wed, 08 Sep 1999 10:58:21 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: Old Script Doesn't Like My New Perl? Help!
Message-Id: <37D6879D.F4205C7A@texas.net>
Jeff Zucker wrote:
>
> Dan Poynor wrote:
> >
> > Use of uninitialized value at /home/httpd/cgi-bin/rotate.pl line 7.
> >
> > ---------here's the script rotate.pl-------------
> > #! /usr/bin/perl
> >
>
> Hmm, a -w error with no -w on the shebang line! That means your script
> was not -w safe and your new perl must be run through a server or a
> batch file or something that automatically adds -w. This means you will
> have to check all your scripts to make sure all variables are
> initialized, not a bad thing in the long run.
Umm, no, he used -w at the command line.
- Tom
------------------------------
Date: Wed, 08 Sep 1999 00:53:57 -0700 (PDT)
From: Michael de Beer <madebeer@igc.apc.org>
Subject: Re: Password Problem
Message-Id: <APC&1'0'50775d9f'd79@igc.apc.org>
Andy,
Have you looked at your .htpasswd file to make sure it has your
username:password entries ?
If so, I would guess it is one of three things:
a) webserver misconfiguration -- it isn't using the .htpasswd file or
isn't allowing the people in it to get access to the relevant resource
b) webserver/htpasswd mismatch -- Apache and Netscape, for example,
expect differently encrypted .htpasswd file. You may be using a
method for Apache .htpasswd files with a Netscape webserver.
(This may not be an issue for all Netscape web servers, but I have
seen this in at least one case ).
c) something wrong with the perl code you showed that I didn't see.
As always, use -w and check the results of your close() function -- they
might tell you something obvious.
Good luck.
-Michael
------------------------------
Date: Wed, 8 Sep 1999 18:11:48 +0200
From: "Ysteric's" <eyounes@aol.com>
Subject: Re: Perl & mysql
Message-Id: <7r61mo$iaj@news.vtcom.fr>
You can make a 'fetchall' first, and then a random.
Eric - FRANCE
------------------------------
Date: 08 Sep 1999 09:20:30 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: perl Ad
Message-Id: <m1r9k9v0hd.fsf@halfdome.holdit.com>
>>>>> "One" == One Bored Guru <" <One.Bored.Guru........@p0.f1.n30.z30.fidonet.org>> writes:
One> Attention Perl-5/Linux Programmers.
One> The Sync3 Developement Team is looking for Perl-5/Linux programmers
One> to help on an open source project writing a new type of bbs designed
One> for Linux and The Internet. If you think you have the skill and are
One> interested, please send email to devteam[at]sync3.com indicating your
One> interest and providing us with the relevant details pertaining to
One> your skill level and previous experience. Thank you for your time
One> and interest.
This is the same post about, what, 10 times now?
How many private emails do I need to send you to say "don't post jobs
here". How many times do you need to be ridiculed in public as well
to know that your unsolicited commercial posting is not welcome?
Oh yeah, and so the spammers get your address... devteam@sync3.com
There. Hope you're happy with that.
Just another guy yearning for the days when people actually read news.announce.newusers,
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Wed, 08 Sep 1999 16:35:17 +0100
From: Richard H <rhardicr@gw.ford.com>
Subject: Re: perl question
Message-Id: <37D68235.58C94268@gw.ford.com>
Divyesh Mistry wrote:
>
> Hi,
>
> Can anyone supply me with a script that make database calls.
>
> Thanks.
yes.
could you put less effort into your question??
Richard H
------------------------------
Date: Wed, 08 Sep 1999 09:50:16 -0700
From: dove <doveNOmxSPAM@stanfordalumni.org>
Subject: Re: perl question
Message-Id: <24cc8d18.48877018@usw-ex0107-049.remarq.com>
Hi Divyesh,
This is a little vague. Here's a quick script that uses the
DBI module to make database calls to a MySQL database.
Other relational databases are similar.
#!/usr/local/bin/perl
use DBI;
my $dbh = DBI->connect("DBI:mysql:$database:$host", $user,
$password);
if (!defined $dbh) {
die "Cannot connect to MySQL Server: $DBI::$errstr\n";
}
my $sth = $dbh->prepare("SELECT * from $table");
if (!defined $sth) {
die "Cannot prepare statement: $DBI::$errstr\n";
}
$sth->execute();
while (@row = $sth->fetchrow()) {
print "ROW: @row\n";
}
$sth->finish();
$dbh->disconnect();
Hope this helps.
-=dav
In article <7r5t66$8h3@nile.intac.com>, divyesh@intac.com
(Divyesh Mistry) wrote:
>Hi,
>
>Can anyone supply me with a script that make database
calls.
>
>Thanks.
>
* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!
------------------------------
Date: 08 Sep 1999 09:16:34 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Programmer's Editor
Message-Id: <m1wvu1v0nx.fsf@halfdome.holdit.com>
>>>>> "William" == William <bivey@teamdev.com> writes:
William> If the Perl syntax highlighting in UltraEdit-32 isn't complete,
William> it's easy to make it so (and your fault if you don't). It's
William> controlled by a simple-to-edit text file. (There were a couple
William> of shortcomings in the stock file, but fixing that only took a
William> few minutes.)-Wm
It's a statement like that that proves you don't know how complex it
is to parse Perl *correctly*.
<sigh>
Go back and look at my examples. Understand *why* the editor needs to
know the semantics of both "sin" and "time". And then recall that
there are many more punctuation characters like "/" that have a
different meaning depending on whether a term or an operator is
expected.
You'd stop getting my ire up if you merely posted a disclaimer
"handles basic Perl constructs only, but can be easily fooled by
typical code". That's all I'm looking for you to admit. To claim
that you handle an unqualified "syntax highlighting" means you either
don't know what you are talking about, or you are lying. Either way,
bad for consumer.
print "Just another Perl hacker,"
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Wed, 08 Sep 1999 16:32:00 GMT
From: nielsenjf@my-deja.com
Subject: table of win32 script lang (revised)
Message-Id: <7r6320$mgg$1@nnrp1.deja.com>
Here is a cleaned up version of the table, hopefully it looks
better on usenet.
Python looks to be in the lead.
Unfortunately, I haven't had many comments from vbscript guys
Biggest plusses:
Vbscript: _easy_, Microsoft behind it
Python:easy but powerful, multithreaded including/MTA,STA,free
has tools to generate the C++ code for it given the IDL fil
Perl:fast,powerful,many win32 modules, will have in-proc flock(really
cool since win32 createprocess is a resource hog)
Biggest problems:
Perl's biggest problem -- lack of MTS support
Vbscript -- weak,closed, limited OS access, limited to microsoft
Python--locking isn't cross platform like perl's
Question:
Both python and perl are powerful enough to develop big projects like
Zope. Does anyone develop anything serious like that in vbscript or even
vb?
----------------vbscript----------perl---------python
open------------no----------------yes---------- yes
cross/platform--no----------------yes----------yes
ease_of_use-----easy--------------medium-------easy
object/orient---weak--------------good---------good
multi-thread----no----------------recent-------fully
file_system-----text_only?--------full---------full
basic/locking-- no(obviously)-----flock--------mscvrt
speed------------?----------------excellent----ok?
open_c++_access-no----------------swig---------swig
win32_access----no----------------almost full--almost full
database_access-ADO---------------ADO,odbc,dbi-ADO,odbc
raw_lang_power--weak--------------excellent----excellent
except_handeling-poor-------------ok(eval)-----yes(try except)
adsi------------good--------------ok-----------ok?
MTS-------------ok----------------?------------excellent
COM_ease--------easy--------------medium-------easy
make_COM_comp---scriptlets only---yes----------yes
COM_debugging---?-----------------?------------yes
limited w/idisp-yes---------------yes----------no
COM_threading---STA---------------STA----------MTA,STA,free
COM_error_handel-?----------------?------------?
project_size----small_to_medium---big----------big
code_size-------big---------------small--------medium
code_style------cumbersome--------efficient----clean
Comments from users:
*Point is, use VB for its strength...GUI frontends, and Python for its
strength...strong, fast core functionality.
*For _anything_ other than GUI code (which VBScript doesnt do anyway)
the LOC for a Python solution will always be smaller than for VB.
* Almost any language can support huge projects with the correct
standards and organization.
*The question is not IF, but HOW EASY. And at what cost.
* for anything a bit more advanced you need some OLE/COM/ActiveX...
object that either you or someone else wrote in C or something. And
that you almost always have to PAY for them. On the other hand
almost all Perl modules are FREE . . .And besides you have the
SOURCE of both Perl and all the modules.
Notes---
1)Python has tools to generate the C++ code for it given the IDL file
-- really cool
2)Perl will get in-proc fork -- really cool since nt createprocess is
a pig and the other alternative -- threading is like a razor --
if you're not a surgeon you'll make a bloody mess
(to paraphrase what I read somewhere).
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 8 Sep 1999 16:44:21 GMT
From: SANFACE Software <sanface@sanface.com>
Subject: TempDir module 1.1
Message-Id: <7r63p5$j6i$1@play.inetarena.com>
Thanks for all your suggestions, they help this module to grow up.
What is tmpdir?
Every PERL tool use temporary files.
If you want your code can be simply portable on different OS, you need
to select the correct temporary directory. The purpose of this module
is to check the correct temporary directory in every OS supported by
PERL to use it.
We need your help.
We ask you to send us the correct tempory directory for every OS
supported by PERL and to suggest us good modifies (sanface@sanface.com).
The news:
The name of the module is changed from tmpdir to TempDir
Added a new tempdir check method for Windows 32 OS [by Markus Laker]
Added a new similar tempdir check method for Unix
Added BeOS support [by David Cantrell]
The new list of Unix OS:
aix bsd386 dec_osf dgux freebsd hp_osf1 hpux irix linux mips_osf1
netbsd next sco sco_xenix solaris sunos svr4 sysv ultrix uts
The latest version of this library is likely to be available from:
SANFACE Software (http://www.sanface.com)
every CPAN mirror S/SA/SANFACE/
Copyright 1999, SANFACE Software
This module is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
--
SANFACE Software
http://www.sanface.com
mailto:sanface@sanface.com
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: Wed, 08 Sep 1999 11:02:08 -0500
From: Tom Briles <sariq@texas.net>
Subject: Re: Tries to download script when running
Message-Id: <37D68880.42E65E0E@texas.net>
missymanning@my-deja.com wrote:
>
> I have a problem...I have a perl script that I am trying to switch from
> unix to nt. It works fine on the unix but on nt it tries to
> download...any suggestions. I am new to nt so please be specific. I
> set the permissions and associations but still tries to download when I
> run it.
This has nothing to do with Perl.
Try asking elsewhere. Perhaps it's the webserver, perhaps it's the
browser.
- Tom
------------------------------
Date: Wed, 8 Sep 1999 18:17:42 +0200
From: "Ysteric's" <eyounes@aol.com>
Subject: Re: Writing Oracle SQL for DBD-Oracle?
Message-Id: <7r621q$iam@news.vtcom.fr>
Look at this, a select example...
#!/usr/bin/perl
#
# Exemple permettant de visualiser un produit
# par sion identifiant
#
#
# by: Eric YOUNES
# le:29 janvier 1999
# --------------------------------------------------------------------
use DBI;
open(fOUT, ">out.txt") or die "Impossible de creer out.txt : $!\n";
$ENV{'ORACLE_HOME'} = "C:\\ORANT";
$ENV{'NLS_LANG'} = "French_france.WE8ISO8859P1";
@DB_DSN = ( 'dbi:Oracle:<SID>', 'user', 'password',
{
PrintError => 1,
RaiseError => 1,
AutoCommit => 0,
LongReadLen => 900000,
LongTruncOk => 1
}
);
$dbh = DBI->connect(@DB_DSN) or die $DBI::errstr;
print "Entrez l'identifiant : ";
$fiche = <STDIN>;
chomp($fiche);
$sql = qq{SELECT pr_id, nom,famille,descriptif FROM produits where pr_id = ?
};
$sth = $dbh->prepare($sql);
$rc = $sth->execute($fiche) || die " error --- $DBI::errstr";
if(defined(@row = $sth->fetchrow_array )) {
$id = @row[0];
print fOUT qq{[pr_id] : @row[0]\n};
print fOUT qq{[nom] : @row[1]\n};
print fOUT qq{[famille] : @row[2]\n};
print fOUT qq{[descriptif] : @row[3]\n};
print fOUT "------------------------------------------\n";
} else {
print "fiche pas trouve $rc\n";
}
$sth->finish;
$dbh->disconnect;
close fOUT;
print "--- The end... ---";
<STDIN>;
Jamie Schrumpf a écrit dans le message
<7r1vue$t8f$5@ash.prod.itd.earthlink.net>...
>Does anyone have any examples of using Perl to call Oracle SQL without
using
>procedures? All the examples from perldoc use them, and there must be a
way to
>pass SQL without having to use preset procs.
>
>Examples or pointers to resources will be very much appreciated.
>--
>---------------------------------------------------------------------------
----
>Jamie Schrumpf
http://home.earthlink.net/~moncominc
>
>
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 99)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
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" from
almanac@ruby.oce.orst.edu. The real FAQ, as it appeared last in the
newsgroup, can be retrieved with the request "send perl-users FAQ" from
almanac@ruby.oce.orst.edu. 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" from
almanac@ruby.oce.orst.edu.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V9 Issue 741
*************************************