[11776] in Perl-Users-Digest
Perl-Users Digest, Issue: 5376 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Apr 13 22:07:28 1999
Date: Tue, 13 Apr 99 19:00:23 -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 Tue, 13 Apr 1999 Volume: 8 Number: 5376
Today's topics:
Another dumb question (Paul Burridge)
Can't load module tzadikv@my-dejanews.com
Comparing two arrays...help! cgi@higherlove.com
Re: Comparing two arrays...help! (Tim Herzog)
Re: Examples of slow regexes? (Kai Henningsen)
Re: HASH OF HASH OF LIST <rick.delaney@home.com>
Re: HASH OF HASH OF LIST (Tad McClellan)
Re: Help: From Unix to NT (Earl Hood)
Re: How to write a format to an array instead of a file <rick.delaney@home.com>
Re: How to write a format to an array instead of a file (Earl Hood)
Re: How to write a format to an array instead of a file (Earl Hood)
Re: Is it possible to have "..." appear while processin <poohba@io.com>
Looking for $num = Round ($num, $digits); <martin.baur@mindpower.com>
Re: Looking for $num = Round ($num, $digits); <tchrist@mox.perl.com>
Re: need help with Net::SSLeay 1.03 installation under (Martin Kuchlmayr)
Re: No echo on a socket connection kevin_collins@my-dejanews.com
Perl rmdir <support@counter.w-dt.com>
Re: Perl rmdir (Tim Herzog)
Re: Perl rmdir <tchrist@mox.perl.com>
Re: Perl rmdir <support@counter.w-dt.com>
Re: Perl rmdir <support@counter.w-dt.com>
perlcc: not loading modules (Tim Herzog)
Re: Printing a file (Joshua Justice)
Re: Printing a file (Bart Lateur)
Problems installing module MIME-Base64-2.11 kstinson@hotmail.com
Re: Putting a pause or a delay within a perl program (Alastair)
Q: Convert two newlines to \n<p> (Mike Collins)
referring to form generated variables <mikej@1185design.com>
regex - camel and llama cannot help (Eric Smith)
Re: regex - camel and llama cannot help (Tim Herzog)
Re: TPJ still shipping? <gregm@well.com>
Re: TPJ still shipping? (Gareth Jones)
Re: Web-DB integration - how was it for you? <keithmur@mindspring.com>
Re: what does this error msg mean? <rick.delaney@home.com>
What Kind of Program should i first make? <WizeGuy@nettaxi.com>
Re: What Kind of Program should i first make? (Tim Herzog)
Special: Digest Administrivia (Last modified: 12 Dec 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Tue, 13 Apr 1999 23:34:51 GMT
From: osiris@thanatos.win-uk.net (Paul Burridge)
Subject: Another dumb question
Message-Id: <1883@thanatos.win-uk.net>
Hi,
Am having problems with v.5 of the perl compiler. When running the
compiler on a target source file, it appears to do *something* and
spews out a load of info as it compiles and links as one would
expect. No error messages generated during this, either. However,
when I come to look for an executable file that I expect the
program to have created, there's nothing; no .exe, no .obj, no
.mak, nothing but the original source code file. Having run "find
<filename.exe>" (using the usual Windows command) through the
entire HD. and still no executable found, I'm wondering what's
going wrong. Any ideas? I'm running a PC with Windows 98, BTW.
Thanks.
-Paul
--
Noverint universi presentes et futuri
------------------------------
Date: Tue, 13 Apr 1999 22:26:07 GMT
From: tzadikv@my-dejanews.com
Subject: Can't load module
Message-Id: <7f0g9n$qj8$1@nnrp1.dejanews.com>
I have a script running on AIX that uses DBI to talk to a DB2 database. It
starts out with:
use DBI;
use DBD::DB2;
The script works fine on my machine, but when I try running it on the
customer's machine, I get:
Can't load '/usr/local/lib/perl5/site_perl/5.005/aix/auto/DBD/DB2/DB2.so'
for module DBD::DB2: dlopen:
/usr/local/lib/perl5/site_perl/5.005/aix/auto/DBD/DB2/DB2.so: A file or
directory in the path name does not exist. at
/usr/local/lib/perl5/5.00502/aix/DynaLoader.pm line 168. at ./report line 64
BEGIN failed--compilation aborted at ./report line 64.
The "./report line 64" in the error message is referring to the line in my
script that contains "use DBD::DB2". (The reason it's all the way on line 64
is that there are a bunch of comments at the top of the file.) Interestingly
enough, there seems to have been no problem with the "use DBI;" line right
above it, so it's not a general problem of not being able to load anything.
The funny thing is... the "DB2.so" file it says does not exist, does in fact
exist, in the proper directory, and has permissions that make it readable and
executable to all users.
In case it's relavent, I had used somewhat of a shortcut to install perl and
the DBI and DBD::DB2 modules on the customer's machine. I just made a
compressed tar file of /usr/local/bin/*perl* and /usr/local/lib/*perl* and
shipped it to the customer's machine. I thought that seemed OK, because both
me and the customer have AIX at the same OS level. Since I am not physically
at the customer's site (I'm doing everything by phone and FTP), I wanted to
avoid having to do a build there.
Let me know if you have any ideas....
Thanks,
Tzadik
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Wed, 14 Apr 1999 00:19:27 GMT
From: cgi@higherlove.com
Subject: Comparing two arrays...help!
Message-Id: <3713d677.27043452@news.phnx.uswest.net>
I am trying to compare a database against itself by reading it into
two arrays and comparing the current line in the first array against
each line in the second array
I know the code below is rough, but do I have the nesting of the two
foreach routine correct for the files to compare the way I want them
to?
Thanks!
open (DATA1, "<data.db");
# removed flock routine for easier reading
@database_array1 = <DATA1>;
close (DATA1);
open (MEMBER2, "<data.db");
# removed flock routine for easier reading
@database_array2 = <DATA2>;
close (DATA2);
# these next 3 lines split a line from the first database file
foreach $lines(@database_array1) {
@edit_array1 = split(/\&&/,$lines);
$number="0";
# Now that we have a line read in ... begin sorting through the second
database file to compare
foreach $lines(@database_array2) {
@edit_array2 = split(/\&&/,$lines);
# These next lines check an identifier field to see if the record from
#the first database file and the second database file if it is, the
#NEXT function should move the search on to the next line in the
#database array
if ($edit_array2[3] eq $edit_array1[3]){
next;
}
# if the record's being compared are different, compare them for a
#match
else { #opens record comparison loop
if ($edit_array1[9] eq $edit_array2[9])
#MATCH FOUND!
{
# INSERT COMMAND TO PUSH RESULTS INTO AN ARRAY HERE
}
else
#MATCH NOT FOUND MOVE ON TO NEXT RECORD IN DATABASE FILE 2
{
next;
}
} # close record comaprison loop
} # close foreach loop through second database
} # close foreach loop through first database
------------------------------
Date: Tue, 13 Apr 1999 20:32:52 -0500
From: therzog@knotech.com (Tim Herzog)
Subject: Re: Comparing two arrays...help!
Message-Id: <therzog-1304992032520001@therzog-host105.dsl.visi.com>
In article <3713d677.27043452@news.phnx.uswest.net>, cgi@higherlove.com wrote:
>I am trying to compare a database against itself by reading it into
>two arrays and comparing the current line in the first array against
>each line in the second array
>
>I know the code below is rough, but do I have the nesting of the two
>foreach routine correct for the files to compare the way I want them
>to?
>
I'm not sure exactly what you're trying to do here, but it looks as if
field 3 (offset[2]) is a unique record key, so your first "next" keeps
records from matching themselves. Only records whose field 10
(offset[9])'s match will be counted. The very last "next" is redundant,
but other than that, it looks okay, if indeed that's what you're trying to
do. Is "&&" really your delimiter? Why /\&&/ and not just /&&/ ?
>
>open (DATA1, "<data.db");
># removed flock routine for easier reading
>@database_array1 = <DATA1>;
> close (DATA1);
>
>open (MEMBER2, "<data.db");
># removed flock routine for easier reading
>@database_array2 = <DATA2>;
> close (DATA2);
>
># these next 3 lines split a line from the first database file
>
>foreach $lines(@database_array1) {
>@edit_array1 = split(/\&&/,$lines);
>$number="0";
>
># Now that we have a line read in ... begin sorting through the second
>database file to compare
>
>foreach $lines(@database_array2) {
> @edit_array2 = split(/\&&/,$lines);
>
># These next lines check an identifier field to see if the record from
>#the first database file and the second database file if it is, the
>#NEXT function should move the search on to the next line in the
>#database array
>
>if ($edit_array2[3] eq $edit_array1[3]){
>next;
>}
># if the record's being compared are different, compare them for a
>#match
>else { #opens record comparison loop
>
>if ($edit_array1[9] eq $edit_array2[9])
>#MATCH FOUND!
> {
>
># INSERT COMMAND TO PUSH RESULTS INTO AN ARRAY HERE
>}
>else
>#MATCH NOT FOUND MOVE ON TO NEXT RECORD IN DATABASE FILE 2
>{
>next;
>}
>
>} # close record comaprison loop
>} # close foreach loop through second database
>} # close foreach loop through first database
--
Two Bits Worth
778 Hague Avenue
Saint Paul, MN 55104
Phone/Fax: 1 (612) 227-2920
therzog@knotech.com
------------------------------
Date: 14 Apr 1999 01:32:00 +0200
From: kaih=7Esvg9VHw-B@khms.westfalen.de (Kai Henningsen)
Subject: Re: Examples of slow regexes?
Message-Id: <7Esvg9VHw-B@khms.westfalen.de>
bart.lateur@skynet.be (Bart Lateur) wrote on 13.04.99 in <37140971.1219499@news.skynet.be>:
> But what strikes me is that it is /obvious/, to me anyway, that /a*a*b/
> is equivalent to /a*b/, since because of the greedy nature of the regex,
> IF it matches, the first subpattern will have grabbed everything, and
> the second subpattern will be empty. Always. The same goes for
> /[ab]*b*/, which is equivalent to /[ab]*/, and /[ab]*b+/ is equivalent
> to /[ab]*b/: the first subpattern will grab everything but the final
> "b".
>
> What is a bit strange is that Perl's regex compiler doesn't even warn
> for the inefficiency, let alone optimize it. So: is it indeed *easy* for
> a regex compiler, to spot the possibility for simplification? How come
> this jumps into my face?
That's probably a typical difference between using a NFA and a nicely
optimized DFA. On compiling down to a DFA, you should spot stuff like
that; but it does cost you significant work to get there. You can get a
NFA faster, but it tends to run slower. (The DFA would be calculated from
the NFA.)
A good book on compiler theory - like the Dragon book - should provide all
the necessary background (and then some).
> And are there examples of (very) inefficient regexes than CANNOT be
> simplified/optimized in this manner?
Once you include counting and then using those counts (like a certain
prime number detector), or modifying your data from inside the pattern (as
in Snobol), you get in trouble. That's because what you're doing is no
longer equivalent to a finite automaton, but a stack automaton or even a
full touring machine. Then all bets are off.
Of course, if you insist on using a NFA, we already know that one can be
slow (because of all the backtracking it needs to do).
> Slightly more complicated examples, such as /[ab]*[ac]*[ab]*[ac]*/ come
> to mind. /[ab]*[ac]*/ must be equivalent to /[ab]*(?:c[ac]*)?/, which
> *looks* like it should be more efficient, but it isn't. In fact, it's a
> bit slower.
That doesn't seem right - your second one fails to accept "cb", does it
not?
This is one I certainly don't want to hand-optimize to a DFA, though. And
it's too late to think about converting it to lex input to have it done
for me. Though I suspect the DFA would be fairly small and fast.
Kai
--
http://www.westfalen.de/private/khms/
"... by God I *KNOW* what this network is for, and you can't have it."
- Russ Allbery (rra@stanford.edu)
------------------------------
Date: Tue, 13 Apr 1999 23:41:58 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: HASH OF HASH OF LIST
Message-Id: <3713D843.6B02CC21@home.com>
[posted & mailed]
hojo wrote:
>
> I tried push @{ $destRecord{$countryName}{$ccc} } [$callrecord]; but
^^^
comma needed here
> to no avail.
You don't say what went wrong so I will assume that that is not a typo
and is your actual problem.
Also, I don't think you want to store an array of one element arrays.
push @{ $destRecord{$countryName}{$ccc} }, $callrecord;
perldoc perldsc
--
Rick Delaney
rick.delaney@home.com
------------------------------
Date: Tue, 13 Apr 1999 15:57:37 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: HASH OF HASH OF LIST
Message-Id: <hj70f7.lq5.ln@magna.metronet.com>
hojo (hojo@i-tel.com) wrote:
: ***Now, how do I push scalars into the new list that deep into this structure?
: I tried push @{ $destRecord{$countryName}{$ccc} } [$callrecord]; but to no
: avail.
What _happened_ when you tried it?
"to no avail" is as worthless as "did not work".
It gives us nothing to work with.
: Any Ideas?
You need a comma between the arguments to push().
You are not pushing a scalar there.
You are pushing an anonymous array that contains a scalar.
push @{ $destRecord{$countryName}{$ccc} }, $callrecord;
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 13 Apr 1999 23:56:10 GMT
From: ehood@geneva.acs.uci.edu (Earl Hood)
Subject: Re: Help: From Unix to NT
Message-Id: <7f0liq$7hf@news.service.uci.edu>
In article <37136484.21B0DB42@at.siemens.de>,
Eckbert Dollhofer <eckbert.dollhofer@at.siemens.de> wrote:
>Could anybody help me? I know how to run perl scripts (as CGI) on UNIX
>but now I have to do the same on NT. I would like to know what changes
>have to be made.
>Is it correct to replace the line #!/usr/local/bin/perl by nameoffile.pl
>?
It will depend on which server you are using. Many rely on the registry
setting for what .pl files are associated with. If you use Apache under
Win32, it supports the shebang line.
BTW, your question has to do with how servers invoke interpreted
CGI programs under NT, so it is best suited for a newsgroup about
HTTP/Web server.
--ewh
--
Earl Hood | University of California: Irvine
ehood@medusa.acs.uci.edu | Electronic Loiterer
http://www.oac.uci.edu/indiv/ehood/ | Dabbler of SGML/WWW/Perl/MIME
------------------------------
Date: Tue, 13 Apr 1999 22:53:26 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: How to write a format to an array instead of a filehandle?
Message-Id: <3713CCE7.6A8AC20E@home.com>
Larry Rosler wrote:
>
> `perldoc -f sprintf`, and say goodbye to formats (unless you want to
> produce page headers and footers, for example).
^^^^^^^
Headers, maybe. But if you want to do footers, you might as well go
back to sprintf. Footers have been on the TODO list for a long time and
with the amount of use format gets they'll probably stay there for a
while.
--
Rick Delaney
rick.delaney@home.com
------------------------------
Date: 13 Apr 1999 23:45:16 GMT
From: ehood@geneva.acs.uci.edu (Earl Hood)
Subject: Re: How to write a format to an array instead of a filehandle?
Message-Id: <7f0kuc$770@news.service.uci.edu>
In article <37135ec5@cs.colorado.edu>,
Tom Christiansen <tchrist@mox.perl.com> wrote:
>In comp.lang.perl.misc,
> branboles@netscape.net writes:
>:I am trying to use a format and write it to an array instead of it going to
>:standard output.
>Just convert my swrite() function in perlfunc(1) to an array thing
--------------------------------------^^^^^^^^
Try perlform(1) instead.
>instead. Was it not obvious in the manpage?
--ewh
--
Earl Hood | University of California: Irvine
ehood@medusa.acs.uci.edu | Electronic Loiterer
http://www.oac.uci.edu/indiv/ehood/ | Dabbler of SGML/WWW/Perl/MIME
------------------------------
Date: 13 Apr 1999 23:51:02 GMT
From: ehood@geneva.acs.uci.edu (Earl Hood)
Subject: Re: How to write a format to an array instead of a filehandle?
Message-Id: <7f0l96$7fi@news.service.uci.edu>
In article <3713CCE7.6A8AC20E@home.com>,
Rick Delaney <rick.delaney@home.com> wrote:
>Larry Rosler wrote:
>> `perldoc -f sprintf`, and say goodbye to formats (unless you want to
>> produce page headers and footers, for example).
>Headers, maybe. But if you want to do footers, you might as well go
>back to sprintf. Footers have been on the TODO list for a long time and
>with the amount of use format gets they'll probably stay there for a
>while.
Footers can be emulated by setting the page size to some huge
value. Then track the line number output yourself and switch
between formats (you'll have to manually do headers also) when
you hit the spot to print a footer, or header.
I.e. You switch $~ when the line numbering ($=) is at a point
where a header or footer should be printed.
--ewh
--
Earl Hood | University of California: Irvine
ehood@medusa.acs.uci.edu | Electronic Loiterer
http://www.oac.uci.edu/indiv/ehood/ | Dabbler of SGML/WWW/Perl/MIME
------------------------------
Date: Tue, 13 Apr 1999 20:36:27 -0500
From: Poohba <poohba@io.com>
To: Steve Wells <wells@cedarnet.org>
Subject: Re: Is it possible to have "..." appear while processing?
Message-Id: <Pine.BSF.4.05.9904132035180.19728-100000@dillinger.io.com>
Okay...I do know how to write to the screen but i don't know how to "..."
while the program is running.
On Sat, 10 Apr 1999, Steve Wells wrote:
> Poohba wrote:
> >
> > If so how?...I have a program that takes a little while to complete but i
> > don't want the user to abort so i would like something to be happening so
> > i thought maybe i could have ... appear as long as it is processing. When
> > I say ... i mean the dots keep coming til program is complete.
> >
> > * Web Page Designs *
> > / poohba@io.com | www.io.com/~poohba\
> > ---------------------------------------
> > \ For info about me send message with /
> > * subject "send file help" *
> >
>
> Hmm.. without much to go on I'm going to make a leap of faith.
>
> Your program is running from the web.
>
> I derived this because of your sig and the fact that anyone
> who can write a hello world program can output information
> as a program runs.
>
> So going with that assumption first you need to stop the
> normal buffering that goes on between your perl script and
> your web server.
>
> On apache you do this by changing the filename to nph-FILENAME.
>
> Secondly you need to remove the normal buffering that perl
> takes into effect. select((select(STDOUT), $|=1)[0]);
>
> Now you need to send the nph headers back to the browser. The
> easiest way is to use Lincoln Stein's CGI module.
>
> There are several documented ways to implement this but the one
> I use is: print $cgi->header(-nph=>1);
>
> You now have a direct unbuffered connection to the browser
> so you can write to it. There are several ways to implement
> this depending on your code but if the program is taking a long
> time to run and it's a loop just output your '.' char within
> the loop. If you want it to output routinely try using the
> alarm signal.
>
> or...
>
> You could try Randal's approach of forking the program and having
> the parent redirect to another web page while the child does
> it's thing. Then the child's information rebuilds the webpage
> and your done.
>
> Check out his implementation here:
> http://www.stonehenge.com/merlyn/WebTechniques/col20.html
>
> HTH,
> STEVE
> --
> -----------
> Stephen D. Wells
> http://expert.cc.purdue.edu/~bgannon/booksearch/
> http://www.iren.net/wellss/
>
>
* Web Page Designs *
/ poohba@io.com | www.io.com/~poohba\
---------------------------------------
\ For info about me send message with /
* subject "send file help" *
------------------------------
Date: Wed, 14 Apr 1999 02:53:33 +0200
From: Martin Baur <martin.baur@mindpower.com>
Subject: Looking for $num = Round ($num, $digits);
Message-Id: <3713E70D.2DBD1167@mindpower.com>
Hi
I am sure that anyone has already written a subroutien which returns the
number rounded to $digits digits. If you have such a thing and are
willing to share, please EMAIL me such a thing.
Thank you in advance.
Martin
--
MindPower
IT Services
__________________________________________________________
Internet-Mail: martin.baur@mindpower.com
Internet (biz): http://www.mindpower.com
PGP-Key: http://www.mindpower.com/pgp.htm
Voice: +41-1-687 11 66
__________________________________________________________
Visit and join our Web-based BBS! If you're pleased, why
not run your own? We're happy to get into contact! Try:
http://www.mindpower.com/scripts/dbh.isa/EnterBBS?d=6931
__________________________________________________________
------------------------------
Date: 13 Apr 1999 19:19:45 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Looking for $num = Round ($num, $digits);
Message-Id: <3713ed31@cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
Martin Baur <martin.baur@mindpower.com> writes:
:I am sure that anyone has already written a subroutien which returns the
:number rounded to $digits digits. If you have such a thing
I do. It's in the FAQ.
:and are
:willing to share,
I did. It's in the FAQ.
:please EMAIL me such a thing.
Please read the FAQ.
And kill your thirteen line sig. Have you no shame?
--tom
--
/* we have tried to make this normal case as abnormal as possible */
--Larry Wall in cmd.c from the perl source code
------------------------------
Date: 13 Apr 1999 03:39:42 GMT
From: mbk@cbr.dit.csiro.au (Martin Kuchlmayr)
Subject: Re: need help with Net::SSLeay 1.03 installation under Win32
Message-Id: <7eue9u$7oo@gutter.its.csiro.au>
AZ <abcz@my-dejanews.com> writes:
>Please, help....
>Need Makefile and instructions to install Net:SSLeay version 1.03 under
>Win95/NT with VC++.
>Thanks.
The *.tar.gz (see Note 1) file should include a Readme file which
tells you how to install the package. The section labled
"Prerequisites" tells you that you need to first install OpenSSL or
SSLeay.
The section labled "Installing" tells you that you need to run
"./Makefile.PL -t".
This will generate a makefile for you (and run it as far as I can
tell). However you may need to run this command as:
"Perl ./Makefile.PL -t"
if the "#!" path is not correct in Makefile.PL (ask a unix-head to
explain "#!"'s to you if it is not clear - or just run this second
form of the command wiithout worrying about what "#!"'s are.)
Installing OpenSSL or SSLeay has its own problems - ones that I never
resolved. Someone posted a solution though. Search for SSL on this
newsgroup or on Dejanews. The reply was fairly recent (March-April
99).
NOTE 1: Most places you download perl packages will have them as
*.tar.gz files. Get it from one of these places (eg the Australian
mirror "ftp://mirror.aarnet.edu.au/pub/perl/CPAN/modules/by-module/")
and it will have the Readme files and the Makefile.PL file.
Hope this helps, Martin.
------------------------------
Date: Tue, 13 Apr 1999 22:06:36 GMT
From: kevin_collins@my-dejanews.com
Subject: Re: No echo on a socket connection
Message-Id: <7f0f57$pip$1@nnrp1.dejanews.com>
In article <1dq042h.6n8yo65140gpN@[192.168.1.2]>,
cwis@dial.oleane.com (Christopher Allene) wrote:
> <kevin_collins@my-dejanews.com> wrote:
>
> > I am trying to write a simple socket daemon that will pass data via a
> > network port. I have the basic daemon running fine, but I need to figure out
> > how I can prompt the user for a password without having the password echoed
to
> > the client.
>
> You need to use the option negociation procedure described within the
> RFC854 - Telnet protocol -- assuming you're telnet'ing to your server
> which is probably what you want.
> I know of a Net::Telnet module available from CPAN, but since I didn't
> take a look at it, I don't know if it would suit your need.
>
...snip...
Ok, here is the real twist - the only reason I really need a password is
because the port is open for someone to Telnet in to. The password prompt is
prto keep people out who should not be there. The port is designed to be
connected to via another app that is just reading data across the wire from a
local FIFO. As long as that process is connected, the single-threaded server
with no security is ok, but if that process stops, anyone with telnet can
access the port :) I am trying to add a little buffer.
> Using this subroutine, you turn the echo off with something like that:
>
> print $handle "Password: \377\373\001";
>
> and you turn it back on with:
>
> print $handle "\377\374\001\n\r";
>
...snip...
The 1st bit works like a charm, but the second print causes a "+ over a -"
character to display. Any help on that?
Thanks,
Kevin
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 13 Apr 1999 19:45:19 -0500
From: Mike <support@counter.w-dt.com>
Subject: Perl rmdir
Message-Id: <3713E51E.677FECC7@counter.w-dt.com>
How come perls rmdir function doesn't work? Do you have to delete a
directory within the same program you create it with??? ie 1 program
perl program cannot delete a directory created by another??? I have it
like this but the directory is not deleted and it is empty. rmdir
"$ads_dir/$INPUT{'accountnumber'}";
------------------------------
Date: Tue, 13 Apr 1999 20:13:53 -0500
From: therzog@knotech.com (Tim Herzog)
Subject: Re: Perl rmdir
Message-Id: <therzog-1304992013530001@therzog-host105.dsl.visi.com>
In article <3713E51E.677FECC7@counter.w-dt.com>, Mike
<support@counter.w-dt.com> wrote:
>How come perls rmdir function doesn't work? Do you have to delete a
>directory within the same program you create it with??? ie 1 program
>perl program cannot delete a directory created by another??? I have it
>like this but the directory is not deleted and it is empty. rmdir
>"$ads_dir/$INPUT{'accountnumber'}";
Assuming the variables you show are defined correctly, could it be that
the process calling rmdir doesn't have write permissions for $ads_dir/ ?
--
Two Bits Worth
778 Hague Avenue
Saint Paul, MN 55104
Phone/Fax: 1 (612) 227-2920
therzog@knotech.com
------------------------------
Date: 13 Apr 1999 19:18:16 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Perl rmdir
Message-Id: <3713ecd8@cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
Mike <support@counter.w-dt.com> writes:
:How come perls rmdir function doesn't work? Do you have to delete a
:directory within the same program you create it with??? ie 1 program
:perl program cannot delete a directory created by another???
What does the program have to do with anything? Are they each
running under a separate UID? A separate GID?
:I have it
:like this but the directory is not deleted and it is empty. rmdir
:"$ads_dir/$INPUT{'accountnumber'}";
I'll bet this is just a dumb web permissions thing. Check with
a web group. WHICH THIS IS NOT.
And stop making people guess. You have an error status variable.
It's called $!. Use it. We aren't psychic.
--tom
--
X-Windows: The Cutting Edge of Obsolescence.
--Jamie Zawinski
------------------------------
Date: Tue, 13 Apr 1999 20:45:51 -0500
From: Mike <support@counter.w-dt.com>
Subject: Re: Perl rmdir
Message-Id: <3713F34F.D8BA4BC4@counter.w-dt.com>
What are they suppose to be?
Tim Herzog wrote:
> In article <3713E51E.677FECC7@counter.w-dt.com>, Mike
> <support@counter.w-dt.com> wrote:
>
> >How come perls rmdir function doesn't work? Do you have to delete a
> >directory within the same program you create it with??? ie 1 program
> >perl program cannot delete a directory created by another??? I have it
> >like this but the directory is not deleted and it is empty. rmdir
> >"$ads_dir/$INPUT{'accountnumber'}";
>
> Assuming the variables you show are defined correctly, could it be that
> the process calling rmdir doesn't have write permissions for $ads_dir/ ?
>
> --
> Two Bits Worth
> 778 Hague Avenue
> Saint Paul, MN 55104
> Phone/Fax: 1 (612) 227-2920
> therzog@knotech.com
------------------------------
Date: Tue, 13 Apr 1999 20:47:12 -0500
From: Mike <support@counter.w-dt.com>
Subject: Re: Perl rmdir
Message-Id: <3713F39F.5FE38936@counter.w-dt.com>
How do you know what UID or GID they are running under? They are run on
the same server and both put there by me.
Tom Christiansen wrote:
> [courtesy cc of this posting sent to cited author via email]
>
> In comp.lang.perl.misc,
> Mike <support@counter.w-dt.com> writes:
> :How come perls rmdir function doesn't work? Do you have to delete a
> :directory within the same program you create it with??? ie 1 program
> :perl program cannot delete a directory created by another???
>
> What does the program have to do with anything? Are they each
> running under a separate UID? A separate GID?
>
> :I have it
> :like this but the directory is not deleted and it is empty. rmdir
> :"$ads_dir/$INPUT{'accountnumber'}";
>
> I'll bet this is just a dumb web permissions thing. Check with
> a web group. WHICH THIS IS NOT.
>
> And stop making people guess. You have an error status variable.
> It's called $!. Use it. We aren't psychic.
>
> --tom
> --
> X-Windows: The Cutting Edge of Obsolescence.
> --Jamie Zawinski
------------------------------
Date: Tue, 13 Apr 1999 20:09:11 -0500
From: therzog@knotech.com (Tim Herzog)
Subject: perlcc: not loading modules
Message-Id: <therzog-1304992009110001@therzog-host105.dsl.visi.com>
Using RedHat Linux 5.2 i386, Perl 5.005_02
I'm trying to use perlcc to compile the following test program into an
executable:
#!/usr/bin/perl
use Fcntl;
if( sysopen FILE "test", O_RDWR|O_CREAT ) {
print FILE "Hello\n";
close FILE;
}
The program runs fine, e.g., "perl test.pl," but when perlcc runs, I get
the following slew of errors:
No definition for sub Fcntl::O_RDWR
No definition for sub Fcntl::O_RDWR (unable to autoload)
No definition for sub Fcntl::F_GETFD
No definition for sub Fcntl::F_GETFD (unable to autoload)
No definition for sub Fcntl::F_GETFL
No definition for sub Fcntl::F_GETFL (unable to autoload)
(etc.)
My .c file comes out the backend and gets compiled and linked, but when I
try to run it, I get:
"Undefined subroutine &Fcntl::O_RDWR called."
The cc backend seems to be finding Fcntl okay, since it's balking at a
whole bunch of symbols, most of which I didn't use.
Any thoughts on how to get this working?
Tim
--
Two Bits Worth
778 Hague Avenue
Saint Paul, MN 55104
Phone/Fax: 1 (612) 227-2920
therzog@knotech.com
------------------------------
Date: Tue, 13 Apr 1999 17:23:56 -0400
From: jjustice@styletto.com (Joshua Justice)
Subject: Re: Printing a file
Message-Id: <jjustice-1304991723580001@client32045.atl.mediaone.net>
In article <7eue1l$kia$0@208.231.50.193>, "Andrew Branson"
<a_branson_1998@yahoo.com> wrote:
>I am sorry if this is a stupid question, but I am fairly new to Perl: I
>there a way to read and print() an entire file as opposed to line by line?
>Thanks.
>
>Andy
@lines_from_file = <FH>;
Not to be condescending, but you should probably find a book or reference
site to review. Supah-cool as Perl is, you can't really learn it by just
screwing around.
- j -
print "Just another (minimalist) Perl hacker."
------------------------------
Date: Tue, 13 Apr 1999 22:50:39 GMT
From: bart.lateur@skynet.be (Bart Lateur)
Subject: Re: Printing a file
Message-Id: <3714c978.3123859@news.skynet.be>
Andrew Branson wrote:
>I am sorry if this is a stupid question, but I am fairly new to Perl: I
>there a way to read and print() an entire file as opposed to line by line?
>Thanks.
{
local $/; # undef
$thelot = <FILE>;
}
HTH,
Bart.
------------------------------
Date: Tue, 13 Apr 1999 22:29:30 GMT
From: kstinson@hotmail.com
Subject: Problems installing module MIME-Base64-2.11
Message-Id: <7f0gg2$qro$1@nnrp1.dejanews.com>
I have screen prints of what is happening when I try to install the
MIME-Base64 module. I have this same problem installing a number of other
modules also, so I don't believe it to be a problem with MIME-Base64 but with
my configuration on my server.
My server is an IBM F50 running AIX 4.2.1.
I have perl 5.004_04 installed.
Any help is appreciated!!
________________________________________________________________
#This is step1 which works fine.
$OSAR(user1)/home/user1/perltemp/MIME-Base64-2.11>perl Makefile.PL
Checking if your kit is complete...
Looks good
Writing Makefile for MIME::Base64
#Now step2 which works fine.
$OSAR(user1)/home/user1/perltemp/MIME-Base64-2.11>make
mkdir ./blib
mkdir ./blib/lib
mkdir ./blib/lib/MIME
cp Base64.pm ./blib/lib/MIME/Base64.pm
cp QuotedPrint.pm ./blib/lib/MIME/QuotedPrint.pm
/usr/bin/perl "-I/usr/local/lib/perl5/aix/5.00404" "-
I/usr/local/lib/perl5" -e 'use ExtUtils::Mksymlists; Mksymlists
("NAME" => "MIME::Base64", "DL_FUNCS" => { }, "DL_VARS" => []);'
/usr/bin/perl -I/usr/local/lib/perl5/aix/5.00404 -
I/usr/local/lib/perl5 /usr/local/lib/perl5/ExtUtils/xsubpp -typema
p /usr/local/lib/perl5/ExtUtils/typemap Base64.xs >Base64.tc && mv Base64.tc
Base64.c
cc -c -qmaxmem=8192 -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -
O -DVERSION=\"2.11\" -DXS_VERSION=\"2.11\"
-I/usr/local/lib/perl5/aix/5.00404/CORE Base64.c
"Base64.xs", line 197.74: 1506-342 (W) "/*" detected in comment.
mkdir ./blib/arch
mkdir ./blib/arch/auto
mkdir ./blib/arch/auto/MIME
mkdir ./blib/arch/auto/MIME/Base64
Running Mkbootstrap for MIME::Base64 ()
chmod 644 Base64.bs
LD_RUN_PATH="" ld -o ./blib/arch/auto/MIME/Base64/Base64.so -H512 -
T512 -bhalt:4 -bM:SRE -bI:/usr/local/lib/perl5/ai
x/5.00404/CORE/perl.exp -bE:Base64.exp -b noentry -lc Base64.o
chmod 755 ./blib/arch/auto/MIME/Base64/Base64.so
cp Base64.bs ./blib/arch/auto/MIME/Base64/Base64.bs
chmod 644 ./blib/arch/auto/MIME/Base64/Base64.bs
mkdir ./blib/lib/auto/MIME
mkdir ./blib/lib/auto/MIME/Base64
mkdir ./blib/man3
Manifying ./blib/man3/MIME::Base64.3
Manifying ./blib/man3/MIME::QuotedPrint.3
Target "makemakerdflt" is up to date.
# Here is step3 where I do the "make test" which failes.
$OSAR(user1)/home/user1/perltemp/MIME-Base64-2.11>make test
PERL_DL_NONLAZY=1 /usr/bin/perl -I./blib/arch -I./blib/lib -
I/usr/local/lib/perl5/aix/5.00404 -I/usr/local/lib/perl5 -e 'use
Test::Harness qw(&runtests $verbose); $verbose=0; runtests @ARGV;' t/*.t
times not implemented at /usr/local/lib/perl5/Benchmark.pm line 240. make:
1254-004 The error code from the last command is 2.
Stop.
$OSAR(user1)/home/user1/perltemp/MIME-Base64-2.11>
-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
------------------------------
Date: Tue, 13 Apr 1999 22:55:20 GMT
From: alastair@calliope.demon.co.uk (Alastair)
Subject: Re: Putting a pause or a delay within a perl program
Message-Id: <slrn7h7mc2.5t.alastair@calliope.demon.co.uk>
Thu Ra Tin <thuratin@home.com> wrote:
>Hello there,
>
>What would be the best way to put a delay in a program? For example, I
>want the program to pause for about 30 seconds to 2 minutes before
>continuing.
You could calculate a mandelbrot set picture for a while.
Alternatively, see 'sleep' and save your system.
--
Alastair
work : alastair@psoft.co.uk
home : alastair@calliope.demon.co.uk
------------------------------
Date: Wed, 14 Apr 1999 01:51:09 GMT
From: mike@w3z.com (Mike Collins)
Subject: Q: Convert two newlines to \n<p>
Message-Id: <3713f2cf.15977653@news.netway.com>
Trying to match two newlines to produce one newline and a paragraph
tag <p>.
The code shown and many, many variations all fail.
undef $/;
while (<TXTFILE>){
s/\n\n/\n<p>/sg; #Not even close!
print;
}
------------------------------
Date: Tue, 13 Apr 1999 18:39:58 -0700
From: mikej <mikej@1185design.com>
Subject: referring to form generated variables
Message-Id: <3713F1EA.EFCE4FD8@1185design.com>
hi,
I have a form procesing script that I need to customize. Normally, whn I
want to get at one of the values that the person submitted, I would use
this syntax when refering to the value of the field1 input:
$myform{'field1'};
but in my case, I want to get at the field data using a variable that
was read in from a text file, like this:
#extract current stats from stats file
open(STATS, "stats_data.txt") || &error("Couldn't open stats log file
\n\n$!");
@indata = <STATS>;
close(STATS);
#get the stats on each line and assigns variables to each stat
foreach $line (@indata)
{
chomp($line);
($collateral_type, $use_now_count, $would_like_to_use_count,
$does_not_use_count, $never_seen_count) = split(/\|/, $line);
if ($survey_form{'$collateral_type'} eq "use_now") {
$use_now_count = $use_now_count + 1;
}
if ($survey_form{'$collateral_type'} eq "would_like_to_use") {
$would_like_to_use_count = $would_like_to_use_count + 1;
}
if ($survey_form{'$collateral_type'} eq "does_not_use") {
$does_not_use_count = $does_not_use_count + 1;
}
if ($survey_form{'$collateral_type'} eq "never_seen") {
$never_seen_count = $never_seen_count + 1;
}
# (end of example)
the stats data file is of the form
name_of_collateral_type|0|0|0|0
the problem is, the script doesnt return any value for the form input if
I refer to it as
$survey_form{'$collateral_type'}
even though it WILL return a value for $collateral_type, and also
$survey_form{'$use_now'} will return a value along with the other filed
name when I refer to them directly.
So I am stumped why it wont return any value. Any help is appreciated!
Thanks...
-mike
------------------------------
Date: 13 Apr 1999 22:43:24 GMT
From: eric@fruitcom.com (Eric Smith)
Subject: regex - camel and llama cannot help
Message-Id: <slrn7h7iv7.e2q.eric@plum.fruitcom.com>
I looked and could not find the answer to this seemingly straightforward
problem (maybe I missed it?)
I am looking for a regex that will match `ericno' but not `ericnot'
But the `eric' can also be `sally', so the important thing is the phrase
`not' following the name, must be present in full and _not_ a `no'.
$ echo ericnot |perl -ne 'if (/(eric[^(no)])/){print "$1 \n"}'
$ echo ericnot |perl -ne 'if (/(eric[^(not)])/){print "$1 \n"}'
$ echo ericnot |perl -ne 'if (/(eric[^(ot)])/){print "$1 \n"}'
ericn
$ echo ericno |perl -ne 'if (/(eric[^(not)])/){print "$1 \n"}'
$
Thanx in advance
--
Eric Smith
<eric@fruitcom.com>
Tel. 021 236 111
------------------------------
Date: Tue, 13 Apr 1999 20:56:40 -0500
From: therzog@knotech.com (Tim Herzog)
Subject: Re: regex - camel and llama cannot help
Message-Id: <therzog-1304992056400001@therzog-host105.dsl.visi.com>
In article <slrn7h7iv7.e2q.eric@plum.fruitcom.com>, eric@fruitcom.com wrote:
>I looked and could not find the answer to this seemingly straightforward
>problem (maybe I missed it?)
>
>I am looking for a regex that will match `ericno' but not `ericnot'
>But the `eric' can also be `sally', so the important thing is the phrase
>`not' following the name, must be present in full and _not_ a `no'.
>
>$ echo ericnot |perl -ne 'if (/(eric[^(no)])/){print "$1 \n"}'
>$ echo ericnot |perl -ne 'if (/(eric[^(not)])/){print "$1 \n"}'
>$ echo ericnot |perl -ne 'if (/(eric[^(ot)])/){print "$1 \n"}'
>ericn
>$ echo ericno |perl -ne 'if (/(eric[^(not)])/){print "$1 \n"}'
Will this work?
$_ = "ericnot";
if( /(.*)not$/ ) {
# $1 ends in "not"
print "$1\n";
}
else {
$ it doesn't
}
--
Two Bits Worth
778 Hague Avenue
Saint Paul, MN 55104
Phone/Fax: 1 (612) 227-2920
therzog@knotech.com
------------------------------
Date: Tue, 13 Apr 1999 15:38:39 -0700
From: Greg McCann <gregm@well.com>
Subject: Re: TPJ still shipping?
Message-Id: <3713C76F.BA5492B@well.com>
Uri Guttman wrote:
> what's with all these orders for back issues? you can't call yourselves
> perl hackers if you haven't been charter subscribers from issue 1?
> what's wrong with you?
We want to *look* like we've been subscribing since issue 1. It impresses the
clients.
:)
Greg
--
======================
Gregory McCann
http://www.calypteanna.com
"Be kind, for everyone you meet is fighting a great battle." Saint Philo of
Alexandria
------------------------------
Date: Tue, 13 Apr 1999 23:47:11 GMT
From: gareth@ibis.demon.co.uk (Gareth Jones)
Subject: Re: TPJ still shipping?
Message-Id: <3713d721.932771@news.demon.co.uk>
Uri Guttman <uri@home.sysarch.com> wrote:
>what's with all these orders for back issues? you can't call yourselves
>perl hackers if you haven't been charter subscribers from issue 1?
>what's wrong with you?
the idea is that you order all of the back issues, and then claim to
have been subscribing from issue 1....that's what I do anyway!
Gareth
------------------------------
Date: Tue, 13 Apr 1999 17:21:30 -0500
From: "Keith G. Murphy" <keithmur@mindspring.com>
Subject: Re: Web-DB integration - how was it for you?
Message-Id: <3713C36A.68DAE6D4@mindspring.com>
isabelle wrote:
>
> Hello,
>
> I am a final year student at Leeds Metropolitan University on a Bsc
> Information Systems and I am writing my final year dissertation on the
> topic of Web-Database Integration.
>
> As part of this, I am carrying out a postal/ email questionnaire to
> gather information from companies who have web enabled a database
> (whether on an intranet or on the WWW). This questionnaire asks
> questions such as tools used, web server used, how was an evaluation
> carried out as to what solution was the best, was the existing hardware
> set up a limiting factor, difficulties encountered, what benefits to the
> company it will bring, etc... It's entirely anonymous - I only ask for
> the company name - and, needless to say, all data will be held in
> complete confidence.
>
> The questionnaire is available either as a text or a Word 6 document to
> filled in electronically and sent back to me via email. Or I could post
> it as a paper form (with pre-paid envelope for the answer).
>
Ummm, what about a web-based form for extra credit, considering the
subject matter? :-)
------------------------------
Date: Tue, 13 Apr 1999 23:49:13 GMT
From: Rick Delaney <rick.delaney@home.com>
Subject: Re: what does this error msg mean?
Message-Id: <3713D9FC.2C520970@home.com>
[posted & mailed]
Diane Unger wrote:
>
> I am using a variation of the Schwartzian Transform to sort some data
> for display on a web page. I keep getting the following error:
>
> "map" may clash with future reserved word at /cgi-bin/logs.cgi line 232.
> Since map is supposed to be a recognized function, does this indicate
> some other type of problem?
No, it means exactly what it says. Take yourself back in time to when
your version of perl was the latest and read the error again in that
context.
If you're lucky, you may only have to change your path to point to the
correct perl. Otherwise, upgrade.
--
Rick Delaney
rick.delaney@home.com
------------------------------
Date: Tue, 13 Apr 1999 18:02:39 -0400
From: Raymond Yu <WizeGuy@nettaxi.com>
Subject: What Kind of Program should i first make?
Message-Id: <3713BEFE.990B3172@nettaxi.com>
I'm starting Perl, and I don't know what program I should start out to
make. Can you give me any starters' programs?
------------------------------
Date: Tue, 13 Apr 1999 20:59:21 -0500
From: therzog@knotech.com (Tim Herzog)
Subject: Re: What Kind of Program should i first make?
Message-Id: <therzog-1304992059210001@therzog-host105.dsl.visi.com>
In article <3713BEFE.990B3172@nettaxi.com>, WizeGuy@nettaxi.com wrote:
>I'm starting Perl, and I don't know what program I should start out to
>make. Can you give me any starters' programs?
What have you always wanted your computer to do, but you couldn't find a
program that you liked to do it? I got into programming (in C, C++)
because I couldn't find programs that did what I wanted them to, so I
wrote my own. Perl, and any other programming language, let's you do the
same thing.
--
Two Bits Worth
778 Hague Avenue
Saint Paul, MN 55104
Phone/Fax: 1 (612) 227-2920
therzog@knotech.com
------------------------------
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 5376
**************************************