[6284] in Perl-Users-Digest
Perl-Users Digest, Issue: 906 Volume: 7
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Feb 6 13:27:20 1997
Date: Thu, 6 Feb 97 10:00:20 -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 Thu, 6 Feb 1997 Volume: 7 Number: 906
Today's topics:
Re: 5.002 dies silently on failed socket write (Igor Shpigelman)
[Q] how do I grok this: ${*$obj}{'whatever'} = $foo <nmljn@wombat.staff.ichange.com>
Re: Advice: Fastest ASCII hash tree dump <tchrist@mox.perl.com>
Cgi script help, please! <magnus@grasberg.se>
Re: Crypting (Kjetil Skotheim)
emailing with CGI??? <NPD@ix.netcom.com>
Re: emailing with CGI??? (Nathan V. Patwardhan)
embedding manual line-feeds in Perl output <cpw@slip.net>
function arguments <williams@mod5.ag.rl.ac.uk>
Re: How can I call a perl CGI from a C cgi ? <rra@cs.stanford.edu>
Re: How do child processes talk to each other? [Q] <rootbeer@teleport.com>
Re: How to do this using perl? <rra@cs.stanford.edu>
How to peek at next line of STDIN? (repost) (H. Todd Chapman)
Re: How to peek at next line of STDIN? (repost) <rootbeer@teleport.com>
How to peek at next line of STDIN? (H. Todd Chapman)
Re: Perl 5.003 causes segmentation fault on SGI Irix <jonas@cultcom.se>
perl bug? side effect of using != where ne is required (John Klassa)
Re: Perl CGI error: Can't find loadable object for modu (Doug Sinnott)
Re: Perl on Microsoft IIS, NT Server 4.0 <stemo@powersim.no>
POSIX in the latest copy of Perl5.003 <rick.tan@Eng.Sun.COM>
print 'undef' in an elegant way ? (Helmut Jarausch)
Re: print 'undef' in an elegant way ? <rootbeer@teleport.com>
Re: Trimming Dollar Value <rootbeer@teleport.com>
Re: Using exec-Why won't this work? <jander@jander.com>
Re: Using exec-Why won't this work? <rootbeer@teleport.com>
Digest Administrivia (Last modified: 8 Jan 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 6 Feb 1997 17:13:57 GMT
From: igor@isgtec.com (Igor Shpigelman)
Subject: Re: 5.002 dies silently on failed socket write
Message-Id: <E56yJA.5pD@isgtec.com>
Keith Dreibelbis (dribbs@netspace.org) wrote:
: and particularly why an eval wasn't able to catch it. The only idea I
: have is that I was generating a SIGPIPE by performing a "write on a pipe
: when there is no process to read it", or perhaps some other signal. But
: signal(3) doesn't seem to indicate that a SIGPIPE causes an application to
: exit, and I don't see any other appropriate signals.
Well, you've solved it. SIGPIPE, if not properly caught, or ignored, will
kill your process, without generating core dump. You can easily verify it
by setting the handler.
--
Igor Shpigelman "If you've fallen off the cliff,
igor@isgtec.com you may as well try to fly" <*>
------------------------------
Date: 06 Feb 1997 11:17:14 -0500
From: nelson <nmljn@wombat.staff.ichange.com>
Subject: [Q] how do I grok this: ${*$obj}{'whatever'} = $foo
Message-Id: <w10afphkiyd.fsf@wombat.staff.ichange.com>
Instructing myself further in the bowels of modules, I went wading
unarmed into Graham Barr's marvelous Net::* modules. I noticed he
uses ${*$obj}{'key'} = $value a lot. Try as I might, I don't think I
am grokking this correctly because I can't come up with any reasonable
idea of what this either accomplishes or is a shortcut for.
Nevertheless, it seems useful, and I suspect it's something I'd like
to emulate.
The best I can do:
$ A scalar variable follows.
{ Bracket denotes the start of the identifier name.
* All entries in the symbol table with the following name.
$ A scalar variable follows (this will be the ident. name).
obj Together with the previous '$', this expands to the name
that will be dereferenced by the '*' above.
} Now we know that we are interested in the scalar component
of the typeglob identified by whatever was in $obj.
{ Start hash key.
'key' The hash key itself.
} End hash key. Thus endeth the left side.
Now, in Net::POP3, to take a totally arbitrary example, we have:
my $obj = $type->SUPER::new(PeerAddr => $host,
PeerPort => $arg{Port} || 'pop3(110)',
Proto => 'tcp',
Timeout => defined $arg{Timeout}
? $arg{Timeout}
: 120
) or return undef;
...followed by:
${*$obj}{'net_pop3_host'} = $host;
So $obj will be an object (a ref that knows what package it belongs
to). But what is the value of ${*$obj}? Suppose $obj were something
like "Blah". Then I take it that the value of ${*$obj} would be
equivalent to the value of ${*Blah}, which, unless I'm mistaken, would
be equivalent to the value of $Blah.
But $obj is *not* "Blah". Instead it's something like
PackageName::HASH=(0x2304FF) (or whatever the notation is). Surely
there's not a symbol table entry by the name of
PackageName::HASH=(0x2304FF)?
So then, to summarize:
How do I read ${*$obj}{'key'} = $value where $obj is an object
reference, and why would I want to write code this way?
Cheers,
Laird
--
Laird J. Nelson (617) 252-5147
Systems Engineer 25 First Street
Nets, Inc. Cambridge, MA 02141
nmljn@wombat.staff.ichange.com http://www.netsinc.com/
------------------------------
Date: 6 Feb 1997 14:33:25 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Advice: Fastest ASCII hash tree dump
Message-Id: <5dcq3l$pth$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
lehman@visi.com (Todd Lehman) writes:
:I'm reading and writing a nested hash data structure from/to a plain ASCII
:text file and I want to do it as fast as possible in Perl. I'm storing
:some web data this way and interacting with it using Perl/CGI scripts.
:
:Taking a suggestion from the Camel book (p.274, 2nd Ed), I'm letting Perl
:parse my incoming data for me. This seems to work pretty darn fast, and
:all is good in the world. :) The challenge I still have, however, is to
:dump that data back out to a file as quickly as possible. I've written two
:versions of a hash dump subroutine, one which prettyprints the output
:and another which dumps the output all on one super-compacted line.
:
:I've done everything I could think of so far to optimize the code,
:short of unrolling the recursion (I guess I might try that as a final
:last-gasp step). Any other possibilities?
Look into
http://www.perl.com/CPAN/modules/by-category/06_Data_Type_Utilities/
which has things like this in it:
Data::Dumper - Displays Perl data structures, and writes them to disk as
self-contained Perl code.
http://www.perl.com/cgi-bin/cpan_mod?module=Data::Dumper
FreezeThaw - Converts Perl data structures to strings and back.
http://www.perl.com/cgi-bin/cpan_mod?module=FreezeThaw
Storable - Makes your data persistent across application sessions. Handles
references to simple data types, but nothing more complex. It's pretty efficient.
http://www.perl.com/cgi-bin/cpan_mod?module=Storable
--tom
--
Tom Christiansen Perl Consultant, Gamer, Hiker tchrist@mox.perl.com
If you want to see useful Perl examples, we can certainly arrange to have
comp.lang.misc flooded with them, but I don't think that would help the
advance of civilization. :-) --Larry Wall in <1992Mar5.180926.19041@netlabs.com>
------------------------------
Date: Thu, 06 Feb 1997 14:35:05 +0100
From: Magnus Grdsberg <magnus@grasberg.se>
Subject: Cgi script help, please!
Message-Id: <32F9DE09.155A@grasberg.se>
Hi...
I want to know how to make a kind of search and replace from within a
pearl script................
The search should be in a external text file...????
please help me...
Magnus Grdsberg
magnus@grasberg.se
------------------------------
Date: 6 Feb 1997 15:34:19 GMT
From: kjetil.skotheim@usit.uio.no (Kjetil Skotheim)
Subject: Re: Crypting
Message-Id: <5dctlr$5au@ratatosk.uio.no>
In article <32F94E2B.7623@icepr.com>, rom_ortiz@icepr.com says...
>
>How I can decode after I use crypt in a name?
>Please email me at rom@icepr.com
>Thanks
>
>Rom Ortiz
>rom_ortiz@icepr.com
Not possible. Thats the whole point. The crypt-function
is used to crypt passwords and see if they match the
cryptstring from when the password was created.
Crypt is maybe a bad name for such a thing. Garble,
scramble or hash would perhaps have been better
------------------------------
Date: 6 Feb 1997 16:12:41 GMT
From: "Paul Pollastro" <NPD@ix.netcom.com>
Subject: emailing with CGI???
Message-Id: <01bc1448$6c95f8e0$84c3b7c7@workstation-2>
Any Perl gurus out there that can help a troubled novice?
I am trying to create a html form that will be used as a phone directory.
The user will be able to send an email by selecting the radio buttons that
will be place in the "to" field of the clients existing email program. What
I am looking for is how to send an email to more than one address. Can I
use the mailto: protocol or do I have to write a script? It should be
designed to use the clients existing email program not to be sent through
the browser.
For an example:
www.npdgfx.com/xyz/browse.htm
With this example I can select a radio button and submit it and the email
program opens and the value is placed the "to" field. How can I select all
THREE?
Any help is much appreciated..
-Paul
------------------------------
Date: 6 Feb 1997 16:30:51 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: emailing with CGI???
Message-Id: <5dd0vr$fes@fridge-nf0.shore.net>
Paul Pollastro (NPD@ix.netcom.com) wrote:
: I am trying to create a html form that will be used as a phone directory.
: The user will be able to send an email by selecting the radio buttons that
: will be place in the "to" field of the clients existing email program. What
Oops! You must have erred when posting a CGI-specific question to
comp.lang.perl.misc. :-)
I'd strongly suggest taking a look at CGI.pm, which is available at
http://www.perl.com/perl/CPAN/, and www.dejanews.com for the
comp.infosystems.www.authoring.cgi archives. I'm certain you'll
find previous postings that answer your question sufficiently.
HTH!
--
Nathan V. Patwardhan
nvp@shore.net
"Hello, good citizen. I'm Batman.
Would you like to be my assistant?
Would you like to ride with me?
Would you like to ride with Batman?"
------------------------------
Date: Thu, 06 Feb 1997 08:41:55 -0800
From: Coburn Watson <cpw@slip.net>
Subject: embedding manual line-feeds in Perl output
Message-Id: <32FA09D3.4C82@slip.net>
Does anyone know how to print a manual linefeed to an output file from
Perl. I'm attempting to parse a Unix file (IRIX 6.2, Perl 5.001) in
such a manner that I can then import it into a filemaker pro file on a
Mac. Since newlines represent record breaks in fmpro, a manual
linefeed(MS Word term?) is used within a multiline section to allow
multiple lines to be imported in a single field. If this is completely
confusing, please forgive.
Thanks in advance,
Coburn Watson
Info. Systems Support - Research
Scios, Inc.
cpw@slip.net
------------------------------
Date: Thu, 06 Feb 1997 17:43:04 +0000
From: Simon Williams <williams@mod5.ag.rl.ac.uk>
Subject: function arguments
Message-Id: <32FA1828.41C6@mod5.ag.rl.ac.uk>
Hi
I'm a fairly recent convert to perl, so I apologise if this
seems a trivial question. I'm used to FORTRAN and similar
languages, where variables passed to a subroutine are
completely local to that subroutine. I'm starting to write
perl scripts with multiple subroutines and I'm hitting
problems with clashes between variable names. For instance
the following script:
############### MAIN ##############
$str="foo";
print " $str\n";
$return = &func($str);
print " $str\n";
############### FUNC ##############
sub func {
local ($str);
$str="bar";
print " $str\n";
$_[0]=$str;
}
###################################
produces
foo
bar
foo
NOT
foo
bar
bar
as I was expecting. The "local($str)" in the function
func seems to prevent me passing something back to the $str
in main.
Isn't there some way of isolating *all* variables in *each*
function from all variables in all other functions including
main?
--
-------------------------------------------------------------------
Simon Williams British Atmospheric Data Centre
s.r.williams@rl.ac.uk Tel : 01235 446314 FAX : 01235 445848
-------------------------------------------------------------------
------------------------------
Date: 06 Feb 1997 08:46:55 -0800
From: Russ Allbery <rra@cs.stanford.edu>
Subject: Re: How can I call a perl CGI from a C cgi ?
Message-Id: <qumvi85dgqo.fsf@cyclone.stanford.edu>
Thierry DELATTRE <th@euro-checkpoint.com> writes:
> I'm using a CGI written in C and I would like to execute another CGI
> from it, but this one is written in PERL. Is it possible to do and how
> can I do ?
What's a CGI? A CGI what? CGI is a protocol; you can't write CGI in C or
Perl. You can write CGI *programs* in C or Perl.
In any event, this depends on precisely what you want to do, and it's
really a C question, not a Perl question. You can execute a Perl script
from inside a C program the same way you can execute any other program
from inside a C program.
Chances are, what you want is the system(3) C library call.
If that isn't enough help, try comp.infosystems.www.authoring.cgi or
comp.lang.c.
--
Russ Allbery (rra@cs.stanford.edu) <URL:http://www.eyrie.org/~eagle/>
------------------------------
Date: Thu, 6 Feb 1997 09:11:22 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Eric J Peers <peers@rintintin.Colorado.EDU>
Subject: Re: How do child processes talk to each other? [Q]
Message-Id: <Pine.GSO.3.95.970206090947.14089B-100000@linda.teleport.com>
On 5 Feb 1997, Eric J Peers wrote:
> How can I get two child processes to talk to each other/
> pass strings back and forth.
You can find one or two ideas in the perlipc(1) manpage. Hope this helps!
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: 06 Feb 1997 08:43:28 -0800
From: Russ Allbery <rra@cs.stanford.edu>
Subject: Re: How to do this using perl?
Message-Id: <qumybd1dgwf.fsf@cyclone.stanford.edu>
Lasse Hillerxe Petersen <lassehp@imv.aau.dk> writes:
> I don't recall backslash being part of either CP/M 2.2 or CP/M 3, nor of
> Concurrent CP/M-86, which I believe was the last CP/M (I only had a
> brief encounter with this in highschool, where it was the OS used on the
> Danish produced Regnecentralen RC-Piccoline computers.) Back then, there
> were "user areas", identified by numbers. CP/M, as far as I remember,
> never had hierarchical directory structures. So I doubt it's fair to
> blame Kildall here. (Blame him for not talking to IBM when it mattered:
> Bill Gates wouldn't have been the devil he is now.)
No, the problem was that CP/M, as I recall, used / as the option character
(rather than - in Unix), and DOS inherited *that*. And then, when
Microsoft added hierarchical directory structures in DOS 2.0, / was
already taken as a separator, so they fell back on \.
> However, I do believe that noone should write code depending on / in
> paths or '\012' as line separator and yet call their code truly
> portable.
If you're programming in Perl, you should assume that / is the path
separator. The DOS port of Perl will automagically convert slashes to
backslashes for you. Macs are more of a problem, since / can occur in
real filenames (it can't, as I recall, in DOS because it's reserved as the
option character) -- I'm not sure how that is handled.
Does anyone know off-hand if the VMS port of Perl will automatically
convert '/some/directory/file' to '[some.directory]file' for you?
> If I remember correctly, even assuming that '\n' and '\012' are the same
> is wrong for ANSI C.
That's correct. However, \n is the line end character on all platforms.
C converts internally for you.
This, however, is why you should always use chomp instead of chop to
remove end-of-line markers.
> In fact, I think this is a part of Perl where there are things to clean
> up. (read: too many things in Perl are Unix-biased to some extent.)
I think it's better than you might think.
--
Russ Allbery (rra@cs.stanford.edu) <URL:http://www.eyrie.org/~eagle/>
------------------------------
Date: 6 Feb 1997 16:11:13 GMT
From: htchapma@vela.acs.oakland.edu (H. Todd Chapman)
Subject: How to peek at next line of STDIN? (repost)
Message-Id: <5dcvr1$k6o@news2.acs.oakland.edu>
I searched Dejanews, the FAQ, and Tom's EYEWTK???? and came up with one
post with the same question but no respones.
The question is:
How can I peek at the next line from <> without making it inacessible
from the subsequent function call via <> ?
In other words I want to use the angle operator to read in a line and
then put that line back so I can use the angle operator to read it in
again. How can this effect be achieved?
Thanks.
------------------------------
Date: Thu, 6 Feb 1997 09:47:45 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: "H. Todd Chapman" <htchapma@vela.acs.oakland.edu>
Subject: Re: How to peek at next line of STDIN? (repost)
Message-Id: <Pine.GSO.3.95.970206094003.14089F-100000@linda.teleport.com>
On 6 Feb 1997, H. Todd Chapman wrote:
> How can I peek at the next line from <> without making it inacessible
> from the subsequent function call via <> ?
You can use tell() and seek() to do this, using the special ARGV
filehandle. Of course, it's important to not read past the end of one file
and into the next, because with <> there's no going back. (If this is a
worry, you may wish to open a filehandle explicitly, instead of using ARGV
and the magic of <>.)
Those functions are documented in perlfunc(1), and ARGV is documented in
perlop(1). Hope this helps!
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: 6 Feb 1997 16:06:49 GMT
From: htchapma@vela.acs.oakland.edu (H. Todd Chapman)
Subject: How to peek at next line of STDIN?
Message-Id: <5dcvip$k6l@news2.acs.oakland.edu>
I searched Dejanews, the FAQ, and Tom's EYEWTK???? and came up with one post with the same question but no respones.
The question is:
How can I peek at the next line from <> without making it inacessible from the subsequent function call via <> ?
In other words I want to use the angle operator to read in a line and then put that line back so I can use the angle operator to read it in again. How can this effect be achieved?
Thanks.
------------------------------
Date: Thu, 06 Feb 1997 14:21:48 -0800
From: Jonas Liljegren <jonas@cultcom.se>
To: jeff@alexr.com
Subject: Re: Perl 5.003 causes segmentation fault on SGI Irix
Message-Id: <32FA597C.2F1C@cultcom.se>
Jeff Ferguson wrote:
>
> Anyone have any thoughts?
I run Perl 5.003 under SGI Irix. The following program always cause a
core dump:
#!/bin/perl
use integer;
1%$1;
--
/ Jonas Liljegren
http://w3.adb.gu.se/~a95jonas/welcome.html
Geek Code 3.1 GIT/P/Od-s+:-a24C++US++P++LEW++N++
o?K?w!oM!VPSPE-Y--PGP-t+5X++R@tv+b+!DID++Geh!!r!y+
------------------------------
Date: 6 Feb 1997 14:36:25 GMT
From: klassa@ivc1.ivc.com (John Klassa)
Subject: perl bug? side effect of using != where ne is required (semi-long)
Message-Id: <5dcq99$fis@client3.news.psi.net>
A co-worker came to me with some strange output he was seeing... We managed
to figure out that the root of his problem was that he was using "!=" where
he needed to be using "ne". The symptoms were puzzling, though, so I set
about to write a minimal test case that would demonstrate the behavior.
This almost looks like a perl bug, to me. What do y'all think?
The code:
$idx = "000";
$jdx = 0;
$begin = shift;
# !!! this comparison of '$begin' to "" is the culprit; as written
# here, it's correct... if changed to "!=" (which is incorrect),
# the code still falls into the "then" clause and appears to do the
# right thing, but with strange (subsequent) side effects
if ($begin ne "") {
print "Setting 'idx' and 'jdx' from 'begin' (which is [$begin]).\n";
$idx = $begin;
$jdx = int($begin);
}
print "begin is [$begin]; idx is [$idx]; jdx is [$jdx]\n\n";
while ($jdx < 5) {
print "begin is [$begin]; idx is [$idx]; jdx is [$jdx]\n";
$idx++;
$jdx++;
}
If I leave the comparison as written above, things work as expected.
Running it with argument "001", as in "% test-script 001", I get:
Setting 'idx' and 'jdx' from 'begin' (which is [001]).
begin is [001]; idx is [001]; jdx is [1]
begin is [001]; idx is [001]; jdx is [1]
begin is [001]; idx is [002]; jdx is [2]
begin is [001]; idx is [003]; jdx is [3]
begin is [001]; idx is [004]; jdx is [4]
When I change the comparison to "!=", I get:
Setting 'idx' and 'jdx' from 'begin' (which is [001]).
begin is [001]; idx is [001]; jdx is [1]
begin is [001]; idx is [001]; jdx is [1]
begin is [001]; idx is [2]; jdx is [2]
begin is [001]; idx is [3]; jdx is [3]
begin is [001]; idx is [4]; jdx is [4]
Note that _inside the loop_, 'idx' has the _correct_ value the first time
through. It's only after being incremented that it gets used strictly as an
integer and not as a string that looks like an integer (internal hijinks
aside).
If 'begin' and 'idx' were immediately treated as 1 rather than "001" (as a
result of the incorrect comparison), I think I'd understand what's going on
(maybe :-)). As it is, it isn't clear to me why it is that things work the
first time through, then fall apart after the $idx++.
Thoughts appreciated...
Thanks!
John
--
John Klassa (W) klassa@ivc.com (H) klassa@ipass.net
<>< http://www.ivc.com/~klassa http://www.ipass.net/~klassa
------------------------------
Date: Thu, 6 Feb 1997 16:23:54 GMT
From: Douglas.Sinnott@UToledo.Edu (Doug Sinnott)
Subject: Re: Perl CGI error: Can't find loadable object for module Win32::File in @INC at ...
Message-Id: <E56w2E.Bqv@utnetw.utoledo.edu>
In article <32eeb8ef.137819944@news.ti.com>,
chuach@ti.com (Chua Chye Heng) wrote:
>I have read all the news thread regarding the above problem. But mine
>is experienced thro the CGI
>
>I experienced strange problem in executing Perl ( Perl for Win32 Build
>110: perl version 5.001) through CGI using Microsoft IIS as the Web
>Server. I use Netscape Navigator to try out the Perl Script residing
>in the server. The IIS is configured to use IUSER_DSIS16 an internal
>account for logging on to NTAS.
>
>When I put 'use Win32::File;' as the first line in my Perl CGI script
>I get the following:
>-----------------------------------------------------------------------------
--------------------
>Can't find loadable object for module Win32::File in @INC at
>E:\SUPPORT\perl5\Lib/Win32/File.pm line 82
>BEGIN failed--compilation aborted at e:\www\scripts\slp\test-pm.pl
>line 1
>-----------------------------------------------------------------------------
--------------------
>Thanks in advance for any help or tips.
check your file type associations. I had same problem on NT 4.0. Deleted
registry entries for file type .pl and re-entered them through explorer to fix
problem. It seems the install script does not build the association properly.
If your problem is similar to mine, you won't see the .pl extention in the
file types list but if you try to add it you will receive a message that it
already exists.
Douglas.Sinnott@UToledo.Edu
------------------------------
Date: Thu, 06 Feb 1997 15:56:42 +0100
From: Steinar Moen <stemo@powersim.no>
Subject: Re: Perl on Microsoft IIS, NT Server 4.0
Message-Id: <32F9F12A.D00@powersim.no>
Duncan Harris wrote:
> In article <32F8797F.4171@powersim.no>, stemo@powersim.no (Steinar Moen)
> wrote:
> > Perl doesn't work on my Server.
> > I have installed Perl5 on my Windows NT Server 4.0, running MS IIS 3.0.
> > I've also enabled the Execute permission on my cgi-bin directory. (This
> > is a virtual directory)
> > Is there anything else I have to do? (Enabling Perl etc...?)
> Yes, enable the ScriptMap in the registry:
> Load REGEDT32.
> Select:
> HKEY_LOCAL_MACHINE
> \System
> \CurrentControlSet
> \Services
> \W3SVC
> \Parameters
> \ScriptMap
>
> From the Edit menu select Add Value
>
> in the Add Value dialog add .pl with a data type of REG_SZ, in the string
> editor enter the String Value of <full path>\perl.exe %s
The install program for Perl already did that, except that the string
was <path>\perl5\bin\PerlIS.dll
Steinar Moen
------------------------------
Date: Thu, 06 Feb 1997 09:11:45 -0800
From: Rick Tan <rick.tan@Eng.Sun.COM>
Subject: POSIX in the latest copy of Perl5.003
Message-Id: <32FA10D1.1E5A@Eng.Sun.COM>
Hi,
I just upgraded to the latest Perl5.003 and it's breaking my code.
In a script that uses 'use POSIX "sys_wait_h"', Perl 5.003 is
complaining with:
Bare word found where operator expected at
/usr/local/lib/perl5/auto/POSIX/autosplit.ix line 1, near "15 SMI"
(Missing operator before SMI?)
Array found where operator expected at
/usr/local/lib/perl5/auto/POSIX/autosplit.ix line 1, near "SMI"
Bare word found where operator expected at
/usr/local/lib/perl5/auto/POSIX/autosplit.ix line 1, near "15 SMI"
(Missing operator before SMI?)
Array found where operator expected at
/usr/local/lib/perl5/auto/POSIX/autosplit.ix line 1, near "SMI"
syntax error at /usr/local/lib/perl5/auto/POSIX/autosplit.ix line 1,
near "15 SMI"
at /usr/local/lib/perl5/POSIX.pm line 6
at load.10 line 134.
BEGIN failed--compilation aborted at load.10 line 134.
What am I doing wrong?
TIA,
Rick
------------------------------
Date: 6 Feb 1997 16:08:02 GMT
From: jarausch@numa1.igpm.rwth-aachen.de (Helmut Jarausch)
Subject: print 'undef' in an elegant way ?
Message-Id: <5dcvl2$lab$1@news.rwth-aachen.de>
Hi,
can anybody suggest an elegant method to print an undefined value
when option 'w' is in effect.
My is solution is ugly - isn't it?
print "Id = @{[(defined($MyV->{Id}) ? $MyV->{Id} : \"undef\")]}\n";
Thanks for any hints.
--
Helmut Jarausch
Lehrstuhl f. Numerische Mathematik
Institute of Technology
RWTH Aachen
D 52056 Aachen, Germany
------------------------------
Date: Thu, 6 Feb 1997 09:38:55 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Helmut Jarausch <jarausch@numa1.igpm.rwth-aachen.de>
Subject: Re: print 'undef' in an elegant way ?
Message-Id: <Pine.GSO.3.95.970206093409.14089E-100000@linda.teleport.com>
On 6 Feb 1997, Helmut Jarausch wrote:
> can anybody suggest an elegant method to print an undefined value
> when option 'w' is in effect.
Could this be what you want?
{ local $^W = 0;
print $foo;
}
> My is solution is ugly - isn't it?
>
> print "Id = @{[(defined($MyV->{Id}) ? $MyV->{Id} : \"undef\")]}\n";
I'd have to agree.
sub printable_undef ($) { defined($_[0]) ? $_[0] : 'undef' }
print "Id = @{[ printable_undef $MyV->{Id} ]}\n";
That's prettier. Hope this helps!
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: Thu, 6 Feb 1997 09:31:14 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Bok Nan Lo <support@inklineglobal.com>
Subject: Re: Trimming Dollar Value
Message-Id: <Pine.GSO.3.95.970206091355.14089D-100000@linda.teleport.com>
On 4 Feb 1997, Bok Nan Lo wrote:
> I'm having hard time with formatting and trimming an amount in a variable.
> e.g. $3.4405
> P/S: I want to actually trim it rather than formatting to STDOUT using
> printf().
What do you mean by "trim" rather than "format"? You could use sprintf to
produce a string formatted to two places. But if by "trim" you mean what I
mean by "round", you might want to use something like this.
$foo = int( $foo * 100 ) / 100; # Round to the nearest penny
Note that this doesn't force having two decimal places, (or add a dollar
sign, for that matter) so using (s)printf at output time is still needed.
Hope this helps!
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: 06 Feb 1997 11:31:24 -0500
From: Jim Anderson <jander@jander.com>
Subject: Re: Using exec-Why won't this work?
Message-Id: <vi853nhf.fsf@jander.com>
"D.M. Johnson" <ez045864@peseta.ucdavis.edu> writes:
'exec' overlays the current process, so there's nothing to come back
to :) What you want is a fork/exec combo. Seee the Blue Camel.
> I am using exec to run a spell function. I know that it works because if
> $pass is spelled wrong then it is put into the file "temp". However, I
> can't read it into $word, nor can I execute any print statement after the
> exec call. Why??? Thanks in advance.
>
> #!/pkg/bin/perl
>
> $pass = "couctrx";
> print "This prints out fine\n";
>
> exec "echo $pass | spell > temp";
>
> print "This won't print\n";
>
> open(TEMP,"temp");
> print "This won't print either\n";
> $word=<TEMP>;
> print "$pass\t$word\n"; #Neither of these will print
>
>
> BTW, I am using ULTRIX.
>
>
--
Jim Anderson jander@jander.com
PGP Public Key Fingerprint: 0A 1C BB 0A 65 E4 0F CD
4C 40 B1 0A 9A 32 68 44
------------------------------
Date: Thu, 6 Feb 1997 09:07:47 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: "D.M. Johnson" <ez045864@peseta.ucdavis.edu>
Subject: Re: Using exec-Why won't this work?
Message-Id: <Pine.GSO.3.95.970206090441.14089A-100000@linda.teleport.com>
On Wed, 5 Feb 1997, D.M. Johnson wrote:
> I am using exec to run a spell function. I know that it works because
> if $pass is spelled wrong then it is put into the file "temp". However,
> I can't read it into $word, nor can I execute any print statement after
> the exec call. Why???
You've fallen victim to the most frequent error involving exec:
Failure To Read Manpage (FTRM).
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: 8 Jan 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Jan 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.
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 V7 Issue 906
*************************************