[8659] in Perl-Users-Digest
Perl-Users Digest, Issue: 2276 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 8 15:07:49 1998
Date: Wed, 8 Apr 98 12:00:28 -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 Wed, 8 Apr 1998 Volume: 8 Number: 2276
Today's topics:
Re: adding passwords accross multiple serveers <Tony.Curtis+usenet@vcpc.univie.ac.at>
Bill Gates should be invited to O'Reilly's "Free Softwa ben@hayamasa.demon.co.uk
Can somebody help me understand the internals of "Carp" <kgentle@platinum.com>
Re: changing perms w/CHMOD. (Tye McQueen)
Re: content of file handle <rootbeer@teleport.com>
Embedding: glue design suggestions needed igor@everyware.com
Re: Getting the subroutine name from within a sub (Mark-Jason Dominus)
Re: HELP .. return true value <rootbeer@teleport.com>
Re: HELP .. return true value 6xtippet@CyberJunkie.com
How to access a randomly created file for reading cmeena@hotmail.com
Overriding 'print' aixgod@ix.netcom.com
Re: Perl code to generate MS Excel and Access files ? <Russell_Schulz@locutus.ofB.ORG>
perl compilation under cygwin32 <lanier@shell6.ba.best.com>
Re: Perl scripts not working with Netscape 3.0 on MacIn <rootbeer@teleport.com>
Re: Perl scripts not working with Netscape 3.0 on MacIn (Andre L.)
Re: perl win 32 : asterisk on command line (Jeffrey R. Drumm)
Re: perl win 32 : asterisk on command line (Gregory Snow)
Re: Ping (M.J.T. Guy)
Re: print crypt($password,$Salt); not working (David Wall)
Re: RMS should be invited to O'Reilly's "Free Software (Joe Buck)
scanf substitute in perl (Ali Mehdizadeh)
SDBM error <ruig@ece.nwu.edu>
Re: sending mail using perl <ragoff@sandia.gov>
Re: sending mail using perl <ragoff@sandia.gov>
Strange "Modification of a read-only value attempted" e <james.a.squire@boeing.com>
Re: Tie/bless vs. bless/tie and segmentation fault (Tye McQueen)
Re: Use of implicit split to @_ is deprecated (David Wall)
Re: Wanted: Amoo to stop my sysadmin from whining mpeppler@mbay.net
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 08 Apr 1998 19:07:42 +0200
From: Tony Curtis <Tony.Curtis+usenet@vcpc.univie.ac.at>
Subject: Re: adding passwords accross multiple serveers
Message-Id: <7xlntg6y3l.fsf@beavis.vcpc.univie.ac.at>
Re: adding passwords accross multiple serveers, grindrod
<grindrod@tfn.com> said:
grindrod> Before I reinvent the wheel, has anyone made a
grindrod> program that can can add a logon and password to a
grindrod> server and then add it to a specified group of
but what kind of server? (yp? nis+? http? samba?)
we're not psychic (well, only some of the time :-)
--
Tony Curtis, Systems Manager, VCPC, | Tel +43 1 310 93 96 - 12; Fax - 13
Liechtensteinstrasse 22, A-1090 Wien, AT | http://www.vcpc.univie.ac.at/
"You see? You see? Your stupid minds! Stupid! Stupid!" ~ Eros, Plan9 fOS.
------------------------------
Date: Wed, 08 Apr 1998 12:58:52 -0600
From: ben@hayamasa.demon.co.uk
Subject: Bill Gates should be invited to O'Reilly's "Free Software Summit" (was Re: RMS should be invited to O'Reilly's "Free Software Summit")
Message-Id: <6ggdss$h5s$1@nnrp1.dejanews.com>
This article is about whether O'Reilly should invite Bill Gates and
Richard Stallman to their conference and it's an indirect followup to
the discussion entitled ``RMS should be invited to O'Reilly's "Free
Software Summit"''.
O'Reilly is a proprietory software and book publishing company.
O'Reilly publishes several books about free software. O'Reilly have
taken several freely redistributable works and turned them into
proprietory works. The best known example is the X windows
documentation which was taken by O'Reilly and made into proprietory
books with the freedoms removed. Several other freely redistributable
works have been turned into books and taken out of the free realm by
O'Reilly. In many cases, unlike the X windows documentation, they
have been killed off as freely redistributable works, so O'Reilly is a
company that has done some harm to free redistribution.
(I don't know if O'Reilly's proprietory software was developed using
free sources: I wouldn't be surprised.)
I agree with what the GNU project says about Microsoft: Microsoft
should be treated the same as any other proprietory software
developer. So why shouldn't Bill Gates be invited to this conference
if it's hosted by O'Reilly?
I also don't know why Microsoft should not hold a free software
conference if this proprietory software company is having a freeware
conference. In fact I've never heard of Microsoft taking anything
freely redistributable and turned it into a proprietory product, so
perhaps Microsoft is a more suitable host. I expect that the reason
is that Microsoft is not trying to exploit free redistribution and
turn it proprietory. But that is another reason why Microsoft might
make a more suitable host than O'Reilly.
As for inviting Stallman, as far as I know, Richard Stallman is
opposed to proprietory software and non-freely redistributable and
modifiable books, so I expect that he would not want to go to a
conference hosted by Microsoft, or O'Reilly, but I don't know: I doubt
that a proprietory software and book publishing company like Microsoft
or O'Reilly would want to invite someone who's opposed to their
business method.
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Wed, 08 Apr 1998 14:47:43 -0400
From: Ken Gentle <kgentle@platinum.com>
Subject: Can somebody help me understand the internals of "Carp"?
Message-Id: <352BC64F.20E1D7D4@platinum.com>
Greetings!
I need a way to emulate "carp|croak|confess" within a script that does
not have access to STDIN/STDOUT/STDERR and may be executing with access
to a user or not. Ideally I would be able to have my "carp" look-alikes
simply return a formatted string/array that contains the errors/stack
trace that I can then display or record appropriately.
I've searched the FAQ, reviewed the archive via DejaNews, read the Camel
book, and even read (but haven't understood) the source - but I'm just
not comprehending exactly what "Carp" is doing.
Many of the "stack" reporting functions that have been posted are *much*
simpler than Carp, but I have to beleive that Carp does what it does for
a reason...
I foolishly thought that I might be able to hijack the Carp package and
munge it ever-so-slightly to do my bidding. But I hesitate to muck with
something that works that I don't understand.
An annotated listing of Carp.pm might be all I need. I would really
appreciate an interpretation, especially of "shortmess".
Thanks in advance!
Ken
--
==========================================================================
J. Kenneth Gentle (Ken) | Platinum Technology, Inc.
| Aston-Brooke Development Lab
Email: kgentle@platinum.com | Three Valley Square, Suite 300
Voice: (215) 591-5161 | 512 Township Line Road
Fax: (215) 591-5175 | Blue Bell, PA 19422-2701
==========================================================================
------------------------------
Date: 8 Apr 1998 11:53:21 -0500
From: tye@fiinix.metronet.com (Tye McQueen)
Subject: Re: changing perms w/CHMOD.
Message-Id: <6gga21$n0h@fiinix.metronet.com>
jhill@mitre.org (Jason C. Hill) writes:
) My problems is I don't think I can issue a chmod command like
) this chmod g-w,o-w or something like that, I don't want to chnage any of
) the other bits incase some of them are sticky.
You might want to take a look at
http://www.metronet.com/~tye/chmug.html
It understands "g-w,o-w". I should modulize it so you can just
call chmod($file,"g-w,o-w") or something similar.
--
Tye McQueen Nothing is obvious unless you are overlooking something
http://www.metronet.com/~tye/ (scripts, links, nothing fancy)
------------------------------
Date: Wed, 8 Apr 1998 09:51:33 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Koji Kiyokawa <TheSage@uk2.so-net.com>
Subject: Re: content of file handle
Message-Id: <Pine.GSO.3.96.980408094913.20192N-100000@user2.teleport.com>
On Wed, 8 Apr 1998, Koji Kiyokawa wrote:
> Does anyone know if there is a way to print where a file
> handle is pointing to?
There's no way in general to get that information. If you know you might
need it, though, you could save it when you open the file. Possibly an
array indexed by fileno() would be appropriate. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 08 Apr 1998 12:26:29 -0600
From: igor@everyware.com
Subject: Embedding: glue design suggestions needed
Message-Id: <6ggc04$efo$1@nnrp1.dejanews.com>
Hi, everybody!
I've got multiple Perl interpretors in MT app running happily.
The next step is to be able to communicate with the app language.
The language supports typeless scalars and 1-2 dimensional arrays.
I need to be able to:
my $scal = getValue('sc_name');
my $aref = getValue('ar_name');
and
setValue('sc_name', $scal);
setValue('ar_name, $aref);
There are a few design decisions to be made:
1) Should getValue/setValue belong to MyApp package or be
directly embedded in the core language? What are pros and
contras? [One of the requirements is that a user should not
be required to install Perl on his site: everything must be
in libperl.a which is statically linked with the app]
2) The arrays transferred through get/set may be =very= large.
Ideally, I would like to create a Perl reference to the array
and set up a callback which is called by Perl whenever this
reference is accessed. Is it a good idea? How feasible is the
implementation? Any pointers to how that may be implemented?
[I've got a few years of experience with Perl, but not with any
embedding issues]
3) How much of platform transparency I can achieve [UNIX/NT],
and what is the best way to achieve it? [Read: I'm a UNIX
die-hard and, consequently, NT ignoramus, nevertheless, I'll
have to make it work on both platforms to persuade the management
to include it into production code; now, how can I minimise my
NT-specific work?]
Please, cc your replies to igor@everyware.com.
Thanks,
-igor
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 8 Apr 1998 13:29:31 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Getting the subroutine name from within a sub
Message-Id: <6ggc5r$ruo$1@monet.op.net>
In article <352B6A33.247732B1@HealthPartners.com>,
Scott L. Erickson <Scott.L.Erickson@HealthPartners.com> wrote:
>Regarding writing a better Log subroutine, I am calling it from a
>library file and it logs more than just the activities of just my code,
>it also logs the activities of many other lines of code, so at this
>time, I am not inclined to tamper with it.
Then do
sub myLog {
my $caller = (caller(1))[3];
Log("$caller: ", @_);
}
and call myLog instead of calling Log directly.
------------------------------
Date: Wed, 8 Apr 1998 09:58:06 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: Venkatesh <venky@clam.com>
Subject: Re: HELP .. return true value
Message-Id: <Pine.GSO.3.96.980408095734.20192P-100000@user2.teleport.com>
On Wed, 8 Apr 1998, Venkatesh wrote:
> 'x.pl did not return a true value at y.pl line 5'
Did you see what perldiag has to say about this message? Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 08 Apr 1998 18:29:42 GMT
From: 6xtippet@CyberJunkie.com
Subject: Re: HELP .. return true value
Message-Id: <352bc37c.190162399@news.usaor.net>
On Wed, 08 Apr 1998 11:15:28 -0400, Venkatesh <venky@clam.com> wrote:
>hi,
>
> I have a function compute_method that does some calculation and
>returns a string $computed_list .
>This function resides in "x.pl" along with a list of supporting
>functions.
>When I try to do a
>
>require "x.pl" in another file y.pl, I get this error
>
>'x.pl did not return a true value at y.pl line 5'
>
>
>venky
venky,
The way "require" works it expects the included file to "return" a
true value.
If you add this:
1;
as the last line of x.pl it should work.
lee
------------------------------
Date: Wed, 08 Apr 1998 12:34:28 -0600
From: cmeena@hotmail.com
Subject: How to access a randomly created file for reading
Message-Id: <6ggcf5$f59$1@nnrp1.dejanews.com>
Hi all,
I posted the same questions few days ago. But I made an error. So Iam
re-posting the question again.
I am creating a file whose name is randomly generated. See the following code.
$link_up_file = "lup_";
$output_file = int(rand(time()));
$link_up_file .= $output_file;
The above lines create a file with names like lup_123, lup_1234 etc.
I was able to open that file and also write to it. See the following code.
open(LDOUT, ">>/tmp/$link_up_file") || die "could not write to $link_up_file
\n"
print LDOUT ("@linkup_list\n");
I know the file gets created and also I am able to see it in the /tmp
directory.
Now, I try to read the same file I created a while ago by doing
open(LDIN, "/tmp/$link_up_file") || die "could not open $link_up_file : $!\n";
@input = <LDIN>;
print @input;
I do not get any error. But @input is empty even though the file I am trying
to read from is not empty.
I am not sure why I am not able to read that file.
Any pointers would be appreciated.
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Wed, 08 Apr 1998 11:36:21 -0600
From: aixgod@ix.netcom.com
Subject: Overriding 'print'
Message-Id: <6gg926$anb$1@nnrp1.dejanews.com>
I tried to find the answer to this from the FAQ but the link pointed to for
overriding built-in Perl methods was broken, so I'm just going to punt and
ask for help here.
I want to jump in every time a print statement is executed, examine the
filehandle, and if it matches a certain one then I want to do something. For
example, I might want to cause things going to <STDOUT> to also be pushed
onto an array which I might later write out to a file (kinda sorta like
'tee', but not exactly).
I assume I need to somehow override print, do what I want to do, and then
still print out ... just not sure how to do it. Can someone point me to some
docs covering this?
Thanks!
Dylan
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Wed, 8 Apr 1998 11:54:55 +0100
From: Russell Schulz <Russell_Schulz@locutus.ofB.ORG>
Subject: Re: Perl code to generate MS Excel and Access files ?
Message-Id: <19980408.115455.2R1.rnr.w164w@locutus.ofB.ORG>
Michael Genovese <mikeg@slpma8.ed.ray.com> writes:
> I *could* write things out in a CSV file, but if there's a way to
> write out a barebone EXCEL and/or ACCESS file I'ld like to be able
> to do that.
the Excel file format is `Ugly with a capital Ug'.
if you use the SYLK format, you can specify formatting, named regions,
and other goodies, but it's still a simple text file that Excel will
open automatically.
for details, see:
http://www.wotsit.demon.co.uk/database/sylk.zip
documented in `sylksum.doc', which I can no longer find on
Microsoft's ftp site or web site, but is temporarily at
http://www.worldgate.ca/~rschulz/misc/sylksum.doc
and ftp://ftp.worldgate.ca/pub/rschulz/sylksum.doc .
simple awk code to parse a SYLK file is at
http://www.worldgate.ca/~rschulz/misc/parseslk.awk
and ftp://ftp.worldgate.ca/pub/rschulz/parseslk.awk .
--
Russell_Schulz@locutus.ofB.ORG Shad 86c
------------------------------
Date: 8 Apr 1998 17:49:43 GMT
From: "matthew d. p. k. lanier" <lanier@shell6.ba.best.com>
Subject: perl compilation under cygwin32
Message-Id: <6ggdbn$sj4$1@nntp1.ba.best.com>
hello all-
anyone out there have experience compiling perl 5.004_04 on NT4 using the
cygwin32 b19 libraries?
when 'make' gets to miniperl:, it fails, citing undefined references to the
following symbols in pp_sys.c:
getnetbyname, getnetbyaddr, netnetent, getprotoent, getservent, sethostent,
setnetent, setprotoent, setservent, endhostent, endnetent, endproroent,
endservent.
pp_sys.c includes netdb.h which defines those functions. i've tweeked with it,
and can't seem to figure out why it's failing on me.
any suggestions? i'm enthusiastic about getting this working under cygwin so
that i might use fork again...
thanks-
matt =)
matthew d. p. k. lanier / professional hugger and empath /
matt@lanier.org - i web, therefore i am /
matt@saturn5.com - i read too many mailing lists /
------------------------------
Date: Wed, 8 Apr 1998 09:56:41 -0700
From: Tom Phoenix <rootbeer@teleport.com>
To: William McKinnon <wmckinn@newbridge.com>
Subject: Re: Perl scripts not working with Netscape 3.0 on MacIntosh
Message-Id: <Pine.GSO.3.96.980408095249.20192O-100000@user2.teleport.com>
On Wed, 8 Apr 1998, William McKinnon wrote:
> Hi there, I've developed some perl scripts that run on a unix machine's
> web server, but when the scripts are accessed using Netscape 3.0 on a
> MacIntosh the scripts do not work (they work elsewhere). The scripts do
> work with Netscape 2.0 on the Mac and simple scripts do seem to work
> fine. Any suggestions on what may be causing the problems?
Netscape 3.0. :-)
If your scripts play by the rules and yet they don't work with one
browser, it's the browser's fault. If you're not following the rules, it's
your fault. If you're not sure what the proper protocol is, check the docs
for http, cgi, or html. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 08 Apr 1998 12:54:33 -0500
From: alecler@cam.org (Andre L.)
Subject: Re: Perl scripts not working with Netscape 3.0 on MacIntosh
Message-Id: <alecler-0804981254330001@dialup-739.hip.cam.org>
In article <352B9356.22F57A0C@newbridge.com>, William McKinnon
<wmckinn@newbridge.com> wrote:
> Hi there, I've developed some perl scripts that run on a unix machine's
> web server, but when the scripts are accessed using Netscape 3.0 on a
> MacIntosh the scripts do not work (they work elsewhere). The scripts do
> work with Netscape 2.0 on the Mac and simple scripts do seem to work
> fine. Any suggestions on what may be causing the problems?
>
> Bill
Hi,
It's hard to make suggestions based on such little information.
What is the script that doesn't work? And what do you mean by "doesn't work?"
Andre
------------------------------
Date: Wed, 08 Apr 1998 17:34:55 GMT
From: drummj@mail.mmc.org (Jeffrey R. Drumm)
Subject: Re: perl win 32 : asterisk on command line
Message-Id: <352bb365.607253013@news.mmc.org>
On 8 Apr 1998 14:37:17 GMT, "WS010" <WS010@dvvlap.be> wrote:
>Thank you, Mr Lambard.
>Your explanation certainly makes sense. It is odd though, that such
>assumption would be made, and be coded as an 'undocumented feature'.
>Who knows why this feature has been deliberately added to Perl for Win32?
>Maybe there is a way
>to disable this behavior? (got one: see previous answer).
>Jos Snellings <Jos.Snellings@1cd4u.com>
Remember that Perl's roots are in the Unix world; there, the command line is
_always_ interpreted first by the shell, and shell metacharacters such as ? and
* are expanded into matching file names by the shell before their expansions
are turned over to the script as arguments.
Perl is merely attempting to duplicate this behaviour in the somewhat
brain-addling environment of NT. :-)
It may be undocumented, but only because it's expected to be common knowledge.
--
Jeffrey R. Drumm, Systems Integration Specialist
Maine Medical Center - Medical Information Systems Group
drummj@mail.mmc.org
"Broken? Hell no! Uniquely implemented!" - me
------------------------------
Date: 8 Apr 1998 18:33:30 GMT
From: snow@biostat.washington.edu (Gregory Snow)
Subject: Re: perl win 32 : asterisk on command line
Message-Id: <6ggftq$1ch6$1@nntp6.u.washington.edu>
In article <01bd62fc$c434d7c0$8c7479c1@dvvbeint0ws010>,
WS010 <WS010@dvvlap.be> wrote:
>Thank you, Mr Lambard.
>Your explanation certainly makes sense. It is odd though, that such
>assumption would be made, and be coded as an 'undocumented feature'.
>Who knows why this feature has been deliberately added to Perl for Win32?
>Maybe there is a way
>to disable this behavior? (got one: see previous answer).
>Jos Snellings <Jos.Snellings@1cd4u.com>
I don't think that this is a feature of Perl, rather it is a feature
of the shell (win32 in your case, many unix shells do the same
thing). When you type the '*' on the command line windows expands it
to a list of file names before invoking Perl, Perl never sees the
'*'. Quoting it ("*") tells windows to leave it alone and Perl sees
the '*'.
The proccess is called globbing (see camel book pp. 55-57). In unix
you can do 'man glob' I don't know about win32, but it should tell you
somewhere that it is doing it. It is not documented in Perl because
Perl is not doing the globbing. You can't turn it off in Perl because
it has been done before Perl even starts.
Hope this helps.
--
-------------------------------------------------------------------------------
Gregory L. Snow | Any sufficiently advanced technology
(Greg) | is indistinguishable from magic.
snow@biostat.washington.edu | -- Arthur C. Clarke
------------------------------
Date: 8 Apr 1998 16:44:48 GMT
From: mjtg@cus.cam.ac.uk (M.J.T. Guy)
Subject: Re: Ping
Message-Id: <6gg9i0$8ee$1@lyra.csx.cam.ac.uk>
Peter Eisch <peisch@news.etude.com> wrote:
>I don't think the latest rollup includes the spiffy Ping, check out
>CPAN for the multi protocol version...
All Perl distributions since 5.004 have included icmp in Net::Ping.
Mike Guy
------------------------------
Date: Wed, 08 Apr 1998 17:40:34 GMT
From: dkw0@DELETE-THIS.cdc.gov (David Wall)
Subject: Re: print crypt($password,$Salt); not working
Message-Id: <6ggcqp$bsr1@cdc4.cdc.gov>
In article <6fg74h$g3c$1@svr-c-02.core.theplanet.net>, "Tony Kenny" <tony@cyberscape.net> wrote:
>The line:
>
>print crypt($Password,$Salt);
>
>works on one machine and returns nothing on another.
>
>The perl version is correct etc..
>
>Does anyone know why this might be?
Since you're using MS Outlook to post, I suspect you're running
Gurusamy Sarathy's port of Perl for Win32. When I try the following
one-liner, I get:
perl -e "print crypt('testing','te')"
The crypt() function is unimplemented due to excessive paranoia. at -e line
1.
Is the other machine using the Activestate port? crypt() works in the
Activestate port. I still like Sarathy's version better....
If that's not it, then I'm clueless. :-) (doubtless in other ways as well
<g>)
David Wall
(Address munged because of lack of decent filters in the crappy MS mail
client I'm forced to use here. Sorry if that bothers you, but spam
irritates me even more.)
------------------------------
Date: 8 Apr 1998 16:50:37 GMT
From: jbuck@synopsys.com (Joe Buck)
Subject: Re: RMS should be invited to O'Reilly's "Free Software Summit"
Message-Id: <6gg9st$9o3@hermes.synopsys.com>
>> > Mr. Tim O'Reilly said that RMS was not invited. I consider this is
>> > unfair to GNU.
>> Hmm. If RMS does not qualify, then maybe Bill Gates is invited
>> (because IE is a freeware).
ilya@math.ohio-state.edu (Ilya Zakharevich) writes:
>No it is not. You are mixing "free" and "free".
You clearly don't get it. The notion of having a free software summit
and not inviting RMS is nonsense. Hence the previous poster's comment
that O'Reilly might be confused as to what free software means.
Some have speculated that O'Reilly would not invite RMS because RMS
believes that the "source code" to published books (the LaTeX, SGML,
Word or Frame files) should be free in the GNU sense as well, thus
harming O'Reilly's business interests (though to be fair to O'Reilly,
they have published several books while allowing the authors to make
the "source" freely available, though most of their books are "proprietary").
Note that I do not agree with RMS's purist position that all software
should be free. But not to invite him undercuts the credibility of
the "summit". And the notion that some have, that RMS is such a
stubborn crank that his presence would prevent anything from being
done, is just wrong -- RMS has collaborated successfully over the
years with lots of people who do both free and commercial software.
You don't have to buy in to his world view to work with him.
--
-- Joe Buck
See my daughter: http://www.byoc.com/homepage/130481/molly.html
Boring semi-official web page:
http://www.synopsys.com/news/pubs/research/people/jbuck.html
------------------------------
Date: 8 Apr 1998 17:23:45 GMT
From: amehdiza@joule.ee.calpoly.edu (Ali Mehdizadeh)
Subject: scanf substitute in perl
Message-Id: <6ggbr1$m1m$1@isnews.csc.calpoly.edu>
Is there a direct substitue for C's scanf in perl?
Let's say I want to read in the number from the following line:
some text 123
in C I would do something like this:
scanf("%s %s %i", &string1, &string2, &num);
How would you do it in perl? these are thing that come to my mind:
($string1, $string2, $num) = split(/\s+/, $line);
or if I just want the number
$line =~ s/^[0-9]//g;
But this methods seem like a pain. Any betther methods?
-ali m.
--
-Ali M.
------------------------------
Date: Wed, 08 Apr 1998 10:26:33 -0500
From: Rui Guo <ruig@ece.nwu.edu>
Subject: SDBM error
Message-Id: <352B9729.41C67EA6@ece.nwu.edu>
I got an error when I run this following program:
#!/usr3/local/bin/perl5.00404
use POSIX; # needed for O_RDWR and O_CREAT
use SDBM_File; # Create an SDBM hash
tie(%hash, SDBM_File, 'movies-sdbm', O_RDWR | O_CREAT, 0666);
$hash{'The Seven Samurai'} = 1954;
$hash{'City Lights'} = 1931;
$hash{'The Third Man'} = 1949;
untie %hash; # not necessary, but good form
~
~
------------------------------
Date: Wed, 08 Apr 1998 11:07:52 -0600
From: Robert Goff <ragoff@sandia.gov>
Subject: Re: sending mail using perl
Message-Id: <352BAEE8.31C68FB7@sandia.gov>
> Remember that any open with a pipe causes a fork. The child
> process (in this case) dies with a "no such command"-type error,
> but the parent process forked OK, so the open succeeded, from
> the point of view of your program.
The way to check that the child process was actually spawned and run
(according to the docs) is to check the return value of close().
--
=================================================
Robert Goff email: ragoff@sandia.gov
Sandia National Labs Phone: (505)284-3639
------------------------------
Date: Wed, 08 Apr 1998 11:14:09 -0600
From: Robert Goff <ragoff@sandia.gov>
To: Aaron Propst <abp@holly.colostate.edu>
Subject: Re: sending mail using perl
Message-Id: <352BB061.6E750C64@sandia.gov>
> 1. The Reply-to address and the Subject show up in the message text.
You need to look up the manpage for the mail program you're calling
(which probably isn't the directory '/usr/mail/') and send the commands
appropriate to that program. Pretend that each print statement is a
command line entry -- if you were composing this message from the
command line, how would you specify Return-to and Subject?
> 2. The rest of the message body has no returns for separate lines.
As others have said, use "\n" at the end of your lines.
--
=================================================
Robert Goff email: ragoff@sandia.gov
Sandia National Labs Phone: (505)284-3639
------------------------------
Date: Wed, 8 Apr 1998 17:37:40 GMT
From: James A Squire 312 M 193884 <james.a.squire@boeing.com>
Subject: Strange "Modification of a read-only value attempted" error
Message-Id: <352BB5E4.CE2@boeing.com>
I'm using Perl 5.003 and have the following code snippet:
#!/usr/local/bin/perl -w
...
require 'abbrev.pl';
...
&process_arguments(@ARGV);
foreach $item (@names)
...
sub process_arguments
{
local($argx);
@names = ('ALICE' ,'BESS' ,'CATHY' ,'DOUG');
%arglist = ();
abbrev(*arglist,'name','sort','print');
while ($argx = shift)
{
if (substr($argx,0,1) eq '-') { $argx = substr($argx,1); }
if ($arg = $arglist{lc $argx})
{
if ($arg eq 'sort' )
{
...
}
elsif ($arg eq 'print' )
{
...
}
elsif ($arg eq 'name')
{
undef @names;
@names = ();
while ($name = uc shift)
{
if (substr($name,0,1) eq '-')
{
unshift @_,$name;
last;
}
push @names,$name; <----------
}
}
}
...
When I run this using:
myscript.pl -name ALICE BESS |& tee -a output.log (using tcsh)
I get the error message in the subject header, referencing the
line with the arrow above (the arrow's not part of the script,
of course).
Where am I trying to modify a read-only value???
When I stick "perl -d" on the front of the above command line and step
through it down to that point, I find that the first time through the
while loop (processing ALICE), the push statement works just fine and
@names contains ALICE. However, if I were to take "BESS" away from the
command line and try it again, then it will choke on "ALICE". It looks
like it is always going to choke only on the last "name" in the list.
Can anybody tell me what is going wrong here? I've "stumped the band"
so far among my workmates.
--
James Squire Send my Spam to mailto:webmaster@cyberpromo.com
MDA^H^H^HBoeing St. Louis http://www.boeing.com
------------------------------------------------------------------------
Hey Novell, is it too much to ask that when I log out of NetWare, it
should ACTUALLY record that I've logged out, so that it doesn't have to
scramble around the house laboriously when I try to log back in, forcing
me to ring the door bell 20 times??????
Opinions expressed here are my own and NOT my company's
------------------------------------------------------------------------
"We were talking the other day about how nobody's seen a Vorlon before
and he said that according to legend, one human did see a Vorlon...he
turned to stone."
-- Laurel Takeshima, "The Gathering"
------------------------------
Date: 8 Apr 1998 12:48:02 -0500
From: tye@fiinix.metronet.com (Tye McQueen)
Subject: Re: Tie/bless vs. bless/tie and segmentation fault
Message-Id: <6ggd8i$65t@fiinix.metronet.com>
lehman@visi.com (Todd Lehman) writes:
) Tye McQueen <tye@fohnix.metronet.com> writes:
) > Change that to
) >
) > untie %$self if tied(%$self);
) >
) > and the core dump disappears and the depth of your problem
) > becomes more apparent:
) >
) > untie attempted while 1 inner references still exist during global
) > destruction. Use of uninitialized value during global destruction.
) > ...
)
) One funny thing I noticed about
)
) untie %$self if tied(%$self);
)
) is that the "inner reference" to tied(%$self) seems to be retained
) throughout the entire lexical scope of the 'if' conditional -- that is,
) through and into the 'untie' call. The retention of the reference can be
) circumvented using a temporary boolean value:
)
) my $tied = !! tied %$self;
) untie %$self if $tied;
)
) and now it neither dumps core nor complains about 1 inner reference
) still existing. :-)
Very cool! I assumed the "deep problem" was in your code, but of
course it was in mine. :)
) > You need to remove the hard reference back to the first object
) > so that it will be destroyed when it goes out of scope. With
) > Perl 5.004, I don't immediately see a solution if you really
) > need the back reference. Perl 5.005 is rumored to support weak
) > references which might be appropriate here.
)
) When you say "first object" do you mean the original hard reference from the
) initial call to Foo::new? It seems to be happy without doing that, due to
) the temporary variable, I think. I need to read more about reference
) internals and garbage collection.
But the point about things not being destroyed when they go out
of scope is still valid. This means that none of the objects you
create will ever be destroyed until global destruction or the
module user goes to extra effort to break the circular reference
and/or destroy an object.
Since you didn't seem to have a real use yet for making
$inner->{OBJ} contain a reference to $outer (where $outer
eventually references $inner through tie, etc.), I thought
just removing the OBJ hash entry was the simplest solution.
In the future, you could make the OBJ hash entry a "weak"
reference (whatever that looks like in Perl5.005) whose existance
would not prevent $outer from being DESTROYed when it goes out of
scope.
In the mean time, another approach is to have an extra object
whose main function is to trigger destruction:
$user_obj ----> $inner_obj1 ----> $inner_obj2
^ |
| |
| V
$inner_obj4 <---- $inner_obj3
Then, when $user_obj goes out of scope, it will be DESTROYed and
its destructor must break the underlying circle so that all of the
inner objects get destroyed. It breaks the circle by removing one
of the references; for example, by making $inner_obj4 so that it
no longer references $inner_obj1.
Make sense?
--
Tye McQueen Nothing is obvious unless you are overlooking something
http://www.metronet.com/~tye/ (scripts, links, nothing fancy)
------------------------------
Date: Wed, 08 Apr 1998 18:38:08 GMT
From: dkw0@DELETE-THIS.cdc.gov (David Wall)
Subject: Re: Use of implicit split to @_ is deprecated
Message-Id: <6ggg6n$bsr2@cdc4.cdc.gov>
In article <6gb5qo$rfc@netline.jpl.nasa.gov>, psf@euclid.jpl.nasa.gov (Peter Scott) wrote:
>jgloudon@manitoba.bbn.com (Jason Gloudon) wrote:
>> If you want to count the number of elements returned by split you should say
>> $x = scalar(@junkarray = split), which says explicitly what you want and what
>> actually happens.
>
>True. But bad style if it could be avoided, which is what I thought was
>implied by the Camel. (Although $x = () split isn't as bad style.)
>
As a Perl novice, I would prefer "$x = scalar(@junkarray = split;" over
"$x = () = split;". The first one, as Jason says, explicitly tells you
what it's doing, but I have to stop and think to figure out what the second
one is doing. Maybe because I have a math & stat background; having that
empty set in the middle of the statement just seems weird. :-)
David Wall
------------------------------
Date: Wed, 08 Apr 1998 13:10:54 -0600
From: mpeppler@mbay.net
Subject: Re: Wanted: Amoo to stop my sysadmin from whining
Message-Id: <6ggejd$i5e$1@nnrp1.dejanews.com>
In article <Pine.GSO.3.95.980407133218.12330B-100000@cp.pathfinder.com>,
"Andrew F. Lee" <andrewf@cp.pathfinder.com> wrote:
>
>
> Also: What's new in SybPerl and CGI that I can beat my sysadmin over the
> head with?
Which version of sybperl are you running?
You can check out the CHANGES file at http://www.mbay.net/~mpeppler
as well as other docs on sybperl.
Michael
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
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 2276
**************************************