[7210] in Perl-Users-Digest
Perl-Users Digest, Issue: 835 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Aug 9 01:16:43 1997
Date: Fri, 8 Aug 97 22:01:35 -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 Fri, 8 Aug 1997 Volume: 8 Number: 835
Today's topics:
Re: perl-5.003 on UW: 'make test' fails (Bob Farmer)
pesky "unknown file type" window on WinNT <mike@powerquery.com>
Problem with Open3 <danilo@acme.nsc.com>
Q: creating http post requests <peter.riocreux@cs.man.ac.uk>
Re: reading a file and having embeded variables intepre <rootbeer@teleport.com>
Re: rounding (Mike Stok)
Re: Running Perl under Windows - No NFS (Eric Bohlman)
stat on W95 <cdumas@ibm.net>
System call on app that spawns an app <raccah@bigfoot.com>
test supportj@icom.com
Re: translating accented characters to non-accented cha <aas@bergen.sn.no>
Re: Uninitialized variables in scripts (Tim Smith)
Re: uppercase($mystring) ? <rootbeer@teleport.com>
WANTED: Perl Dude for developer support Posn on Long Is <dsadinof@olf.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 5 Aug 1997 18:26:04 -0500
From: ucs_brf@unx1.shsu.edu (Bob Farmer)
Subject: Re: perl-5.003 on UW: 'make test' fails
Message-Id: <5s8cqc$mj9$1@unx1.shsu.edu>
In article <no67tkzmaa.fsf@ra.syscomp.de>,
Wolfgang Schludi <schludi@syscomp.de> wrote:
>$ uname -a
>UNIX_SV soft2 4.2MP 2.1 i386 x86at
>
>hi,
>
>if I compile perl-5.003 under UW and run 'make test' I get the
>following errors:
>
>> $ LD_LIBRARY_PATH=`pwd` make test
>[...]
>> op/glob........FAILED on test 1
>> op/goto........ok
>> op/groups......groups: could not find passwd entry
>> ok
>[...]
>> op/readdir.....FAILED on test 3
>> [...]
>> lib/dirhand....FAILED on test 3
>[...]
>> Failed 3/94 tests, 96.81% okay.
>> make: [test] Error 25 (ignored)
>
>(I just started learning perl, so I'm not (yet) able to understand
> these test programs in full. Neither am I into the perl source code :-()
>
>and I think, as a consequence, 'make install' fails while installing
>the .pod files:
>
>
>> $ LD_LIBRARY_PATH=`pwd` make install
>[...]
>> chmod 755 /usr/tools/bin/pod2text
>> installperl: pod/perl.pod.pod not found at installperl line 409.
>> make: *** [install.perl] Error 2
>> Bad exit status
>>
>
>can anyone help? do you need more information?
>
>and yes, I read the UW-FAQ (D34)
>and yes, this also happens, when I change "d_csh='define'" to
>"d_csh='undef'" in config.sh before "LD_LIBRARY_PATH=`pwd` make"
I had the same problem with glob, dirhand, and readdir when compiling
5.004. Changing the "d_csh" thing from define to undef fixed it. Never
encountered the groups problem.
--
Bob Farmer ucs_brf@unx1.shsu.edu
University Computer Services, Sam Houston State Univ. (409)294-3547
------------------------------
Date: Tue, 05 Aug 1997 19:08:16 -0700
From: Mike Wellems <mike@powerquery.com>
Subject: pesky "unknown file type" window on WinNT
Message-Id: <33E7DC8F.4F7C@powerquery.com>
I am new to Perl and have been trying to write simple programs, but all
of them fail. I don't have my own server, just access to a cgi-bin.
When I try to run a prog, Netscape brings up an unknown file type window
(application/x-perl). How do I stop this? The server is Windows NT.
Thanks,
Mike Wellems
PowerQuery
------------------------------
Date: Tue, 5 Aug 1997 20:30:34 GMT
From: Danilo Unite <danilo@acme.nsc.com>
Subject: Problem with Open3
Message-Id: <33E78D69.22A366E8@acme.nsc.com>
Hi,
I'm using the IPC::Open3 module to read and write to a command. The
problem that I am having has to do with reading from the STDERR pipe
when nothing is coming through that stream. The script will hang when I
try to do this when no errors have occurred on the command.
I thought that perhaps I could check errno through the $! variable and
then read from the pipe only if an error did occur, but it seems that
this value does not get reset or cleared if the command was successful.
Perhaps I'm not using the open3 function correctly. This is the syntax
that I am using:
$in=new FileHandle;
$out=new FileHandle;
$err=new FileHandle;
$in->autoflush();
$out->autoflush();
$err->autoflush();
$pid = open3(\*$in,\*$out,\*$err,"$command");
print $in $args;
$msg =<$err>
print STDOUT $msg;
Any constructive suggestions would be appreciated.
Regards,
Danilo
--
*******************************************************************
Danilo Unite (408) 721-4047
Systems Development Engineer danilo@sctechlib.nsc.com
National Semiconductor Corporation
*******************************************************************
------------------------------
Date: 05 Aug 1997 06:58:54 -0700
From: Peter Riocreux <peter.riocreux@cs.man.ac.uk>
Subject: Q: creating http post requests
Message-Id: <9kk9i0pw81.fsf@cs.man.ac.uk>
I am seeking a way to (from the command line) send requests using the
post method from an html form. In perl, obviously. I guess I need
the libwww bundle, but I am still relatively new to this perl lark, so
has anyone any pointers as to which modules (if any) I should look at
first.
Thanks.
Pete
--
Peter Riocreux, Amulet Group, Dept. Computer Science, Manchester University,
Oxford Road, MANCHESTER, M13 9PL, UK. <http://www.cs.man.ac.uk/amulet/>
Voice: +44 161-2753531 Mobile: +44 966-175986 Fax: +44 161-2756204
------------------------------
Date: Tue, 5 Aug 1997 06:56:16 -0700
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: reading a file and having embeded variables intepreted(sp).
Message-Id: <Pine.GSO.3.96.970805065319.10855B-100000@kelly.teleport.com>
On Mon, 4 Aug 1997, Chris Oxenreider wrote:
> The output of this program just prints the variable names, with out
> interpretation. (ie $f_name is printed as $f_name and not as chirs)
Although a double-quoted string in your program's text will be
interpolated, any data read from a file is merely data. But I'd recommend
using the Text::Template module to make this kind of thing possible in an
easy way. You can find this module on CPAN. Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 6 Aug 1997 00:34:28 GMT
From: mike@stok.co.uk (Mike Stok)
Subject: Re: rounding
Message-Id: <5s8gqk$dgc@news-central.tiac.net>
In article <33E751D7.5D0@cis.ohio-state.edu>,
michael james mangino <mangino@cis.ohio-state.edu> wrote:
>Is there any way to find out the length (i.e. number of characters) in a
>scalar variable? I am writing a cgi-script that averages some data and I
>want to chop off a lot of the trailing characters.
you probably want the length function e.g.
$length = length ($scalar);
which will give you the length of the string representation of $scalar in
bytes (or characters if 1 byte = 1 character.) The substr function is
useful for chopping up strings. Details on the use of substr a(and
length) are in the perlfunc manual page distributed with recent perls.
Hope this helps,
Mike
--
mike@stok.co.uk | The "`Stok' disclaimers" apply.
http://www.stok.co.uk/~mike/ | PGP fingerprint FE 56 4D 7D 42 1A 4A 9C
http://www.tiac.net/users/stok/ | 65 F3 3F 1D 27 22 B7 41
stok@psa.pencom.com | Pencom Systems Administration (work)
------------------------------
Date: Tue, 5 Aug 1997 21:45:04 GMT
From: ebohlman@netcom.com (Eric Bohlman)
Subject: Re: Running Perl under Windows - No NFS
Message-Id: <ebohlmanEEGn34.M8E@netcom.com>
Jerry Pank (jerryp.usenet@SPAMconnected.demon.co.uk) wrote:
: Whilst I don't expect the cgi stuff to run I guess there must be some
: form of emulator about. Everything I can find from CPAN assumes (I
: think) that the system will be /live/ or running as a NFS.
CGI.pm (which you should be using in any case) has a mode that lets you
test CGI scripts from the command line. You can also install an HTTP
server on your local machine and test that way. Or you can do both.
------------------------------
Date: Fri, 8 Aug 1997 00:31:30 GMT
From: Chris Dumas <cdumas@ibm.net>
Subject: stat on W95
Message-Id: <33EA68E1.45B3E29D@ibm.net>
I am using Perl for Windoze and cannot get the STAT function to work
with UNC filenames. Has anyone done this?
stat("\\\\FileServer\\Volume\\Filedir\\filename.typ"); does not work
stat("C:\AUTOEXEC.BAT) does....
It is a Novell 4.1 Network.....
Anyhelp would be appreciated....
Chris Dumas
cdumas@ibm.net
------------------------------
Date: 5 Aug 1997 19:50:46 GMT
From: "David Raccah" <raccah@bigfoot.com>
Subject: System call on app that spawns an app
Message-Id: <01bca1d9$55624510$bc8a2ac0@chewbacca>
Hello All,
I am using perl for Win32 and I have to spawn an install program and wait
for it to complete. I tried using system and it did not work because it
turns out that the program I am starting up is a 16bit app that then calls
a 32bit app (i.e. setup.exe calls some weird app called _insttmp_.1tp or
something and that is the 32bit app that runs the real setup). It turns
out that setup.exe (the 16bit app) calls the 32bit app and disappears so
system returns too early as the 32 bit app is not done processing.
What I need to know is how can you wait for an app that is forked from an
app that you started??? system will wait for the first NOT for the
second???
Any help would be appreciated!!
David Raccah
------------------------------
Date: Tue, 05 Aug 1997 21:21:38 -0600
From: supportj@icom.com
Subject: test
Message-Id: <870832699.23991@dejanews.com>
this is a test
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
------------------------------
Date: 07 Aug 1997 22:53:33 +0200
From: Gisle Aas <aas@bergen.sn.no>
Subject: Re: translating accented characters to non-accented chars
Message-Id: <hafithfzm.fsf@bergen.sn.no>
Tom Phoenix <rootbeer@teleport.com> writes:
> On Thu, 7 Aug 1997 a-sylvim@microsoft.com wrote:
>
> > My problem is I have a file that has ascii characters above 128
> > (accented characters, etc). I need to translate these to non-accented
> > chars, for example, e with an accent should become just plain e. I was
> > thinking of creating a function with a long list of one-to-one
> > translations with s/// , but it seems like there must be an easier way.
>
> An easier way (and faster, too!) would be to use one tr/// instead of many
> s/// commands. Hope this helps!
Try to use the Text::Striphigh module found on CPAN.
--
Gisle Aas <aas@sn.no>
------------------------------
Date: 5 Aug 1997 15:50:13 -0700
From: trs@azstarnet.com (Tim Smith)
Subject: Re: Uninitialized variables in scripts
Message-Id: <5s8an5$etd@web.azstarnet.com>
In article <33E778A6.59C8@ucsd.edu>, Fabio Speciale <fspecial@ucsd.edu> wrote:
> "Use of uninitialized variable at microsurvey.cgi line 28."
>Line 28 in the script looks like this:
> "read(STDIN, $incoming, $ENV{'CONTENT_LENGTH'});"
The two variables that could be uninitialized in that line are $incoming
and $ENV{'CONTENT_LENGTH'}. Since you're calling the CGI from the com-
mand line, the CONTENT_LENGTH environment variable will be undefined
unless you've taken care of that (i.e. set it into your environment
before running the script, or if you were using CGI.pm it would be
handled automatically, but then you wouldn't need to be reading from
STDIN because THAT would be done automatically). So, make sure you
set CONTENT_LENGTH into the environment.
Also, read uses the value of $incoming (doesn't just assign to it), so
you'll want $incoming to have a defined value. Usually, just putting
this line above the read will do the trick:
$incoming = '';
That's how you initialize variables in perl - you assign to them. Since
variables spring into being when you ask for them, you don't declare
them like in C or many other languages. You can specify their scope,
though, using a local() (dynamic scoping) or my() (lexical scoping -
perl5 only) declaration.
Passing values on the command line is not the same as sending them
to STDIN. If you put the input for the script on the command line,
then it is NOT available on STDIN and you'll not be able to read it
from STDIN. You need to do something like:
CONTENT_LENGTH=11 echo -n 'myvar=myval' | ./myscript
Or, better yet, upgrade to Perl5, use CGI.pm (comes with Perl5!)
and take advantage of pain-free command-line debugging.
Tim
------------------------------
Date: Tue, 5 Aug 1997 11:52:53 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Stephane RICHARD <srichard@san-jose.ate.slb.com>
Subject: Re: uppercase($mystring) ?
Message-Id: <Pine.GSO.3.96.970805115130.29887K-100000@kelly.teleport.com>
On Fri, 1 Aug 1997, Stephane RICHARD wrote:
> It's right but this is the shortest : $string = \U$string;
You must mean this.
$string = "\U$string";
Which is no shorter (and less easy to understand) than this.
$string = uc($string);
I prefer the latter. Hope this helps!
--
Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Tue, 05 Aug 1997 18:08:11 -0400
From: Danny Sadinoff <dsadinof@olf.com>
Subject: WANTED: Perl Dude for developer support Posn on Long Island
Message-Id: <33E7A44B.32BB13D4@olf.com>
This is a multi-part message in MIME format.
--------------E83AD3716A9FCD06D9302E7F
Content-Type: text/plain; charset=us-ascii
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Content-Transfer-Encoding: 7bit
Are you an all-round hacker?
Open Link Financial is a rapidly growing software company that needs a
cream-of-the-crop hacker to do:
-Developer support. Perl build tools, complex makefiles, NT/unix
issues we got 'em!
-Web administration. We're setting up a customer support site, so
c'mon down and help out with the security issues, the bug tracking, the
whole shebang.
-Java, Perl, NT, C, Unix, you name it, we need it.
Save yourself from ennui! We guarantee a challenging set of problems in
a relaxed, professional environment.
email danny@olf.com
--------------E83AD3716A9FCD06D9302E7F
Content-Type: text/x-vcard; charset=us-ascii; name="vcard.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Danny Sadinoff
Content-Disposition: attachment; filename="vcard.vcf"
begin: vcard
fn: Danny Sadinoff
n: Sadinoff;Danny
org: Open Link Financial
email;internet: dsadinof@olf.com
tel;work: (516) 227-6600 x206
tel;fax: (516) 227-1799
x-mozilla-cpt: ;0
x-mozilla-html: TRUE
end: vcard
--------------E83AD3716A9FCD06D9302E7F--
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". 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 835
*************************************