[10593] in Perl-Users-Digest
Perl-Users Digest, Issue: 4185 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Nov 9 23:07:29 1998
Date: Mon, 9 Nov 98 20:00:24 -0800
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, 9 Nov 1998 Volume: 8 Number: 4185
Today's topics:
Re: catch warn'ings in while (<>)... <rootbeer@teleport.com>
Re: Converting HTML tag and attribute case - Regular Ex <rootbeer@teleport.com>
DenverBoulder.pm Nov 16 (Chris Fedde)
Re: Directory listing on remote host <rootbeer@teleport.com>
Re: Effectively replacing browser's history entries <buchanpj@hatespam.citec.qld.gov.au>
Re: Emulate dirname and basename in perl?? (Martien Verbruggen)
Re: EOF condition before actual EOF <rootbeer@teleport.com>
File upload/Netscape4.0.7> <ccarr@websocket.com>
Files and Hashes <hn40@columbia.edu>
Re: Hash of Hash problem <rootbeer@teleport.com>
Re: HELP , I just can figure this out <jhardy@cins.com>
Help with WinNT CGI-Perl mila@stars.gsfc.nasa.gov
Re: How to run perl scripts written in C++ on windows? <kperrier@blkbox.com>
Re: I hope this isn't a dumb question ... <rootbeer@teleport.com>
Learning Perl by video <timlank@cfw.com>
Re: Looking for a web site with good script examples (Erik)
Re: Looking for Perl CGI Top Site script <rootbeer@teleport.com>
Re: Need help on whereami(); (Alastair)
Re: Need help on whereami(); <rwilliamson@uno.gers.com>
Re: Need help on whereami(); (Alastair)
Re: Need help on whereami(); (Martien Verbruggen)
Re: Need help on whereami(); <rwilliamson@uno.gers.com>
Re: ODBC problem........ <rrayborn@slip.net>
Parallel to Serial eric.wai@bcs.org.uk
Re: Perl & MS personal web server <rootbeer@teleport.com>
Re: Perl/Win'95 (Erik)
Re: Perl/Win'95 <carvdawg@patriot.net>
Re: Printing binary and loading binary numbers <rootbeer@teleport.com>
Re: Prof Help Needed (Joergen W. Lang)
Re: Reading mail from POP3 server (Alastair)
Re: Running perl scripts inside perl scripts (TIA) (Martien Verbruggen)
Re: Running perl scripts inside perl scripts (TIA) (Erik)
Re: Running perl scripts inside perl scripts (TIA) <tchrist@mox.perl.com>
Re: Shared CGI.pm from various directories <rootbeer@teleport.com>
Re: split and replace????? (Ronald J Kimball)
Re: sysread() Question <rootbeer@teleport.com>
Re: Time Stamp email <rootbeer@teleport.com>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 10 Nov 1998 03:17:59 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: catch warn'ings in while (<>)...
Message-Id: <Pine.GSO.4.02A.9811091913200.2742-100000@user2.teleport.com>
On Mon, 9 Nov 1998, Alex Davies wrote:
> Am trying to catch (and ignore) the:
>
> warn "Can't open $ARGV: $!\n";
>
> messages within a while (<>) {} loop.
>
> Setting a $SIG{'__WARN__'} handler does not seem to catch these
> warnings...
I'm not sure whether it should or not. But you probably shouldn't use that
shortcut if you don't want the warnings; just do it "the hard way". Or,
before the loop starts, remove from @ARGV any items for which -r isn't
true; it's not perfect, but it's probably sufficient. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 10 Nov 1998 03:49:16 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Converting HTML tag and attribute case - Regular Expression help
Message-Id: <Pine.GSO.4.02A.9811091948100.2742-100000@user2.teleport.com>
On Tue, 10 Nov 1998, Lee Borkman wrote:
> I am trying to make an RE to convert all HTML tag names and tag
> attribute names to upper case.
Don't try to make a simple regular expression for this; you need a real
parser. HTML::Parser is on CPAN. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 9 Nov 1998 20:11:03 -0700
From: cfedde@cfedde.corp.merc.com (Chris Fedde)
Subject: DenverBoulder.pm Nov 16
Message-Id: <728as7$12j$1@cfedde.corp.merc.com>
Denver/Boulder Perl Mongers
Wynkoop Brewing Co.
1634 18th, DENVER CO
Monday, November 16, 1998
6:30PM
thanks
chris
------------------------------
Date: Tue, 10 Nov 1998 03:31:17 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Directory listing on remote host
Message-Id: <Pine.GSO.4.02A.9811091929590.2742-100000@user2.teleport.com>
On Mon, 9 Nov 1998, Dave Smith wrote:
> Does anyone know of a way to perform a 'readlink' command on a remote
> UNIX server in perl?
It sounds as if you're connecting to a remote machine via a protocol.
Perhaps the protocol has some way to do what you want. The docs, FAQs, and
newsgroups about the protocol would probably be a good place to look next.
Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 10 Nov 1998 12:53:57 +1000
From: Paul Buchanan <buchanpj@hatespam.citec.qld.gov.au>
Subject: Re: Effectively replacing browser's history entries
Message-Id: <3647AAC5.FDB8D500@hatespam.citec.qld.gov.au>
damn.. it doesn't take much to get flamed around here...
gee.. ahh... sorry
Sam Holden wrote:
> This has absolutely nothing to do with perl.
>
> The answer is obviously that you just use the normal meta tag for the job :
> <META NAME="HISTORY" VALUE="SKIP THIS PAGE DAMN IT YOU DUMB BROWSER">
>
> If you want an answer from someone who might actually know something about
> web stuff, why don't you ask in a newsgroup about web stuff...
>
> --
> Sam
>
> It has been discovered that C++ provides a remarkable facility for
> concealing the trival details of a program--such as where its bugs are.
> --David Keppel
------------------------------
Date: Tue, 10 Nov 1998 02:03:49 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Emulate dirname and basename in perl??
Message-Id: <9aN12.129$ay.210944@nsw.nnrp.telstra.net>
In article <727v5a$1o8$1@news-2.news.gte.net>,
Dennis Moreno <dennis.moreno@safetran.com> writes:
> I'm lookin for an example of emulating the unix "basename" and
> "dirname" commands using perl.
# perldoc File::Basename
Martien
--
Martien Verbruggen | My friend has a baby. I'm writing down
Webmaster www.tradingpost.com.au | all the noises the baby makes so later
Commercial Dynamics Pty. Ltd. | I can ask him what he meant - Steven
NSW, Australia | Wright
------------------------------
Date: Tue, 10 Nov 1998 03:36:58 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: EOF condition before actual EOF
Message-Id: <Pine.GSO.4.02A.9811091936380.2742-100000@user2.teleport.com>
On Mon, 9 Nov 1998 aclamann@hotmail.com wrote:
> Subject: EOF condition before actual EOF
> Perl version 5.005_02 built for MSWin32-x86-object
binmode? Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 09 Nov 1998 20:38:53 -0600
From: Clinton Carr <ccarr@websocket.com>
Subject: File upload/Netscape4.0.7>
Message-Id: <3647A73D.DAFD6295@websocket.com>
I just noticed that the CGI.pm file upload feature does not work in
Netscape 4.0.7 or Netscape 4.5.
Any workarounds?
Thanks
------------------------------
Date: Mon, 9 Nov 1998 22:45:40 -0500
From: Himani Naresh <hn40@columbia.edu>
Subject: Files and Hashes
Message-Id: <Pine.GSO.3.95qL.981109224526.5568A-100000@monire.cc.columbia.edu>
Hello,
I'm looking for a way to compare files in perl without actually comparing
them line by line. Since I have to compare a file to about 200 others, I'm
looking for some sort of hash function that will take any file and create a
unique hash value. Then to compare my files, I just have to see if the hash
value is already existent in my database.
Does anyone know of such a hash function for files that will guarantee a
unique hash for any file?
Thank you.
Himani Naresh
_______________________________________________________________________
Himani Naresh
Computer Science Department
Columbia University
hn40@columbia.edu
God put me on earth to accomplish a certain number of things.
Right now I am so far behind, I will never die.
-- Calvin and Hobbes
------------------------------
Date: Tue, 10 Nov 1998 02:36:38 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Hash of Hash problem
Message-Id: <Pine.GSO.4.02A.9811091828380.2742-100000@user2.teleport.com>
On Mon, 9 Nov 1998, Sylvain St.Germain wrote:
> I am filling a Hash table using:
>
> while(<API>) {
> chomp( $func = $_);
> $api{$func} = { COUNT=>0, FOUND=>0};
> }
> to my surprise every values are the same,
Could you be using a very (very) old version of Perl? If you're using at
least 5.004_04, see whether you can make a small stand-alone example
program which demonstrates the behavior you're seeing. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 10 Nov 1998 01:58:20 GMT
From: John Hardy <jhardy@cins.com>
Subject: Re: HELP , I just can figure this out
Message-Id: <3647580B.6B543BE0@cins.com>
This almost works!
Begin
________________________________________________
use diagnostics; ## Use Diagnostics module for debugging
use OLE; ## Call
OLE module
use Win32::ADO; ## Call ADO module
$Conn = CreateObject OLE "ADODB.Connection"; ## Create connection
Object
$CMD = CreateObject OLE "ADODB.Command";
$PRM = CreateObject OLE "ADODB.Parameter";
$Conn->Open("DSN=iHRS;UID=sa;PWD="); ## Open the connection
$Conn or die "Cannot Connect";
my ($LOCK_EX);
$LOCK_EX = 2;
$file =
'VVarin';
# Name the file
open(INFO, $file) or die "Couldn't open INFO
file"; # Open the file
flock (INFO, $LOCK_EX) || bail ("cannot flock $file: $!");
while ( <INFO> ) {
chomp;
( $key, $value ) = split /:/;
$linesin{$key}=$value;
};
close(INFO);
foreach $key (sort keys %linesin ) {
$value=$linesin{$key};
}
$CMD->{CommandText} = "CandidateINS";
$CMD->{CommandType} = adCmdStoredProc;
$PRM=$CMD->CreateParameter->{"fname"}="$linesin{fname}";
$PRM=$CMD->CreateParameter->{"lname"}="$linesin{lname}";
$PRM=$CMD->CreateParameter->{"address"}="$linesin{address}";
$PRM=$CMD->CreateParameter->{"po_box"}="$linesin{po_box}";
$PRM=$CMD->CreateParameter->{"city"}="$linesin{city}";
$PRM=$CMD->CreateParameter->{"province"}="$linesin{province}";
$PRM=$CMD->CreateParameter->{"postal_code"}="$linesin{postal_code}";
$PRM=$CMD->CreateParameter->{"country"}="$linesin{country}";
$PRM=$CMD->CreateParameter->{"email"}="$linesin{email}";
$PRM=$CMD->CreateParameter->{"telephone"}="$linesin{telephone}";
$PRM=$CMD->CreateParameter->{"ext"}="$linesin{ext}";
$PRM=$CMD->CreateParameter->{"fax"}="$linesin{fax}";
$PRM=$CMD->CreateParameter->{"citizen_ship"}="$linesin{citizen_ship}";
$PRM=$CMD->CreateParameter->{"citizen_status"}="$linesin{citizen_status}";
$PRM=$CMD->CreateParameter->{"comment"}="$linesin{comment}";
$CMD->{ActiveConnection}=$Conn;
$RS=$CMD->Execute;
## IT runs with no errors except (see below)
#$RS->Close;
##when I uncomment this it complains it can't call method "Close" on
undefined value which means $RS=""
## Which means its not sending anything to the procedure?? I don't know
where Execute is sending it
## I must have the wrong
parameters for Execute, when I run it through the Debugger I can see it
passsing the paramater values
## Do I have to Append
each of these values before executing ??
#$Conn->Close;
Tom Phoenix wrote:
> On Mon, 9 Nov 1998, John Hardy wrote:
>
> > Subject: HELP , I just can figure this out
>
> > I just can't seem to figure this thing out.
>
> Well, make up your mind! :-)
>
> Please check out this helpful information on choosing good subject
> lines. It will be a big help to you in making it more likely that your
>
> requests will be answered.
>
> http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
>
> > No matter what I do it gags at
>
> > $CMD->Parameters("lname")->{value}=$linesin{$lname};
>
> > The error I am now getting is use of uninitialized variable. A value
>
> > used as either a hard refernce or symbolic reference must be a
> defined
> > value. Can't use an undefined value as a Hash reference.
>
> Well, let's look at that line a little at a time.
>
> $CMD
>
> That's an ordinary scalar, although the name is unusual.
>
> $CMD->Parameters("lname")
>
> Now you're doing a method call. The method name is Parameters, and
> you're
> passing it the string "lname" as a parameter. The method call is being
>
> made upon the object $CMD. That must be a valid method for that
> object,
> or you'd have gotten a different error.
>
> $CMD->Parameters("lname")->{value}
>
> Now you're using that returned value as a hashref, and dereferencing
> it.
> Hey, could that returned value have been undef?
>
> $CMD->Parameters("lname")->{value}=$linesin{$lname};
>
> Now you're storing a value ($linesin{$lname}) into that hash. It looks
> as
> if the only place where that error could have appeared is if that
> method
> call's return value was undef. Maybe you should check to see whether
> the
> method call is really doing what you want. Good luck!
>
> --
> Tom Phoenix Perl Training and Hacking Esperanto
> Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 10 Nov 1998 01:59:04 GMT
From: mila@stars.gsfc.nasa.gov
Subject: Help with WinNT CGI-Perl
Message-Id: <7286l8$bgt$1@nnrp1.dejanews.com>
Hello,
I have an executable that I can run from my perl command, that I run thus:
Within perl:
system 'c:\..\..\*.exe';
This works from Perl and opens the program on the machine, runs it and
returns a result (a gif).
When I try to run the same thing from an HTML form page (CGI with post
command) it doesnt run the program. Note, the CGI is correctly accessing the
perl program as I can run it to pass a simple variable and return something..
ex.. 'Hello 'name', where name was input through the form.
Can anyone please help me with this problem? Is this a permission problem on
the executable?
Thanks,
Mila Mitra
mila@remss.com
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: 09 Nov 1998 21:10:16 -0600
From: Kent Perrier <kperrier@blkbox.com>
Subject: Re: How to run perl scripts written in C++ on windows?
Message-Id: <ysin260450n.fsf@blkbox.com>
Dale Sutcliffe <dales@enhanced-performance.com> writes:
> How to run perl scripts written in C++ on windows 98?
>
If you figure how to do this please let me know!
:)
Kent
------------------------------
Date: Tue, 10 Nov 1998 03:33:54 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: I hope this isn't a dumb question ...
Message-Id: <Pine.GSO.4.02A.9811091932430.2742-100000@user2.teleport.com>
On Mon, 9 Nov 1998, Ultranet News wrote:
> Subject: I hope this isn't a dumb question ...
Please check out this helpful information on choosing good subject
lines. It will be a big help to you in making it more likely that your
requests will be answered.
http://www.perl.com/CPAN/authors/Dean_Roehrich/subjects.post
> As a recent convert I was wondering if anyone has a version of Perl
> for WindowsCE (version 1)?
If there is, it should be on CPAN. If there isn't, perhaps you should see
about porting it. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 9 Nov 1998 22:39:18 -0500
From: "Tim Lank" <timlank@cfw.com>
Subject: Learning Perl by video
Message-Id: <728co4$2ru@cutter.cfw.com>
Does anyone know of a good video series for learning Perl? I've got the
camel book, and the teach yourself in 21 days book, but I'd like to learn
via video if a good series is available.
Thanks in advance,
Tim Lank
------------------------------
Date: 9 Nov 1998 22:22:44 GMT
From: eln@cyberhighway.net (Erik)
Subject: Re: Looking for a web site with good script examples
Message-Id: <727pvk$nk1$2@news.cyberhighway.net>
In article <sHJ12.1431$Sn6.5341@news.cwix.com>,
"Jim Mosier" <jim.mosier@mci.com> writes:
> NE1?
1.) You only need to post once, I don't need to see the same message from
you 3 times.
2.) This is a newsgroup for perl programmers, not people looking for perl
scripts. If you are looking for something on the Internet (including
scripts), try a search engine.
3.) Speak English. Abbreviations like the above are puerile at best.
Try to follow the above rules, and further rules stated in the newsgroup
FAQ, and you will probably find the Perl community will be much more
helpful to you.
-- Erik Nielsen, Cyberhighway Internet Services NOC
It's documented in The Book, somewhere...
-- Larry Wall in <10502@jpl-devvax.JPL.NASA.GOV>
------------------------------
Date: Tue, 10 Nov 1998 03:28:20 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Looking for Perl CGI Top Site script
Message-Id: <Pine.GSO.4.02A.9811091927430.2742-100000@user2.teleport.com>
On Mon, 9 Nov 1998, Paul A.H. van Veen wrote:
> I'm looking for a Perl CGI Top Site script.
> If possible, I'm looking for a free script.
If you're wishing merely to _find_ (as opposed to write) programs,
this newsgroup may not be the best resource for you. There are many
freeware and shareware archives which you can find by searching Yahoo
or a similar service. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 10 Nov 1998 02:06:55 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: Need help on whereami();
Message-Id: <slrn74f7s7.8c.alastair@calliope.demon.co.uk>
Rusty Williamson <rwilliamson@uno.gers.com> wrote:
>Hi!
>
>The scripts I'm writing need to access data files and other scripts which
>reside in directories relative to where the scripts are installed. This can
>be anywhere. What is the best way to determine this?
Look at the Cwd module i.e. 'use Cwd'. I think it's standard.
perldoc Cwd
HTH.
--
Alastair
work : alastair@psoft.co.uk
home : alastair@calliope.demon.co.uk
------------------------------
Date: Mon, 9 Nov 1998 18:43:57 -0800
From: "Rusty Williamson" <rwilliamson@uno.gers.com>
Subject: Re: Need help on whereami();
Message-Id: <kJN12.175$DA6.31655@news.connectnet.com>
Hi Alastair!
No, I don't think cwd will help. Doesn't cwd return the current working
directory? The scripts can be run from any directory and also by cron.
This means that a user might run the script from their home directory in
which case, as far as I can tell, cwd will return their home directory. In
the case of cron, I think cwd returns /.
If I'm off base let me know.
Rusty
Alastair wrote in message ...
>Rusty Williamson <rwilliamson@uno.gers.com> wrote:
>>Hi!
>>
>>The scripts I'm writing need to access data files and other scripts which
>>reside in directories relative to where the scripts are installed. This
can
>>be anywhere. What is the best way to determine this?
>
>Look at the Cwd module i.e. 'use Cwd'. I think it's standard.
>
>perldoc Cwd
>
>HTH.
>
>--
>
>Alastair
>work : alastair@psoft.co.uk
>home : alastair@calliope.demon.co.uk
------------------------------
Date: Tue, 10 Nov 1998 02:49:28 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: Need help on whereami();
Message-Id: <slrn74fac1.8c.alastair@calliope.demon.co.uk>
Rusty Williamson <rwilliamson@uno.gers.com> wrote:
>Hi Alastair!
>
>No, I don't think cwd will help. Doesn't cwd return the current working
>directory? The scripts can be run from any directory and also by cron.
>This means that a user might run the script from their home directory in
>which case, as far as I can tell, cwd will return their home directory. In
>the case of cron, I think cwd returns /.
>
>If I'm off base let me know.
So why not just 'cwd' to the script directory? (and change back to current at
the end ofcourse).
--
Alastair
work : alastair@psoft.co.uk
home : alastair@calliope.demon.co.uk
------------------------------
Date: Tue, 10 Nov 1998 03:10:55 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Need help on whereami();
Message-Id: <39O12.136$ay.265268@nsw.nnrp.telstra.net>
In article <slrn74fac1.8c.alastair@calliope.demon.co.uk>,
alastair@calliope.demon.co.uk (Alastair) writes:
> Rusty Williamson <rwilliamson@uno.gers.com> wrote:
>>Hi Alastair!
>>
>>No, I don't think cwd will help. Doesn't cwd return the current working
>>directory? The scripts can be run from any directory and also by cron.
>>This means that a user might run the script from their home directory in
>>which case, as far as I can tell, cwd will return their home directory. In
>>the case of cron, I think cwd returns /.
>>
>>If I'm off base let me know.
>
> So why not just 'cwd' to the script directory? (and change back to current at
> the end ofcourse).
I think you might have misunderstood the original question, or maybe I
am wrong. The original poster seems to want to know the directory
where the script is located, not the directory from which the script
is run. He doesn't know which directory the script is in, or he
wouldn't need to find out, so he can't cd there and back.
Inspecting $0 or using FindBin might be of more help. There was a
thread on this newsgroup not that long ago about this. You can use
dejanews to find it.
# perldoc perlvar
# perldoc FindBin
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | 75% of the people make up 3/4 of the
Commercial Dynamics Pty. Ltd. | population.
NSW, Australia |
------------------------------
Date: Mon, 9 Nov 1998 19:44:58 -0800
From: "Rusty Williamson" <rwilliamson@uno.gers.com>
Subject: Re: Need help on whereami();
Message-Id: <xCO12.176$DA6.31776@news.connectnet.com>
Alastair-
Gulp, I get the terrible feeling I'm missing something very simple
>So why not just 'cwd' to the script directory? (and change back to current
at
>the end ofcourse).
How can the Perl script, upon execution, do that?
The user can install the package (scripts and related files) anywhere. Lets
say on one system its /admin/arm, on another its /usr/sbin/arm and on
another its /home/arm. There will be 3 situations under which the script
will be executed, Alastair:
1. A user, at the UNIX prompt, runs the script (the script's bin directory
has been added to $PATH).
2. Another script in the same directory will run it.
3. A cron job, setup during installation and knowing where the user
installed it will run it using the full path.
In all three cases the script must ask "Where do I live?" in order to find
data files and/or other scripts. In the first case its ugly -- take apart
$PATH and search... oh uck! The second case cwd will work. The third case
`dirname $0` will work. So what do you do?
Rusty
------------------------------
Date: Mon, 9 Nov 1998 18:43:45 -0800
From: "Randal Rayborn" <rrayborn@slip.net>
Subject: Re: ODBC problem........
Message-Id: <72893q$mh1$1@owl.slip.net>
I use this syntax...
use Win32::ODBC;
$DSN = "DataSet"; # ODBC Registration name
if (!($db = new Win32::ODBC($DSN)))
{
print "Error connecting to $DSN\n";
print "Error: " . Win32::ODBC::Error() . "\n";
exit;
}
You DID remember to register the database, didn't you...? If so, maybe you
should reinstall Win32::ODBC.
Randal
Casema wrote in message <727503$hjp$1@sun4000.casema.net>...
>Hi newsgroup,
>
>I am trying to explore Dave Roth's ODBC module with following code and get
>this error message:
>
>Can't locate object method "new" via package win32:ODBC at data.pl line 3
>Can you help? And most important, would you????
>
>Code:
>
>use WIN32::ODBC;
>
>my($db) = new WIN32::ODBC('base');
>$db->Sql("SELECT * FROM News");
>
>while ($db->Fetchrow()) {
> my(%data) = $db->DataHash();
>
> print "content-type: text/html", "\n\n";
> print "<HTML><BODY>\n";
> print "<TR><TD>$data{'ID'} id-nummer";
> print " <TD>$data{'date'} Datum";
> print " <TD>$data{'time'} Tijd";
> print " <TD>$data{'head'} Header";
> print " <TD>$data{'news'} Nieuws";
>}
>$db->Close();
>print "</BODY></HTML>";
>
>Obviously I'm trying to extract data from base.mdb, located in my perl/bin
>directory.
>I am using perl5.004.002 on windows98........
>
>thanks,
>
>Michel
>
>
------------------------------
Date: Tue, 10 Nov 1998 01:58:04 GMT
From: eric.wai@bcs.org.uk
Subject: Parallel to Serial
Message-Id: <7286jc$bge$1@nnrp1.dejanews.com>
Hi,
I am trying to hook up the Parallel Port on a PC with the Serial Port on a SUN
running Solaris 2.5.1. When the PC sends a file to the printer/parallel port,
it will be captured by the SUN.
Signal from the Parallel Port will go thru a Parallel-to-Serial converter and
convert to serial signal before it is fed into the ttya of the SUN box. For
example, if I do "echo hello world > lpt1". The text will get convert to
serial signal and pump into the Serial port of the Solaris machine.
Since it is the first step of my project, I have written a simple Perl program
on the SUN and try to capture the signal.
#!/usr/local/bin/perl5 -w
open(COM_PORT, "< /dev/ttya") || die "cannot read from /dev/ttya\n";
while (! (eof COM_PORT)) {
$char = getc COM_PORT;
print "(",ord $char,")(",$char,")\n";
}
close COM_PORT;
exit;
As expected, "hello world" is captured by my program. However, the PC keeps
sending the newline character (ascii 10) to the SUN. If I keep the set
up/program running, my SUN will end up crashed with error message
"output_echo_char: out of blocks" appears on the console.
Can anyone tell me why the PC keeps sending out the newline character after
"hello world", and how could I stop it.
Thanks in advance.
Eric.
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 10 Nov 1998 03:20:59 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Perl & MS personal web server
Message-Id: <Pine.GSO.4.02A.9811091920060.2742-100000@user2.teleport.com>
On Mon, 9 Nov 1998, Melanie Lampert wrote:
> I'm trying to run a perl script on MS personal web server (win 95)
Sounds as if you need to configure your web server. The docs, FAQs, and
newsgroups about web servers should be helpful for you. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 9 Nov 1998 22:15:00 GMT
From: eln@cyberhighway.net (Erik)
Subject: Re: Perl/Win'95
Message-Id: <727ph4$nk1$1@news.cyberhighway.net>
In article <3647236E.D763E906@patriot.net>,
Marquis de Carvdawg <carvdawg@patriot.net> writes:
> Perl runs on both 95/98 and NT. For the latest version of Perl for the
> 32-bit Windows (ie, Win32) platforms, go to:
>
> http://www.activestate.com
Bad, bad, bad. Win32 perl is included in the perl standard distribution,
and it's a lot more likely to work with standard perl stuff (modules and
such) than activestate's abomination. You can pick up binaries for it
at www.perl.com if you don't have a C compiler.
-- Erik Nielsen, Cyberhighway Internet Services NOC
Not that I'm against sneaking some notions into people's heads upon
occasion. (Or blasting them in outright.)
-- Larry Wall in <199710211624.JAA17833@wall.org>
------------------------------
Date: Mon, 09 Nov 1998 22:07:08 +0000
From: Marquis de Carvdawg <carvdawg@patriot.net>
Subject: Re: Perl/Win'95
Message-Id: <3647678C.C8D3A69@patriot.net>
> I admit that my review of activestate is based on earlier versions.
Let me start by saying that I appreciate the time that you and the otherexperts
put into responding on this newsgroup. One or two of the questions
I have asked have been answered quite well...the issue of creating custom
IP packets is still out, though...You know, I was actually starting to consider
your earlier comments...I mean,one wouldn't expect that denizens of alt.2600 or
alt.hacker to hang around
a 'group like this. I started to ask why it is that you feel that ActiveState's
build is an 'abomination'. I wondered why you would come out so forthright
against it. Then I find out that you pulled your statement out of thin air...
> However, it would seem to me to be wise to stick with the standard
> distribution, thereby assuring that if your version of Perl acts strangely,
> you can be reasonably sure it acts strangely in the same way it does for
> everyone else using Perl.
I haven't seen anything wrong with ActiveState's build yet. Yes, I admit, I
amnew to Perl on Win32, but I downloaded build 506, added some modules using
ppm, and everything seems to work just fine. Those scripts that I have written
that aren't unique to NT (ie, use or call NT-specific functions) seem to work
just
fine on Linux, even with '-w'.
> I do appreciate that activestate is bringing perl to a wider audience, and
> I'll have to take your word for it that their newer releases are actually
> worthwhile (as I'm sure you know, the earlier ones tended to break basic
> functionality in a lot of things), but I can't see any compelling reason to
> champion a distribution put out by a third party when there is a port
> included with the standard distribution, which you can be reasonably sure
> is and probably will continue to be more compatible with everyone else's
> perl, and thereby functionality-adding modules and such, than any other
> port available. There's no guarantees activestate won't start breaking
> things again in later releases. By the same token, there's no real
> guarantee that the win32 port included in the standard distribution won't
> break either, but knowing that its deemed worthy by the core developers to be
> included as part of the standard distribution should give you some sort of
> feeling of security about its functionality.
Interesting. You have already admitted that you have no ground to stand on,yet
you still continue.
> But then, I guess if you were all that concerned about functionality and
> lack of bugs, you wouldn't be running win32 in the first place ;)
>
Oh, nice dig.
------------------------------
Date: Tue, 10 Nov 1998 03:02:18 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Printing binary and loading binary numbers
Message-Id: <Pine.GSO.4.02A.9811091848370.2742-100000@user2.teleport.com>
On Mon, 9 Nov 1998, Wilson Snyder wrote:
> With the printf now being built in (THANKS!), I'd like to suggest two
> improvements to the perl baseline:
>
> 1. printf ("%[someletter]", ... Where the output is in binary.
I think you're asking for a binary output format for printf. It could be
added, I suppose. But can't you get what you want now with unpack?
> 2. reading literals 0b11111 == 15, Where the number is converted from
> binary ala 0x.
Well, you could do this with pack, but I can see how this would be more
convenient. And I don't see any reason that these abilities couldn't be
added to Perl. So, when you have the patch ready, let everyone know! :-)
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 10 Nov 1998 00:25:45 +0100
From: jwl@_munged_worldmusic.de (Joergen W. Lang)
Subject: Re: Prof Help Needed
Message-Id: <1di92dy.10hjrvgy5f0n4N@host061-210.seicom.net>
Frank <debot@xs4all.nl> wrote:
> I need a script which can delete the first or last line of a data file.
> If the 11th line is added that the first line is deleted. Or reversed.
Please read the fine manual that came with Perl. The answer to your
question is in perlfaq5 :
How do I change one line in a file/delete a line in a file/insert a
line in the middle of a file/append to the beginning of a file?
To reverse a line use reverse().
$string = "Bousouli";
$rev_string = reverse $string;
hth, HAND,
Joergen
--
To reply by email please remove _munged_ from address Thanks !
-------------------------------------------------------------------
"Everything is possible - even sometimes the impossible"
HOELDERLIN EXPRESS - "Touch the void"
------------------------------
Date: Tue, 10 Nov 1998 02:09:09 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: Reading mail from POP3 server
Message-Id: <slrn74f80e.8c.alastair@calliope.demon.co.uk>
Gopinath Venkataramanan <vgopinat@cisco.com> wrote:
>I need to read mails that are received to an id. I hv written filters
>which will read these mails and input it into a database.
>basically a requirement for storing the feedback on a business function
>for analysis from a database
I couldn't fathom much of that but, from your subject line, I'd look for things
that mention POP mail at CPAN ;
http://www.cpan.org
--
Alastair
work : alastair@psoft.co.uk
home : alastair@calliope.demon.co.uk
------------------------------
Date: Tue, 10 Nov 1998 02:02:24 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Running perl scripts inside perl scripts (TIA)
Message-Id: <Q8N12.128$ay.210944@nsw.nnrp.telstra.net>
In article <727s6n$pqi$1@news-1.news.gte.net>,
"Christian M. Aranda" <christian.aranda@iiginc.com> writes:
There really was no need to post this message 5 times.
> Scripts 0, 3, and 4 must be run first, but can be run at the same time.
> Script 1 must be run before script 2. Script 5 must be run last. Each of
> these scripts takes a command line argument of a file name.
>
> What I was thinking of doing was using system(filename0 &bg),
> system(filename3 &bg), system(filename4 &bg) to run them in the background
> and then run scripts 1,2, and 5. This doesn't seem like the optimal way of
> doing things and because the dataload will take at least 15 hours as it is,
> I'd like to save as many cycles as possible.
I think you should probably look into fork and do. The perlipc
documentation has some examples on how to fork a bunch of children,
and how to communicate with them.
# perldoc perlipc
# perldoc -f fork
# perldoc -f do
Martien
--
Martien Verbruggen | My friend has a baby. I'm writing down
Webmaster www.tradingpost.com.au | all the noises the baby makes so later
Commercial Dynamics Pty. Ltd. | I can ask him what he meant - Steven
NSW, Australia | Wright
------------------------------
Date: 10 Nov 1998 01:59:20 GMT
From: eln@cyberhighway.net (Erik)
Subject: Re: Running perl scripts inside perl scripts (TIA)
Message-Id: <7286lo$vf$1@news.cyberhighway.net>
In article <727s6n$pqi$1@news-1.news.gte.net>,
"Christian M. Aranda" <christian.aranda@iiginc.com> writes:
> Scripts 0, 3, and 4 must be run first, but can be run at the same time.
> Script 1 must be run before script 2. Script 5 must be run last. Each of
> these scripts takes a command line argument of a file name.
>
> What I was thinking of doing was using system(filename0 &bg),
> system(filename3 &bg), system(filename4 &bg) to run them in the background
> and then run scripts 1,2, and 5. This doesn't seem like the optimal way of
> doing things and because the dataload will take at least 15 hours as it is,
> I'd like to save as many cycles as possible.
Never mind that this isn't really a perl question (the simplest way would
probably to write a small shell script to do this), it's a question
not about perl posted 5 times on a perl newsgroup.
Please post inquiries only once. If your post doesnt appear right away, wait
for it, don't repost it.
Bourne shell. background processes. the wait function.
have fun.
--
Erik Nielsen, Cyberhighway Internet Services NOC
Tactical? TACTICAL!?!? Hey, buddy, we went from kilotons to megatons
several minutes ago. We don't need no stinkin' tactical nukes.
(By the way, do you have change for 10 million people?) --lwall
------------------------------
Date: 10 Nov 1998 02:48:28 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Running perl scripts inside perl scripts (TIA)
Message-Id: <7289hs$oh$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
"Christian M. Aranda" <christian.aranda@iiginc.com> writes:
:Scripts 0, 3, and 4 must be run first, but can be run at the same time.
:Script 1 must be run before script 2. Script 5 must be run last. Each of
:these scripts takes a command line argument of a file name.
system qq{
script0 $file &
script3 $file &
script4 $file &
wait
script1 $file
script2 $file
script5 $file
};
--tom
--
"Software is like sex: It's better when it's free." (Linus Torvalds, from
FSF T-shirt)
------------------------------
Date: Tue, 10 Nov 1998 02:10:57 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Shared CGI.pm from various directories
Message-Id: <Pine.GSO.4.02A.9811091759590.2742-100000@user2.teleport.com>
On Mon, 9 Nov 1998 bill_mcintyre@my-dejanews.com wrote:
> I quickly built a linux box with Apache 3 on it and installed
> (properly?) perl 5.00403. All seems to work well but I still need to
> have CGI.pm in the same location as the scripts that calls it. What
> Bozo thing did I do now?
Hard to say. Did you use the command 'make install' to install the new
perl binary and its accompanying whatnot? Could it be that the #! line of
your program points to an old perl? Could you be relying upon features new
to CGI.pm since 5.004_03 came out? There are probably other possibilities,
but these are all of the reasonably-likely ones I can think of at the
moment. Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Mon, 9 Nov 1998 21:40:10 -0500
From: rjk@coos.dartmouth.edu (Ronald J Kimball)
Subject: Re: split and replace?????
Message-Id: <1di8wqg.1av80m01f5ibriN@bay1-265.quincy.ziplink.net>
Colin Kuskie <ckuskie@cadence.com> wrote:
> What you're looking for is called concatenation. Read the perlop manpage
> for more information on these solutions:
>
> > $result = $a . " " . $b;
> > $result = "$a $b";
>
> There is one more solution that was left out:
>
> $result = join ' ', $a, $b;
Just one?
$result = $a;
substr($result, length $a) = ' ';
substr($result, length $a) = $b;
($result = $a) =~ s/(?!\n)$/ $b/;
$result = sprintf "%s %s", $a, $b;
;-)
--
_ / ' _ / - aka - rjk@coos.dartmouth.edu
( /)//)//)(//)/( Ronald J Kimball chipmunk@m-net.arbornet.org
/ http://www.ziplink.net/~rjk/
"It's funny 'cause it's true ... and vice versa."
------------------------------
Date: Tue, 10 Nov 1998 02:25:05 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: sysread() Question
Message-Id: <Pine.GSO.4.02A.9811091818320.2742-100000@user2.teleport.com>
On 9 Nov 1998, Uri Guttman wrote:
> BD> My ultimate goal is to determine if the contents of this buffer
> BD> is all zeros.
>
> this should work:
>
> $buffer =~ /^\x00*$/
This should work somewhat more reliably:
my $naught_but_nulls = ($buffer =~ /^\0*(?!\n)$/);
The first could be mistaken if the last byte in the buffer happens to be
the newline character. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 10 Nov 1998 03:46:24 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Time Stamp email
Message-Id: <Pine.GSO.4.02A.9811091942440.2742-100000@user2.teleport.com>
On Thu, 5 Nov 1998, Rodney Payne wrote:
> I am wanting to process email thru a script that assigns a ticket
> number to the email and responses to the emailer with the ticket
> number,
>
> What would take place is :
>
> a@a.com would email the script which would cc the email to b@b.com
> with a ticket number and the contents of the email, it would also send
> a copy of the same ticket number and email back to a@a.com
> any ideas..
You should probably write a program to do the work. If you're trying to
decide upon what language to write it in, I'd recommend Perl. There are a
number of helpful Perl modules that you can find on CPAN. If you need more
information on how to send or read mail from Perl, see the Perl FAQ. Hope
this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 12 Jul 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 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 4185
**************************************