[8797] in Perl-Users-Digest
Perl-Users Digest, Issue: 2414 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Apr 24 16:07:21 1998
Date: Fri, 24 Apr 98 13:01:41 -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, 24 Apr 1998 Volume: 8 Number: 2414
Today's topics:
Re: PerlScript with PERL version 5.004??? (Bbirthisel)
reading a binary file (Alex Rentzis~)
Re: removing spaces <quentin@jihad.amd.com>
Re: Requiring "use" (was: Re: Using "require") (Earl Hood)
Re: Retreiving the args from a exec cmd call withing pe (I R A Aggie)
Re: RMS should be invited to O'Reilly's "Free Software (Ilya Zakharevich)
Re: RMS should be invited to O'Reilly's "Free Software (Ilya Zakharevich)
Re: RMS should be invited to O'Reilly's "Free Software <smubit1@gl.umbc.edu>
Servername to Domain - How? j.schmied@deutschepost.de
Re: Using module outside @INC without changing @INC <rootbeer@teleport.com>
Re: Win32 & Process listing <igor.k@usa.net>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 24 Apr 1998 18:11:11 GMT
From: bbirthisel@aol.com (Bbirthisel)
Subject: Re: PerlScript with PERL version 5.004???
Message-Id: <1998042418111100.OAA06715@ladder01.news.aol.com>
Hi Matt:
>BTW: I think someone on the activestate mailing list suggested it was
>possible to install both, but I'm not sure how feasible this is. You
>might try asking there.
I have installed both with no problems. The only tricky part is to avoid
intermingling the PATHs - much easier with something other than the
"default" shell - but possible even with that.
It is much harder to have two different AS ports - the registry variables
get in the way (GS doesn't use Registry for it's own ENV). When working
with the O'Reilly PRK beta, a better shell WAS essential. There are
ENV settings to override the registry - although the docs are a bit fuzzy.
Someone at AS indicated he just renamed his tree-tops to a single location
that matched the Registry.
Hopefully.....just history.....real soon, now.
-bill
------------------------------
Date: 24 Apr 1998 17:39:36 GMT
From: arentzis@hal031.ch.intel.com (Alex Rentzis~)
Subject: reading a binary file
Message-Id: <6hqioo$p514@chntsfs1.ch.intel.com>
I am reading in a binary file with code similar to the
example on pg 273 in the camel book. The example
reads in 16 bytes at a time. I am dealing with image
files that are >500k bytes and I would like to read the
whole file into an array and then process each byte but
code similar to this does not work:
while(read(STDIN,$data,$SIZE_OF_FILE)) {
@array = unpack('N*',$data);
}
I was hoping that @array would now contain the entire array.
Any help would be appreciated.
--
= Alex
------------------------------
Date: 24 Apr 1998 13:06:01 -0500
From: Quentin Fennessy <quentin@jihad.amd.com>
Subject: Re: removing spaces
Message-Id: <ximiunzdrhy.fsf@jihad.amd.com>
>>>>> "Inge" == Inge Soetens <soetensi@se.bel.alcatel.be> writes:
Inge> Hi, how can I remove all spaces from a line ?
AAAAAAHHHHHHH!!!!!
Get me moderation, and a drink!
--
Quentin Fennessy AMD, Austin Texas
Secret hacker rule #11 - hackers read manuals
------------------------------
Date: 24 Apr 1998 18:01:31 GMT
From: ehood@medusa.acs.uci.edu (Earl Hood)
Subject: Re: Requiring "use" (was: Re: Using "require")
Message-Id: <6hqk1r$i3q@news.service.uci.edu>
In article <3540B3F0.2F89@min.net>, John Porter <jdporter@min.net> wrote:
>Tom Phoenix wrote:
>>
>> The docs for require should explain this.
>
>The explanation of use documents that.
Not that I see. Actually, the explanation of require in perlfunc shows
how perl remembers what has been required. The sample subroutine that
shows the sematics of require. The two statements:
return 1 if $INC{$filename};
and,
$INC{$filename} = $realfilename;
imply that the %INC hash is used to remember what has been required.
BTW, %INC is mentioned in perlvar.
With that said, if you are using modules that import routines/vars,
"use" is sufficient. Although perl will not reparse the module source
if previously used, it will still call the import() routine.
--ewh
--
Earl Hood | University of California: Irvine
ehood@medusa.acs.uci.edu | Electronic Loiterer
http://www.oac.uci.edu/indiv/ehood/ | Dabbler of SGML/WWW/Perl/MIME
------------------------------
Date: Fri, 24 Apr 1998 14:10:53 -0500
From: fl_aggie@thepentagon.com (I R A Aggie)
Subject: Re: Retreiving the args from a exec cmd call withing perl program
Message-Id: <fl_aggie-2404981410540001@aggie.coaps.fsu.edu>
In article <3540C2F2.B1F65307@phoneswitch.com>, Richard Newman
<richard@phoneswitch.com> wrote:
+ Greetings,
+
+ The call within the html looks like:
+ <!--#exec cmd="/cgi-bin/test.shtml arg1 arg2 arg3" -->
+
+ How do I retrieve arg1 arg2 and arg3 within my perl program?
Perhaps you should look at @ARGV ?
James
--
Consulting Minister for Consultants, DNRC
The Bill of Rights is paid in Responsibilities - Jean McGuire
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/CPAN-local/doc/FAQs/cgi/idiots-guide.html>
------------------------------
Date: 24 Apr 1998 19:16:43 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: RMS should be invited to O'Reilly's "Free Software Summit"
Message-Id: <6hqoer$q7o$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Paul D. Smith
<psmith@baynetworks.com>],
who wrote in article <p5pvi7rtsq.fsf@baynetworks.com>:
> The FSF is quite well protected from this problem. And, should you
> think it's a non-issue, please be aware that this _has_ happened in the
> past, and it's not all that rare. I personally know of at least three
> instances in the last two years where someone released code under a free
> license, and their company retracted it, including all already-released
> versions.
Can some more info be disclosed?
Ilya
------------------------------
Date: 24 Apr 1998 19:18:36 GMT
From: ilya@math.ohio-state.edu (Ilya Zakharevich)
Subject: Re: RMS should be invited to O'Reilly's "Free Software Summit"
Message-Id: <6hqoic$qek$1@mathserv.mps.ohio-state.edu>
[A complimentary Cc of this posting was sent to Eugene O'Neil
<eugene@cs.umb.edu>],
who wrote in article <6hqc07$mb7@dfw-ixnews6.ix.netcom.com>:
> >Unfortunately, according to RMS's lawers, this is not *that* simple.
> >I do believe that he has some point in requiring transfer of copyright
> >to FSF. How this is logical I do not understand *exactly*, but I do
> >not want to ;-).
>
> What isn't true? That software released with a free license will always be
> free? That's basic copyright law: you can't arbitrarily revoke a license once
> you issue it.
You mean the copyright law covers licensing? I would think these two
beasts should be in different zoos...
Ilya
------------------------------
Date: Fri, 24 Apr 1998 15:33:08 -0400
From: Stephen Mubita <smubit1@gl.umbc.edu>
Subject: Re: RMS should be invited to O'Reilly's "Free Software Summit"
Message-Id: <Pine.SGI.3.96.980424153104.19855F-100000@jig.gl.umbc.edu>
I don't understand the GPL very well, but could someone explain these two
to me:
Why should all software necessarily be free ?
If software, then why not over services: note taking, gardening ? Why
shouldn't everything be free ?
(not that I think that everything should be free).
On 20 Apr 1998, Michael Funk wrote:
=> >Supposedly "free" licenses that allow commercial parasites to take
=> >without giving are unfairly slanting the playing field away from a
=> >free software society towards a commercial software society. It is
=> >not conducive to the goal of software being free.
=>
=> If this is your goal then you are correct, the GPL is the way to
=> go. But that is not the goal of a large chunk (perhaps even a
=> majority) of the free software community. This is the exact sort
=> of agenda-ridden propaganda that many GPL opponents are turned off
=> by. You have gone beyond simply presenting a free software license,
=> and pushed things into the realm of your (very peculiar to many)
=> worldview: namely that commercial software is somehow evil, and
=> that we all should be striving for some ideal world in which all
=> software is GPL'd. Admittedly the GPL itself isn't the source
=> of most of this, rather the GM, RMS' various writings, and other
=> works. But it's difficult to see the license itself outside of
=> the ideology that spawned it.
=>
=> Many people who might otherwise actually use the GPL are turned
=> off buy the fact that it carries with it such an odd ideological
=> burden. A lot of people also get turned off by the fact that in
=> so many grandiose pro-GPL statements (such as the one presented
=> above), there are implicit statements to the effect that there
=> are no other valid philosophies, and that there is no dissent
=> within the free software community WRT this matter, which is
=> simply not true. There are widely varying opinions as to what
=> the role of free software is within the industry, and why it
=> should continue to be developed, and why it's a good thing in
=> the first place. I think probably everyone here can agree that
=> free software is a good thing, but there are probably as many
=> different rationales for this as there are posters. It's amazing
=> how many FSF boosters don't ever seem to admit this, or even
=> acknowledge the fact that there might be multiple, equally valid
=> viewpoints.
=>
=> The zealout/purist attitude evidenced by much of the GPL advocates
=> is, IMO, just as intellectually dishonest and ultimately destructive
=> as fundamentalism in religion or extremism in politics. I'm sure
=> someone will follow up with a defense of fundamentalism and/or
=> political extremism, causing the needle on humanity's Cluemeter
=> to drop another notch. :(
=>
=> Free software performs many valuable functions, well beyond the
=> supposed goal of wiping out the supposedly "evil" world of commercial
=> software. Might I suggest:
=>
=> -to encourage more openness within the industry
=> -to allow projects which have no business value
=> but much intellectual value to get off the ground
=> -obvious educational value
=> -obvious value to hobbyists
=> -to "raise the bar" :) within the industry, forcing
=> commercial interests to set their standards for quality
=> higher if they wish to compete
=> -to counter the forces of darkness (i.e., pointy-haired
=> bosses) within the industry; free software gives ideas
=> with much techical merit that were rejected for political
=> reasons a second (or even first) chance
=> -to encourage innovation
=> -to encourage alternative approaches when some de facto
=> standard causes resentment (gtk vs. Motif)
=> -to fuel the cause of open development models (Netscape)
=> -to give people a means by which they can stand up and say
=> "To heck with Microsoft! We don't need you."
=>
=> In general, a force for cluefulness and technical excellence in
=> all areas of the industry, rather than something which seeks to
=> wipe out all other approaches, development models, or philosophies
=> regarding intellectual property.
=>
=> Some might argue that they use GPL for purely pragmatic reasons, and
=> don't buy into the whole worldview suggested by the purists. This
=> is actually not what I'm getting at here, and is a completely different
=> debate. I think one of the major reasons that these "GPL vs. the world"
=> discussions get so heated is that they reflect two completely different
=> debates. One debate has to do with, what's a good license under which
=> to release free software. On the surface that's what most of these
=> discussions focus on. The other debate can always be found lurking
=> under the surface, periodically rearing its much more controversial
=> head: what's the purpose of free software? Free software licenses
=> carry with them implicit answers to this question. Perhaps people
=> would be better off debating this matter openly, rather than beating
=> around the bush by discussing the legal niceties of the various
=> licenses.
=>
=> To reiterate: I'm talking about the motivations behind the licenses,
=> not the actual terms of them. Also, these discussions get carried
=> away (and live on, interminably) partially because they tend to dance
=> back and forth between pragmatic debates over legality and emotional
=> debates over ideology, without anyone really thinking to draw a line
=> between the two, or perhaps not even being aware of it.
=>
=> Mike
=>
=>
=>
--
Stephen Mubita "Continue to work out your salvation with fear and
smubit1@umbc.edu trembling, for it is God who works in you to will
and to act according to His good purpose."
Philippians 2 : 12b - 13
-----------------------------------------------------------------------
UCS is not responsible for any opinions contained here
------------------------------
Date: Fri, 24 Apr 1998 13:32:20 -0600
From: j.schmied@deutschepost.de
Subject: Servername to Domain - How?
Message-Id: <6hqlrk$uuq$1@nnrp1.dejanews.com>
How can I get the domain for a given server (PDC) name?
Thanks
Juergen
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: Fri, 24 Apr 1998 19:58:43 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Peter Scott <psf@euclid.jpl.nasa.gov>
Subject: Re: Using module outside @INC without changing @INC
Message-Id: <Pine.GSO.3.96.980424125247.5518p-100000@user2.teleport.com>
On 24 Apr 1998, Peter Scott wrote:
> I recently wanted to use a module whose path wasn't in @INC
> but without modifying @INC (because I don't want its path
> searched for later modules the caller might use - there is actually a
> good reason for this that has nothing to do with this post), and the
> only way I could think of was:
>
> BEGIN {
> unshift (@INC, '/path');
> use Foo;
> shift @INC;
> }
>
> but I was looking for a really concise idiom since others will use
> this module and I would prefer to publish just a one-liner.
It's easy to make one-liners in Perl if your screen is wide enough. :-)
{
my @saveinc;
BEGIN {
@saveinc = @INC;
}
use lib '/path';
use Foo;
BEGIN {
@INC = @saveinc;
}
}
This saves and restores @INC at compile time. Removing all of the newlines
is left as an exercise. :-)
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Fri, 24 Apr 1998 12:04:55 -0700
From: "Igor Krivokon" <igor.k@usa.net>
Subject: Re: Win32 & Process listing
Message-Id: <6hqnho$hm4$1@news.ncal.verio.com>
Gorm Haug Eriksen wrote in message ...
>
>hi,
>
>Someone know a way to list processes running on a Windows NT box?
>
>Seems like a pain in the a** according to the fact that this is not
>listed in any faqs I have seen, and not described in any Win32 docs I
>have looked at...?
>
Hmmm... Where have you looked?
Starting point to get help on any Win32/NT/Win95 question:
1) go to www.microsoft.com
2) press "search" button
3) input your keywords
4) read the articles found (if they are in "premium context", you have to
register
first, but it's free)
ok, I'll try to do it now...
say, "list processes running" and "all words" search option...
well, here you go:
EnumProcesses function from PSAPI library does the job, see
http://premium.microsoft.com/msdn/library/sdkdoc/pdwbase/winnt/psapi_9cmr.htm
...and a lot of other refernces
Another way to do it is to use windows registry. This is a standard approach.
And, hopefully, one can do it with Win32::Registry perl module.
Two days ago I've posted here the following:
: Win32 SDK has an example named pviewer - it does local and remote
: processes and threads monitoring, priority change etc.
: (I think, you can download it freely from Microsoft's MSDN site)
: I don't remember all the details, but it seems to me,
: you can get all this information from registry.
: So, I would recomend that you check
: 1) Any books on Windows registry (see HKEY_PERFORMANCE_DATA)
: 2) Win32::Registry perl module
And yes, one more way, especially if you like `ps` approach
(and you have NT Resource Kit installed):
Use `tlist` command to list local processes
or `pulist` to list local or remote processes.
Hope this helps,
---
Igor Krivokon, Ph.D. phone: (408) 432-1110/348
Metra Corporation, fax: (408) 432-9644
2205A Fortune Dr, San Jose, CA 95131 email: igor@metra.com
------------------------------
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 2414
**************************************