[9700] in Perl-Users-Digest
Perl-Users Digest, Issue: 3294 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 31 00:04:16 1998
Date: Thu, 30 Jul 98 21:01:25 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 30 Jul 1998 Volume: 8 Number: 3294
Today's topics:
Re: # in a print statement (Michael J Gebis)
accessing local vars from packages salvador@my-dejanews.com
Re: Coverage Tool? (Michael J Gebis)
Re: Generating multiple pages in one script <perlguy@inlink.com>
Re: How to delete files inside perl script? <perlguy@inlink.com>
Re: HTML module - would this be useful to you? (Mark-Jason Dominus)
Re: Method not implemented <jdporter@min.net>
Re: Problems building 5.005_01 on NT4, sp3 <davidc@selectst.com>
Trying to lock tied ndbm file <quednauf@nortel.co.uk>
when/where perl.exe (5.005) for Win32? <snif@xs4all.nonono.nl>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 30 Jul 1998 06:29:33 GMT
From: gebis@albrecht.ecn.purdue.edu (Michael J Gebis)
Subject: Re: # in a print statement
Message-Id: <6pp3sd$37q@mozo.cc.purdue.edu>
rjk@coos.dartmouth.edu (Ronald J Kimball) writes:
}<nikkim@my-dejanews.com> wrote:
}> print GUEST "<IMG id=\"Picture2\" HEIGHT=88 WIDTH=562 SRC=\"./bbstop8.jpg\"
}> BORDER=0 USEMAP="#map5" > etc, etc ...
} ^ ^
}Backslash the quotes so the # is within the string, instead of outside
}it.
I might add:
print GUEST qq/<IMG id="Picture2" HEIGHT=88 WIDTH=562 SRC="./bbstop8.jpg" BORDER=0 USEMAP="#map5">/;
P.S. Somebody should exploit the original bug for obfuscative purposes.
P.P.S. Obfuscative probably isn't a word.
--
Mike Gebis gebis@ecn.purdue.edu mgebis@eternal.net
------------------------------
Date: Thu, 30 Jul 1998 12:01:54 GMT
From: salvador@my-dejanews.com
Subject: accessing local vars from packages
Message-Id: <6ppnbi$jqo$1@nnrp1.dejanews.com>
Hello !
I am developing an application that uses two packages, say P1 and P2,
from the subs in P1 y call P2 subs from which I want to access a local var in
P1, I hope some code would help to understand this
package P1;
sub sub1 {
local %c;
...
P2::sub2();
}
package P2;
sub sub2 {
do something with %c;
}
this seems correct to me but it doesn't work
I have tried fully qualifying they as %P1::c too but %c is invisible from P2
anyway
What can I do ?
Thank you.
- Salvador
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp Create Your Own Free Member Forum
------------------------------
Date: 30 Jul 1998 06:14:04 GMT
From: gebis@albrecht.ecn.purdue.edu (Michael J Gebis)
Subject: Re: Coverage Tool?
Message-Id: <6pp2vc$33k@mozo.cc.purdue.edu>
Eric Sheng <shenge@ece.ucdavis.edu> writes:
} I am testing a perl script somewhere in the 2000 lines neighborhood.
}I was wondering if there is any tools out there or inside the perl debugger
}that would keep track of which lines of the script has been hit or executed
}during run-time. I basically wants to make sure every line of my code has
}been tested. Thanks a lot.
CPAN, Devel::Coverage
Also: The Perl Journal #10 Page 63
Party on.
--
Mike Gebis gebis@ecn.purdue.edu mgebis@eternal.net
------------------------------
Date: Thu, 30 Jul 1998 11:33:15 GMT
From: Brent Michalski <perlguy@inlink.com>
Subject: Re: Generating multiple pages in one script
Message-Id: <35C059FB.A7D85400@inlink.com>
Scott Lindsey wrote:
>
> This is a newbie question I'm sure, but how do I make a script generate
> one page at the beginning of it's execution and then another one at the
> end? When I tried this the first time it simply tacks the second page
> onto the end of the first without "clearing" the page. Basically I want
> to generate a "Please wait..." page while the script crunches a bunch of
> numbers and then follow it with a report.
>
Simply put, you can only send one page at a time from a script. You
can, however, use NPH scripts to generate some sort of text while the
user waits.
Or, if you know approximately how long the script takes to execute, send
them a "please wait" screen that automatically loads another page after
"x" number of seconds.
Either way, you will probably have to use an NPH script because if you
do not, your script will be run and THEN the page will update with the
"please wait" screen, which by then it is too late...
Here is a starting point for NPH scripts:
http://www.landfield.com/faqs/www/cgi-faq/section-33.html
> Please email response.
>
> Thanks,
> -Scott Lindsey
> lindsey@cs.wisc.edu
Sorry Scott, post it here - get the answer here.
HTH,
Brent
------------------------------
Date: Thu, 30 Jul 1998 11:35:34 GMT
From: Brent Michalski <perlguy@inlink.com>
Subject: Re: How to delete files inside perl script?
Message-Id: <35C05A86.E0501CEE@inlink.com>
Have you checked you server logs?
Does the "web user" have rights to delete the file that you are trying
to get rid of?
HTH,
Brent
------------------------------
Date: 30 Jul 1998 08:41:12 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: HTML module - would this be useful to you?
Message-Id: <6pppl8$qna$1@monet.op.net>
In article <35BF852A.5C3C@databeam.com>,
Rich Bowen <rbowen@databeam.com> wrote:
>So, my question is whether anyone else other than me sees the value of
>this, and, if so, would HTML::Template be a reasonable name for it, or,
>am I just missing an existing implementation of this same idea?
Text::Template does very much the same thing, for exactly the same
reasons that you describe.
There are also four or five other modules that do similar things;
Text::Metatext is one of them, and I forget the others.
------------------------------
Date: Thu, 30 Jul 1998 12:48:35 GMT
From: John Porter <jdporter@min.net>
Subject: Re: Method not implemented
Message-Id: <35C06C45.3B4E@min.net>
TM wrote:
>
> I get the following msg when trying to submit a guestbook entry, any
> suggestions?
>
> Method not implemented
>
> POST to /~sportsman/cgi-bin/guestbook.pl not supported.
Obviously that script was not written to handle POST requests.
It probably only handles GET requests.
--
John Porter
------------------------------
Date: Thu, 30 Jul 1998 22:35:04 +1000
From: David Coldrick <davidc@selectst.com>
To: gsar@umich.edu
Subject: Re: Problems building 5.005_01 on NT4, sp3
Message-Id: <35C06878.DF13F71@selectst.com>
Hey Troy, good guess :-)
That was indeed the problem - my VC++ was installed in the default
location of c:\Program files\Devstudio . . . When I went to the trouble
of deintsalling, then reinstalling on a path without spaces in names, it
built OK. Same problem with building TK8 - I had the kit in d:\Perl
stuff\tk800 and nmake failed immediately. Worked when I put in a
non-space-named directory.
Wonder if this is a problem with nmake???
OK, next problem. 5.005_01 builds ok, and passses (almost) all tests.
(there was a failure with posix.t that the doc said was likely, as well
as one involving magic:
op/magic............The name specified is not recognized as an
internal or external command, operable program or batch file.
The name specified is not recognized as an
internal or external command, operable program or batch file.
FAILED tests 23-24
I dunno what this was.)
I then downloaded - as per instructions in the readme.w32 -
libwin32-0.12.zip to install OLE, etc. I rebuilt from scatch: on the
perl Makefile.PL step, all went ok except that I got a dialog box from
NT during "Writing Makefile for Win32::ODBC" saying that it couldn't
find the dll cw3230mt.dll. In the previous version, this was in
\perl\bin. It's not there now. If I just copy the old one in and retry,
I get a different message about something else being missing. Other than
that, the Makefile.PL run was ok.
However, when I do the nmake, I get down to building Internet.c and it
falls in a heap with:
Internet.c
"Running Mkbootstrap for Win32::Internet ()"
C:\perl\bin\MSWin32-x86\perl -Ic:\perl\lib\MSWin32-x86
-Ic:\perl\lib -MExtUtils::Command -e chmod 644 Internet.bs
link -out:..\blib\arch\auto\Win32\Internet\Internet.dll -dll
-nologo -nodefaultlib -release -machine:x86 Internet.obj
C:\perl\lib\MSWin32-x86\CORE\perl.lib wininet.lib advapi32.lib version.l
ib -def:Internet.def
Creating library ..\blib\arch\auto\Win32\Internet\Internet.lib and
object ..\blib\arch\auto\Win32\Internet\Internet.exp
Internet.obj : error LNK2001: unresolved external symbol _strcmp
Internet.obj : error LNK2001: unresolved external symbol __imp__strncmp
Internet.obj : error LNK2001: unresolved external symbol
__imp__FileTimeToSystemTime@8
Internet.obj : error LNK2001: unresolved external symbol _strlen
Internet.obj : error LNK2001: unresolved external symbol _strcpy
Internet.obj : error LNK2001: unresolved external symbol
__imp__FormatMessageA@28
Internet.obj : error LNK2001: unresolved external symbol
__imp__GetModuleHandleA@4
LINK : error LNK2001: unresolved external symbol __DllMainCRTStartup@12
..\blib\arch\auto\Win32\Internet\Internet.dll : fatal error LNK1120: 8
unresolved externals
NMAKE : fatal error U1077: 'link' : return code '0x19'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
Help!
Regards,
David
Troy Denkinger wrote:
>
> cc'd to the original poster
>
> In article <35BE8D8D.C03EF75D@selectst.com>, David Coldrick
> <davidc@selectst.com> wrote:
> >CCHOME = C:\Program Files\DevStudio\VC
>
> For lack of a better answer, I'll go out on a limb and
> suggest that the problem is in the space in this path.
>
> Regards,
>
> Troy Denkinger
------------------------------
Date: Thu, 30 Jul 1998 13:14:51 +0100
From: "F.Quednau" <quednauf@nortel.co.uk>
Subject: Trying to lock tied ndbm file
Message-Id: <35C063BA.5870417@nortel.co.uk>
#!/opt/corp/local/perl-5.004/bin/perl5.00404 -w
use NDBM_File;
use Fcntl qw/:flock O_RDWR O_CREAT/;
tie (%VOTE, 'NDBM_File', '/u/quednauf/temp/testdbm',
O_RDWR|O_CREAT|LOCK_EX, 0644) or die "hmm $!";
tie (%TEST, 'NDBM_File', '/u/quednauf/temp/testdbm', O_RDWR, 0644) or
die "hmm2 $!";
print "Content-type:text/html\n\n";
$VOTE{'sex.male'} = 'Run';
print $VOTE{'sex.male'};
$TEST{'sex.male'} = 'CRAAZY';
print $TEST{'sex.male'};
untie(%VOTE);
untie(%TEST);
I tried this little script to see if I was able to lock a tied ndbm file
like that. I read perlfunc on flock and there was the example using
Fcntl and LOCK_EX for an exclusive lock. I don't get any error messages,
and both hashes can actually read and write from and to the ndbm file.
Is it because it is in fact in one script? I know that LOCK_EX in the
example was used on a filehandle...so I tried the following:
open FILE1, "< /u/quednauf/temp/testdbm.dir" or die "no way: $!";
open FILE2, "< /u/quednauf/temp/testdbm.pag" or die "no way: $!";
flock(FILE1, LOCK_EX) or die "no flock on file1: $!";
flock(FILE2, LOCK_EX) or die "no flock on file2: $!";
I thought, hmmm, that probably wouldn't help me either, because then the
filehandles have an exclusive lock, but it didn;t get that far: In the
error log I found:
no flock on file1: Bad file number at
/u/quednauf/public_html/cgi-bin/lock_test.pl line 7.
reading the manpage on fcntl didn't help me too much. So my questions
are: What means the bad file number business? (I tried to find something
on UNIX error messages on the system but failed)
How do I do a lock on a tied NDBM file ?
--
____________________________________________________________
Frank Quednau
http://www.surrey.ac.uk/~me51fq
________________________________________________
------------------------------
Date: Thu, 30 Jul 1998 14:33:30 +0200
From: "Jonkers" <snif@xs4all.nonono.nl>
Subject: when/where perl.exe (5.005) for Win32?
Message-Id: <6ppp5h$7h8$1@news.gns.getronics.nl>
When/where is the Win32-executable perl.exe of Perl 5.005 available? The
site http://www.perl.com/pace/pub/perldocs/latest.html still says
"The current version is perl5.00402-bindist04-bc.zip (or .tar.gz if you
prefer)." and the contents of the ftp-directory seems to confirm this.
Or is the binary distribution somewhere else available?
Sander
------------------------------
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 3294
**************************************