[8986] in Perl-Users-Digest
Perl-Users Digest, Issue: 2604 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 14 23:10:54 1998
Date: Thu, 14 May 98 20:00:58 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 14 May 1998 Volume: 8 Number: 2604
Today's topics:
Re: Array question (Tad McClellan)
Re: Calling perl subroutine from c program (Martien Verbruggen)
Can a FILEHANDLE be passed to flock() with an expressio (Leonard Miller)
Re: Can a FILEHANDLE be passed to flock() with an expre <tchrist@mox.perl.com>
Re: clp.moderated (Mark-Jason Dominus)
Re: Does Perl have a IDE?I don't like command line. <ebohlman@netcom.com>
Re: Does Perl have a IDE?I don't like command line. <tchrist@mox.perl.com>
Re: Does Perl have a IDE?I don't like command line. <tchrist@mox.perl.com>
Re: Does Perl have a IDE?I don't like command line. fsg@ultranet.com
Re: Does Perl have a IDE?I don't like command line. fsg@ultranet.com
Re: Does Perl have a IDE?I don't like command line. fsg@ultranet.com
Re: Does Perl have a IDE?I don't like command line. fsg@ultranet.com
Re: Does Perl have a IDE?I don't like command line. fsg@ultranet.com
Re: Does Perl have a IDE?I don't like command line. <tchrist@mox.perl.com>
Re: Does Perl have a IDE?I don't like command line. fsg@ultranet.com
Re: Does Perl have a IDE?I don't like command line. <tchrist@mox.perl.com>
Re: Grieving our dying community <dformosa@st.nepean.uws.edu.au>
Re: HELP: Need Perl for Macintosh (Martien Verbruggen)
Re: HELP: Need Perl for Macintosh (Bruce M. Turner)
Re: How to open a terminal (xterm) with Perl (Jim Levie)
Re: Perl script for Home Page? (Martien Verbruggen)
Re: reading file into an array of hash (Martien Verbruggen)
Removing ^M at the end of each line of a file. <pernande@dev.amadeus.net>
Re: Running Perl on Windows genfil@my-dejanews.com
Re: Startup overhead (Martien Verbruggen)
Timeout a program in Perl (KLL)
Re: while, each & assoc array (Martien Verbruggen)
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 14 May 1998 15:41:14 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Array question
Message-Id: <atkfj6.18e.ln@localhost>
Stylin (stylinsty@yahoo.comJAVA) wrote:
: Im a PERL newbie so if there is a better newsgroup for newbies let me
: know.
: The length of an array seems to be given by '@arrayname' as well as
: '$#arrayname'
Nope.
@arrayname *in a scalar context* gives the number of elements
in the array.
$#arrayname gives the subscript of the last element.
$#arrayname == @arrayname - 1
^^^
^^^
... unless you have changed the $[ special variable (which defaults to zero).
: My book explains that '$#arrayname' gives you the length
Your book is wrong.
Trust the docs that are installed on your HD (the ones that are included
with the perl distribution) before any book.
Those docs are updated at each new release.
Books are updated every few years, or not at all...
: Is there a better time to use either?
Use one when you want the number of elements and the other when you
want the last subscript ;-)
: I need to count the occurances of strings in a variable that changes in
^^^^^^^^^^
Bad English there. Hope you don't get any robot email messages about it...
:-)
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 15 May 1998 02:14:50 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Calling perl subroutine from c program
Message-Id: <6jg8eq$lug$3@comdyn.comdyn.com.au>
[Changed Newsgroups]
In article <6jf4df$gd0$1@nnrp1.dejanews.com>,
sonigopi@hotmail.com writes:
> I am trying to call a perl subroutine from perl package but have no
> idea how to go about it. I need to pass 2 parameters to perl subroutine
> which in turn returns integer back to c. Are there any headers I need to
> include in c program. Any Help would be greatly appreciated.
# perldoc perlembed
Martien
--
Martien Verbruggen | My friend has a baby. I'm writing down
Webmaster www.tradingpost.com.au | all the noises the baby makes so later
Commercial Dynamics Pty. Ltd. | I can ask him what he meant - Steven
NSW, Australia | Wright
------------------------------
Date: Thu, 14 May 1998 19:04:57 -0700
From: millers3@sonic.net (Leonard Miller)
Subject: Can a FILEHANDLE be passed to flock() with an expression?
Message-Id: <millers3-1405981904570001@d214.pm6.sonic.net>
Can a FILEHANDLE be passed to a flock() functions with an expression like this?
use Fcntl qw(:flock);
open(FILE,">>$somefile");
lock_write(FILE);
sub lock_write {
my ($fhandle) = @_;
flock($fhandle,LOCK_EX);
seek($fhandle,0,2);
}
Seek works on filehandles and the docs say they can be passed as
expressions but this is not mentioned under flock() ???
------------------------------
Date: 15 May 1998 02:15:00 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Can a FILEHANDLE be passed to flock() with an expression?
Message-Id: <6jg8f4$e3h$4@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
millers3@sonic.net (Leonard Miller) writes:
:Can a FILEHANDLE be passed to a flock() functions with an expression like this?
Did you try?
--tom
--
BTL didn't really have a distribution policy in the early days,
you got a disk with a note: Here's your rk05, Love Dennis. If UNIX
crapped on your rk05, you'd write to Dennis for another.
--Andy Tannenbaum, "Politics of UNIX," Washington, DC USENIX Conference, 1984
------------------------------
Date: 14 May 1998 22:56:48 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: clp.moderated
Message-Id: <6jgatg$qqd$1@monet.op.net>
Keywords: carbine empiric Transite wardrobe
In article <6jfpff$kpg$8@info.uah.edu>, Greg Bacon <gbacon@cs.uah.edu> wrote:
>In article <355B3B96.FC8E9E51@fccjmail.fccj.org>,
>: Status?
>
>I'm told by a reliable source that it still awaits a very important
>endorsement. Until then, we can only wait with delicious anticipation.
Yeah. To embellish a little: I'm ready to post a new charter for
discussion, but I want to make sure it's OK with Larry first. I've
asked Larry to look at it. Larry's really busy.
That's the status.
------------------------------
Date: Thu, 14 May 1998 23:59:20 GMT
From: Eric Bohlman <ebohlman@netcom.com>
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <ebohlmanEsz1Ax.ECH@netcom.com>
Chip Salzenberg <chip@mail.atlantic.net> wrote:
: According to fsg@gallo.ultranet.com:
: >Perl is a great language for nonprogrammers and programmers alike.
: Nonprogrammers can't use Perl, because Perl is a programming language.
: What you said makes no sense. So what did you _mean_?
A form of this argument frequently arises and leads to flame wars. The
problem is that "programmer" means different things to different people.
You're using "programmer" to mean a person who understands how to engage
in a certain activity, namely writing programs." fsg is apparently using
it to mean a person whose principal source of income is writing programs.
Perl is certainly in wide use by people whose primary job duty isn't the
creation of programs, which is what fsg would call "nonprogrammers." But
those people are, of course, "programmers" in your sense.
------------------------------
Date: 15 May 1998 00:02:35 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jg0mr$5q8$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
gebis@albrecht.ecn.purdue.edu (Michael J Gebis) writes:
:I'm having trouble why I caught such flak from you previously, and how
:a GUI popup is all that different than:
You asked what to do. I said make something the GUI-brainscrewed
can cope with. I don't like the idea, but so it goes. GUIs
cause brain damage. I'm not advocating a full CASE tool.
We already have those.
--tom
--
You are the sponsor for the account andrew (Andrew Hume).
------------------------------
Date: 15 May 1998 00:38:47 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jg2qn$9a9$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
gebis@albrecht.ecn.purdue.edu (Michael J Gebis) writes:
:A very wise person once wrote:
I hate DejaGnus, but it's nice to have an inimitable style. :-)
Nonetheless: a casual program is not a nonprogrammer.
--tom
--
Fungus doesn't take a vacation. --Rob Pike
------------------------------
Date: 14 May 1998 21:13:49 -0400
From: fsg@ultranet.com
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jg4sd$ke$1@ultranet.com>
chip@mail.atlantic.net (Chip Salzenberg) writes:
>According to fsg@gallo.ultranet.com:
>>mwmaurer@mtu.edu (Mark Maurer) writes:
>>>A LOT of people flat out do not use [wizards].
>>
>>I haven't met a programmer yet who doesn't use them whenever available.
>(Chip raises his hand)
Just in case you weren't the one that did the edit, the original
article read 'modules'. Which are the same kind of thing as wizards,
to be sure, but it strikes me as unlikely that you've never used them.
------------------------------
Date: 14 May 1998 21:09:30 -0400
From: fsg@ultranet.com
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jg4ka$j6$1@ultranet.com>
mwmaurer@mtu.edu (Mark Maurer) writes:
>fsg@gallo.ultranet.com wrote:
>: How about regular expressions? Dumbed down state machines (you can't
>: even get at the internal state nodes). How about the <> operator? Dumbed
>: down file operation -- you can't get at the inode directly.
>Regular expressions are considered dumbing-down? Hardly.
I don't know about you, but I would rather drown myself than try to do
by hand the things the regular expression engine does. I invite you
to go read the code and determine for yourself whether it's making
things ridiculously more easy for you or not.
>: If you're claiming that's because they're clinging to a frontier concept of
>: programming and don't want to be namby pamby, I would have to disagree.
>: I haven't met a programmer yet who doesn't use them whenever available.
>You have now... ;)
So you've never used CGI.pm, MakeMaker.pm, or IO.pm? Or even socket.pl?
Answer honestly.
>: Despite the name, there is nothing 'magical'
>: about a 'wizard' under win32. 'Wizards' just perform a certain templated
>: function with a pretty interface on front. The thing that's probably
>: closest to 'Wizards' in Perl is makemaker, the tool that lets you type
>: 'perl Makefile.PL; make; make install' for all of the Perl modules on CPAN.
>IMO, wizards DO dumb-down programming. To many people are just a couple of
>mouse clicks away from creating something, and saying that they "programmed"
>it, when in reality they couldn't create hello world in said language if
>given a text editor and a compiler.
So?
> You and I and many others may know that
>there is nothing magical about wizards, but there are too many people out
>there that they are magical. All IMO, of course...
I'm confused. Is this about the fact that their opinion of themselves
becomes too high?
Not only is there nothing magical about wizards, but there's nothing
magical about being a programmer, either. Even if they're misrepresenting
themselves as programmers, surely there's no harm done to anyone else.
Is it that they shouldn't be permitted to even think of joining the club?
Felix
------------------------------
Date: 14 May 1998 21:18:30 -0400
From: fsg@ultranet.com
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jg557$lb$1@ultranet.com>
chip@mail.atlantic.net (Chip Salzenberg) writes:
>According to fsg@gallo.ultranet.com:
>>Perl is a great language for nonprogrammers and programmers alike.
>Nonprogrammers can't use Perl, because Perl is a programming language.
>What you said makes no sense. So what did you _mean_?
I'm trying valiantly to use the definitions set out by the anti-win32
crowd, in which the 'programmers' (Tom, etc.) and the 'other people'
(win32 people who ask stupid questions, etc.) are very clearly
delineated and set apart. But you're right -- there really is no
distinction. Which is what I _mean_.
------------------------------
Date: 14 May 1998 21:36:04 -0400
From: fsg@ultranet.com
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jg664$ma$1@ultranet.com>
gbacon@cs.uah.edu (Greg Bacon) writes:
>fsg@gallo.ultranet.com writes:
>: gbacon@cs.uah.edu (Greg Bacon) writes:
>: > [...]
>: >You're putting words in my mouth. IDEs are crutches. IDEs are evil
>: >implements for locking users into a specific software line from a
>: >specific vendor. [...]
>:
>: You're confusing objective reality with that-which-you-believe. This
>: is pretty common in smart CS college students.
>:
>: IDEs are tools that perform a certain function. They have no inbuilt
>: intent. Many people's needs are completely filled by IDEs. The fact
>: that this frustrates and angers and disappoints you is in no way contrary
>: to that reality.
>You're confusing Platonic forms with our imperfect reality. This is
>pretty common among people who need a platform from which to hurl
>insults at CS college students.
I need a platform? But no, I'm not confusing 'Platonic forms' with
our imperfect reality. In our imperfect reality, IDEs really are tools
that perform a certain function; and many people's needs really are
completely filled by them. Surprising as it may be to you, a whole lot
of people are happy writing forms programs in Access.
> In an ideal world, IDEs would be there
>strictly as an aid for software development and programmers would be
>able to use one IDE as easily as the next. Surely your position is not
>that Microsoft, Borland, etc. do not wish to capture a user base with
>their very different implementations.
No, my position is that IDEs are fine. Whenever I write code on a Windows
platform, I very happily submit to the 'capture' of the Borland IDE, because
it's _excellent_, and it helps me do what I want. In a perfectly idealistic
world where I had an infinite amount of time and the stomach to deal with
the Windows API directly, I would possibly not use an IDE. However, I've
got a limited time left on Earth, and I'd much rather walk on a beach hand
in hand with my sweetheart than feel at true peace about the motives of my
tool provider company.
>: >I certainly don't. However, who am I to tell anyone how they should
>: >invest their time and talents?
>:
>: It's ironic that you ask that question after filling up the newsgroup
>: with endless posts about how IDEs suck, lose32 users suck, and so on.
>The concept of an IDE is nice if you're into buttons and mouse pointing
>and lots of windows. Two xterms are nice if you're not.
The concept of an IDE is nice for reasons other than buttons and mouse
pointing and lots of windows; but you know this. By the way, how do you
start those xterms without buttons, windows, or mouse pointers?
> I never said
>that each and every user of a non-Unix platform sucks either. If you
>inferred this from my words, perhaps you should seek help for your
>self-deprecation problem.
I didn't need to infer; you said it explicitly. Go back and read your
posts. They were not just excessively insulting, but obviously and openly
so.
>: I suppose I shouldn't make fun of you, but honestly, you're right --
>: you really aren't qualified to tell people how they invest their time
>: and talents,
>Why must you repeat what I've already said? You seem to have an idea
>who does possess such qualifications, [...]
Now that's a mistaken inference.
>: and you really ought to stop embarrassing Perl by simultaneously
>: holding yourself out as a spokesman for Perl and denigrating the largest
>: segment of its userbase.
>My legs are important to me. However, if I develop, say, malignant skin
>cancer in a leg, I would find it necessary to subject that leg to
>unpleasant treatments. Without those unpleasant treatments, I may have
>to cut the leg off altogether for fear of damage to the rest of my body.
Nobody screaming and whining piteously at the horrors of win32 people
asking questions in comp.lang.perl.misc has yet managed to explain how
win32 people are, for instance, like a horrific malignant cancer. No,
I don't like win32 either; and a lot of win32 zealots I've met are twits,
so we're in some senses on the same side. But unless you can explain how
win32 people asking questions in comp.lang.perl.misc will cause the downfall
of Perl, I'm afraid you're just being unpleasantly religious. I've thought
about it a lot (having briefly been annoyed by the deluge myself), and still
think it's great that so many people are trying, however benightedly, to
learn Perl. What's your thought?
>Since you are now our moral and spiritual leader,
I don't believe I've ever made any claims about what Perl is "really about",
so I'm not worthy of the honor, thanks.
> please tell us how we
>are to resolve the problem of the huge band of Win32 Marauders ruining
>our potluck dinner?
1. Use Perl. Tom has demonstrated a kill file that works for him;
I'm sure a kill file plus Perl would work for you, too.
>As far as being Perl's spokesman, we both know fully well that I could
>never claim such a title. I can speak for myself, however, and say that
>I've long admired your work and vision, especially with respect to Perl.
Thank you!
>However, ask any regular participant here whether I'm being
>unreasonable. I seriously doubt that they'll side with you.
Mmmm; I bet a few would. But it doesn't matter if they do or not. One
can be unreasonable in a vacuum, and your earlier rants about win32
were deeply, violently ridiculous.
That said, this post was a lot better; thanks for toning down the screed.
Felix
------------------------------
Date: 14 May 1998 21:45:11 -0400
From: fsg@ultranet.com
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jg6n7$nq$1@ultranet.com>
gbacon@cs.uah.edu (Greg Bacon) writes:
>fsg@gallo.ultranet.com writes:
>: False. Perl is a great language for nonprogrammers and programmers
>: alike. Like any language, it has features for both ease of use and
>: hardcore coding. The fact that it's implemented both ends of the
>: equation so well at the same time is what's tripping you up.
>If Perl is so great for nonprogrammers, why are so many nonprogrammers
>inundating our newsgroup with FAQs and other questions that are answered
>trivially with perhaps ten seconds of investigation on one's own?
Because they want to use Perl, but don't know the standard forms
of investigation.
>: For someone who screams so loudly, obnoxiously, and vituperatively
>: about how great it is to know Perl and how much it sucks to be just
>: another stupid user, you sure do seem to be reading a lot of news
>: articles that raise your blood pressure. Masochism, stupidity,
>: or rank hypocrisy?
>None of the above. I haven't yet found the software that can read the
>articles beforehand to let me know which ones I ought to ignore
>altogether. If you have code that can process natural language, please
>share it with us.
Oddly, Tom seems to be happy with his killfile; he's even shared it with
the group on a number of occasions, claiming that it works for him. So
if a killfile can work, imagine what Perl could do. Try it.
>: 1. Perl is designed as a glue language to help people. It's a positivist
>: thing that makes everyone's work easier. It is not designed as a negative
>: thing that fights against people. Part of the community of Perl involves
>: giving selflessly.
>How am I missing this point? I've never claimed that any of these are
>not the case or that any of these shouldn't be the case. Please provide
>examples if you disagree.
Your comment about clueless droves of win32 people who, it is made clear,
will never be welcome, was not exactly a positive comment.
>: 2. You're posting your ranting diatribe to millions of people, most of
>: whom will likely think that you are an egotistical prat who has great
>: difficulty putting together coherent, logical thoughts. It would be much
>: better for all concerned if, when you became angry at the thought of
>: other people learning how to program by using a helpful tool, you simply
>: went home and punched a pillow, or talked it over with a friend.
>I don't have any problem whatsoever with anyone learning to program. If
>anything, this world needs all the clueful programmers it can get.
>However, no one can become a programmer overnight, and it is that
>attitude which I resist. If this lacks logic and coherence, please
>demonstrate otherwise, and I will instantly cease my ranting.
No, you're being more logical now -- which is very welcome.
I don't think that the win32 people asking questions are saying that
they will become programmers overnight. I think they're attempting to
become programmers, the best way they know how.
Are you sure you have nothing to contribute to the problem?
Felix
------------------------------
Date: 15 May 1998 01:49:13 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jg6up$e3h$1@csnews.cs.colorado.edu>
In comp.lang.perl.misc, fsg@ultranet.com writes:
:Whenever I write code on a Windows platform
All becomes clear: Felix has been lured by the Bill Side
of the Force. Time to call mind-control police.
--tom
--
You are the sponsor for the account andrew (Andrew Hume).
------------------------------
Date: 14 May 1998 21:50:24 -0400
From: fsg@ultranet.com
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jg710$oo$1@ultranet.com>
Tom Christiansen <tchrist@mox.perl.com> writes:
>Is it just me, or are things starting to smell distinctly
>ad hominem at Felix's keyboard?
ad hominem has its places. In this particular instance, it appears
to have shocked Greg into responding in a logical, thoughtful fashion,
which I think is good for everyone.
Your continual attacks on win32 people have, however, no purpose
except to alienate people and make them think that the Perl community
is being at least partially represented by a raving religious nut.
>:It would certainly be helpful for Perl-as-a-community
>Speaking of being helpful for Perl-as-a-community,
>how's Penguin coming along?
Poorly. Want to help? I bet you could use some of that foaming-at-the-
mouth time you seem to constantly schedule to good use.
Felix
------------------------------
Date: 15 May 1998 01:57:22 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jg7e2$e3h$2@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, fsg@ultranet.com writes:
:But unless you can explain how
:win32 people asking questions in comp.lang.perl.misc will cause the downfall
:of Perl, I'm afraid you're just being unpleasantly religious.
It's trivial: They flood the group with useless questions that they are
too lazy to lift a finger for themselves. They don't look up the docs
even though these are included on their very systems. The problem is that
these people do not come from a can-do, do-it-yourself, tinker-and-play,
reseach-is-educational background. They aren't used to online docs that
they didn't have to pay the Great Taxman Who in Redmond Abideth for.
They think that USENET somehow owes them something, that it's around to
read them bedtime stories from the manpages. They are used to asking a
wizard (that's hacker wizards, not MSFMH-corrupted jargon) to do their
reseach for them, and for free, no less.
And the wizards are tired of it. Damned tired.
--tom "blessed are those that read" christiansen
--
/* now make a new head in the exact same spot */
--Larry Wall in cons.c from the perl source code
------------------------------
Date: 14 May 1998 23:21:44 GMT
From: ? the platypus {aka David Formosa} <dformosa@st.nepean.uws.edu.au>
Subject: Re: Grieving our dying community
Message-Id: <895188104.503204@cabal>
In <6jesls$j9f$1@csnews.cs.colorado.edu> Tom Christiansen <tchrist@mox.perl.com> writes:
[...]
>The clueless flock always to the .wizards groups, never the .neophytes group.
Then the soultion is simple, all the clued simply have to hang about the
.neophytes group.
--
I'm a perl programer; if you need perl programing, hire me.
Please excuse my spelling as I suffer from agraphia; see the url. Support NoCeM
http://www.cit.nepean.uws.edu.au/~dformosa/Spelling.html http://www.cm.org/
I'm sorry but I just don't consider 'because its yucky' a convincing argument
------------------------------
Date: 15 May 1998 02:18:11 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: HELP: Need Perl for Macintosh
Message-Id: <6jg8l3$lug$4@comdyn.comdyn.com.au>
In article <takashi-1405982351060001@195.11.251.156>,
takashi@dds.nl (Baseman) writes:
> Does anyone know where I can get Perl for the Mac? If its possible the
> latest version.
MacPerl home page
http://www.iis.ee.ethz.ch/~neeri/macintosh/perl.html
> Please email me at
> takashi@dds.nl
nope. Post here, read here.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au |
Commercial Dynamics Pty. Ltd. | Curiouser and curiouser, said Alice.
NSW, Australia |
------------------------------
Date: Thu, 14 May 1998 22:31:37 -0400
From: bmturner@ct1.nai.net (Bruce M. Turner)
Subject: Re: HELP: Need Perl for Macintosh
Message-Id: <bmturner-ya02408000R1405982231370001@news.nai.net>
>
>>Does anyone know where I can get Perl for the Mac? If its possible the
>>latest version.
>
Try Prime Time Freeware
www.ptf.com
Bruce Turner
------------------------------
Date: Fri, 15 May 1998 00:30:38 GMT
From: Jim.Levie@dynetics.com (Jim Levie)
Subject: Re: How to open a terminal (xterm) with Perl
Message-Id: <355c8c27.2699929@newstoo.hiwaay.net>
On 14 May 1998 22:44:36 GMT, "William Tang" <wtang@flash.net> wrote:
>I have a problem using Perl 5.004_04:
>I tried to run the Perl script, some time I need to open a xterm terminal
>(communication terminal with RS232) as child process and grap all the info
>from the terminal to load into a file and close the terminal. (The file
>will be used later). I tried to use the lib function:
>IPC::Open2 to open a child process and get the PID back. The function I
>call is:
>$pid = opens($RDR, $WTR, 'xterm -e tip -19200 /dev/ttya > filename');
>I can't store the file correctly. Can someone help me on this. I can be
>reached at:
>wtang@flash.net
>
I think you'd find it a bit easier to do by letting perl execute an
expect script that just spawns tip with output redirected into a file.
------------------------------
Date: 15 May 1998 02:10:07 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Perl script for Home Page?
Message-Id: <6jg85v$lug$1@comdyn.comdyn.com.au>
In article <355b37d3.0@news4.his.com>,
"Matt Durham" <matt@eagleweb.net> writes:
> Is it possible to launch a perl script instead of the standard default.htm
> in Microsoft IIS 3? If so I would like to know the procedures and or syntax
> to do this.
If it is, it has nothing to do with perl at all, but with the
configuration of your web server. You should ask questions regarding
your web server on the appropriate newsgroup, or consult the
documentation of the web server.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Advertising: The science of arresting
Commercial Dynamics Pty. Ltd. | the human intelligence long enough to
NSW, Australia | get money from it.
------------------------------
Date: 14 May 1998 23:49:54 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: reading file into an array of hash
Message-Id: <6jfvv2$l61$1@comdyn.comdyn.com.au>
In article <6jenua$ej4$1@nntp2.ba.best.com>,
"Xah" <xah@best.com> writes:
> Ooops. Actually I got the answer myself, easier than I thougt. Here's the
> solution (attached below) that's fairly good. All nit-picking comments
> welcom.
Since you ask :)
They're all stylistic remarks.. Do you come from a C programming
background?
> my($filePath) = '/somedir/tempRawData.txt';
You don't need the () around the variable here :)
> if (not(open(FILE,"<$filePath"))) {die "Cannot open file: $!;"};
A way that is more common in perl is
open(FILE, $filePath) || die "Cannot open file $filePath for reading: $!";
> @array1 = <FILE>;
> if (not(close(FILE))) {die "Cannot close file: $!;"};
close(FILE) || die "Cannot close file: $!";
> my($i);
> foreach ($i = 0; $i <= $#array1; $i++) {
foreach and for are in perl basically the same thing. Stylistically
though, you will normally see 'for' used for these construction, and
'foreach' in the way that you use it on @lines, later on .
In perl 5.004 you can write this the following way, since you only need
$i in scope inside the for block:
for (my $i = 0; $i <= $#array1; $i++)
> my(@lines) = split('\n',$textBlock);
Since the first argument to split is always interpreted as a regular
expression, it might be a good idea to get in the habit of making that
clear in your code by using // or something like that. It just avoids
confusion later on when you have special characters in that first
argument. Just a little reminder for yourself :)
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Very funny Scotty, now beam down my
Commercial Dynamics Pty. Ltd. | clothes.
NSW, Australia |
------------------------------
Date: Tue, 12 May 1998 17:40:44 +0200
From: "N6006024" <pernande@dev.amadeus.net>
Subject: Removing ^M at the end of each line of a file.
Message-Id: <6j9jhi$plt$1@inn.imcn.com>
After having saved a perl script with Homesite 3.0, when I open the script
using vi I can see that each line is ended by a ^M. Consequently, I made a
perl script to remove ^M.
My code looks like this :
open (FILE, ">$ARGV[0]") || die "Cannot open $ARGV[0] : $!";
while (<FILE>) {
s/\^M//g;
print <FILE> $_;
}
close(FILE) || die $!;
Thanks in advance for your help,
Philippe.
------------------------------
Date: Fri, 15 May 1998 02:42:03 GMT
From: genfil@my-dejanews.com
Subject: Re: Running Perl on Windows
Message-Id: <6jga1r$8jq$1@nnrp1.dejanews.com>
Thank you Steven,
I know how to associate file in Win95. Is it the same with NT?
Genfil Villahermosa
In article <355eab87.2530398@news.demon.co.uk>,
steven@amber.co.uk (Steven Wayne) wrote:
>
> genfil@my-dejanews.com wrote:
>
> >I need help!
> >I write perl scripts on unix and now I have to write scripts on NT and
> >Win95.
> >Is there an equivalent of "#!/usr/bin/perl" on NT and Win95?
> >Thank you!
>
> You can use:
>
> #!/perl/bin -w
>
> etc to put any command line switches in, but this won't cause the program
> to run as it does in Unix. To do this you will have to associate the .pl
> extension with c:\perl\bin\perl.exe and name your perl scripts xxx.pl
>
> Do you know how to do this?
>
> Steven.
>
> --
> We pray for one last landing, on the globe that gave us birth,
> To rest our eyes on fleecy skies, and the cool green hills of Earth.
> -- R.A. Heinlein
> http://www.ambercomputing.demon.co.uk/
>
-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/ Now offering spam-free web-based newsreading
------------------------------
Date: 15 May 1998 02:12:46 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Startup overhead
Message-Id: <6jg8au$lug$2@comdyn.comdyn.com.au>
In article <6jf487$gbk$1@nnrp1.dejanews.com>,
kathryn.nelson@usa.net writes:
> My question is: are there any other things I can do to reduce this further?
> Most code optimizations I've tried reduces the cpu time a tenth of a second
> or two but startup remains lengthy.
# perldoc perlfaq3
/How can I make my CGI script more efficient?
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | A Freudian slip is when you say one
Commercial Dynamics Pty. Ltd. | thing but mean your mother.
NSW, Australia |
------------------------------
Date: Fri, 15 May 1998 01:10:17 GMT
From: kliou@ichat.com (KLL)
Subject: Timeout a program in Perl
Message-Id: <6jg4pu$c7v@bgtnsc03.worldnet.att.net>
I want to start a program and kill it if it runs more than a certain
time on NT. Since I cannot do fork on NT, is there another way
implement this? Thank you.
Kan, new in Perl
------------------------------
Date: 15 May 1998 01:10:59 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: while, each & assoc array
Message-Id: <6jg4n3$lk1$1@comdyn.comdyn.com.au>
In article <355B34EC.C8C671F0@atl.hp.com>,
"David A. Lyons" <lyonsd@atl.hp.com> writes:
> if ( $key != "x" )
In perl, you compare strings with the eq and ne operators. == and !=
are for numerical values.
# perldoc perlop
In your case, you could use a grep on the output list of keys as well.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | The gene pool could use a little
Commercial Dynamics Pty. Ltd. | chlorine.
NSW, Australia |
------------------------------
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 2604
**************************************