[10384] in Perl-Users-Digest
Perl-Users Digest, Issue: 3977 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Oct 14 21:07:18 1998
Date: Wed, 14 Oct 98 18:00:17 -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, 14 Oct 1998 Volume: 8 Number: 3977
Today's topics:
[BUG] eval "require $module" on Linux <dwc3q@cs.virginia.edu>
Re: [BUG] eval "require $module" on Linux (Mark-Jason Dominus)
Re: Are there any "perl.newbie" group or forum? <rra@stanford.edu>
Re: Are there any "perl.newbie" group or forum? <eashton@bbnplanet.com>
Re: Are there no PERL experts out there?? Is there no o <uri@camel.fastserv.com>
Re: Are there no PERL experts out there?? Is there no o (Martien Verbruggen)
Re: Are there no PERL experts out there?? Is there no o (Mark-Jason Dominus)
Re: Are there no PERL experts out there?? Is there no o <flavell@mail.cern.ch>
Re: Batch-changing URL case in HTML pages with perl <mark@uninetwork.com>
Re: Batch-changing URL case in HTML pages with perl <rootbeer@teleport.com>
Re: Batch-changing URL case in HTML pages with perl <ljz@asfast.com>
Re: Cool company has Perl jobs! (Adam Turoff)
Re: Cool company has Perl jobs! <eashton@bbnplanet.com>
Re: encryption (David Formosa)
Re: encryption (Michael J Gebis)
Re: ftp.pl perl ftp library <rootbeer@teleport.com>
Re: how to remove trailing spaces? <mark@uninetwork.com>
MacPerl windows (K. Finstad)
Perl and extracting multiple tar archives. (Donald J. Miller III)
Re: Perl and extracting multiple tar archives. <rootbeer@teleport.com>
problem with OO code in a Safe (Joey Hess)
Re: Random numbers <rootbeer@teleport.com>
Re: Sorry <merlyn@stonehenge.com>
Special: Digest Administrivia (Last modified: 12 Mar 98 (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 14 Oct 1998 19:51:20 -0400
From: David Coppit <dwc3q@cs.virginia.edu>
Subject: [BUG] eval "require $module" on Linux
Message-Id: <Pine.WNT.4.03.9810141946460.247-100000@legacy.cs.virginia.edu>
Is there a workaround for this?
$ /usr/bin/perl -v
This is perl, version 5.004_03
[snip]
$ cat aaa
#!/usr/bin/perl
BEGIN
{
@INC=();
unless (eval "require Date::Manip")
{
print "You do not have Date::Manip. Get it from CPAN.\n";
exit;
}
import Date::Manip;
}
$ aaa
You do not have Date::Manip. Get it from CPAN.
Segmentation fault (core dumped)
This is a computer running Linux 2.1.125 based on Slackware 3.4. On a
Solaris machine, there is no core dump.
Thanks,
David
_________________________________________________________________________
David Coppit - Graduate Student coppit@cs.virginia.edu
The University of Virginia http://www.cs.virginia.edu/~dwc3q
"For I am a Bear of Very Little Brain,
and long words Bother me" - Winnie the Pooh
------------------------------
Date: 14 Oct 1998 20:16:24 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: [BUG] eval "require $module" on Linux
Message-Id: <703eso$cfa$1@monet.op.net>
In article <Pine.WNT.4.03.9810141946460.247-100000@legacy.cs.virginia.edu>,
David Coppit <dwc3q@cs.virginia.edu> wrote:
>
>Is there a workaround for this?
Upgrade to 5.005_02. 5.004_03 is more than a year old and was
replaced by the more stable 5.004_04 soon afterwards anyway.
------------------------------
Date: 14 Oct 1998 16:34:01 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Are there any "perl.newbie" group or forum?
Message-Id: <ylzpayoh06.fsf@windlord.stanford.edu>
Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com> writes:
> You make a good point here but I doubt that a CS degree guarantees the
> ability to write and understand Perl or any other language. Scheme used
> to be the training wheel of choice but I see a lot of curricula these
> days using Java for some reason.
There are two conflicting goals of a standard CS cirriculum. One of them
is to teach students how to use computers, including how to program, for
which honestly teaching languages are the best way of starting. I'm still
a great believer in standard Pascal as a good first programming language.
Teach people pointers *after* you've gotten them used to procedural
programming, variable declarations, and decomposition.
On the other hand, students are going to graduate and then have to find
jobs in the real world. Furthermore, students want to do cool projects
and want to be able to read existing code, and some classes require use of
libraries that are written by regular programmers. Because of that,
there's a great deal of pressure on CS programs to teach in "practical"
languages, meaning languages actually used in the world. Which mostly
translates to C, with smatterings of C++ and Java.
C is a so-so teaching language for a *first* language; it basically
amounts to learning assembly first. You have to deal with pointers and
stack frames and such right from the beginning. That's actually not that
*bad* of a way to start; quite a few programmers do start that way. But
it doesn't teach the theory as well as something like Pascal would.
> As far as non-programmers go I think Perl is a lot more friendly and
> useful than Java.
I actually disagree, for the following reason: Java is more restricted.
Java doesn't let you do things in a bunch of different ways. And it's a
little easier to form clear and consistent subsets of Java. Perl is too
powerful to be an effective teaching language for non-programmers, IMO.
> At this point one should start asking, how low do you go? How simple do
> you make it? Do you start talking about the history of computing and
> why things are the way they are? Then launch into the ultra basics of
> programming? How much hand holding?
You start by giving people the standard sorts of introductory assignments
in a relatively simple language and do that over a couple of quarters
(ideally with a one-quarter accelerated track). Then, ideally at the same
time as their second quarter of programming, give them an overview course
that runs them through basic assignments in about five different
languages, including a LISP-like, a heavily OO language, and something
procedural but different than what they've been using (Ada is a good one).
--
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print
------------------------------
Date: Thu, 15 Oct 1998 00:12:26 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Are there any "perl.newbie" group or forum?
Message-Id: <36253B69.FDE918C0@bbnplanet.com>
Russ Allbery wrote:
> There are two conflicting goals of a standard CS cirriculum. One of them
> is to teach students how to use computers, including how to program, for
> which honestly teaching languages are the best way of starting. I'm still
> a great believer in standard Pascal as a good first programming language.
> Teach people pointers *after* you've gotten them used to procedural
> programming, variable declarations, and decomposition.
This is, indeed, a quandry in academia. I had a long chat with a CS prof
over a few beers about this sort of thing. Teaching is an art and how
anyone can manage to impart knowledge to a room full of young co-eds is
an amazing and quite a daunting task. Not every student in the class
will learn the same so one must teach as well as they can and hope the
laggards try harder or get a tutor. Pascal is a good language to start
with as its pretty straightforward and easy, I took a class in high
school and thought it was a blast. Scheme is like pulling teeth. There
is a lot of ground to cover in technology.
> On the other hand, students are going to graduate and then have to find
> jobs in the real world. Furthermore, students want to do cool projects
> and want to be able to read existing code, and some classes require use of
> libraries that are written by regular programmers. Because of that,
> there's a great deal of pressure on CS programs to teach in "practical"
> languages, meaning languages actually used in the world. Which mostly
> translates to C, with smatterings of C++ and Java.
How very true. Colleges are becoming more like corporations and as they
start charging more and more for tutition, they must turn out happy
satisfied s/students/customers. Perl is used in the real world though.
There were several classes offered in Perl at the university I used to
work at.
> I actually disagree, for the following reason: Java is more restricted.
> Java doesn't let you do things in a bunch of different ways. And it's a
> little easier to form clear and consistent subsets of Java. Perl is too
> powerful to be an effective teaching language for non-programmers, IMO.
Java is more restricted and doesn't give you the kind of rope Perl does,
but after a bit too much C++, Java just didn't appeal, Perl is fun and
is so easy at a certain level. But I see your point.
> You start by giving people the standard sorts of introductory assignments
> in a relatively simple language and do that over a couple of quarters
> (ideally with a one-quarter accelerated track). Then, ideally at the same
> time as their second quarter of programming, give them an overview course
> that runs them through basic assignments in about five different
> languages, including a LISP-like, a heavily OO language, and something
> procedural but different than what they've been using (Ada is a good one).
Hmm...true, maybe the campaign for Perl should include getting CS
Chairmen to consider offering more Perl classes in their undergraduate
curricula. This would increase awareness, usage after graduation and
perhaps less 'clueless newbies'. Food for thought.
e.
After all, the cultivated person's first duty is to
always be prepared to rewrite the encyclopedia. - U. Eco -
------------------------------
Date: 14 Oct 1998 19:02:39 -0400
From: Uri Guttman <uri@camel.fastserv.com>
Subject: Re: Are there no PERL experts out there?? Is there no one who can solve this??
Message-Id: <sar67dmrblc.fsf@camel.fastserv.com>
>>>>> "MV" == Martien Verbruggen <mgjv@comdyn.com.au> writes:
MV> In article <saraf2yrca2.fsf@camel.fastserv.com>, Uri Guttman
MV> <uri@camel.fastserv.com> writes:
>>>>>>> "MV" == Martien Verbruggen <mgjv@comdyn.com.au> writes:
>>
MV> In article <sard87urdv9.fsf@camel.fastserv.com>, Uri Guttman
MV> <uri@camel.fastserv.com> writes:
>>
W> 4. $something =~ /^\w+$/;
>> >> this is better than one but misses blanks again. as well as
>> digits >> if you want them (you seem to earlier). but again at
>> least it is >> anchored and checks all the chars.
>>
MV> \w includes digits. alphanumerics plus '_'. It just misses blanks.
>> i know that. i was just pointing out why it would fail on 'my
>> name'. i was trying to educate her, not give her the direct
>> answer.
MV> You're confusing me. You say you know \w includes blanks, but in
MV> your earlier post you say 'but misses blanks again. as well as
MV> digits'. Am I just misreading that?
my mistake on digits. trying to keep track of her multitude of regex
mistakes spun my eyeballs. i didn't read your reply clearly either.
i saw your long reply which was similar to mine. either one should help
her out of her 'no experts' depression. :-)
uri
--
Uri Guttman Fast Engines -- The Leader in Fast CGI Technology
uri@fastengines.com http://www.fastengines.com
------------------------------
Date: Wed, 14 Oct 1998 23:20:58 GMT
From: mgjv@comdyn.com.au (Martien Verbruggen)
Subject: Re: Are there no PERL experts out there?? Is there no one who can solve this??
Message-Id: <ulaV1.71$AA3.121960@nsw.nnrp.telstra.net>
In article <sar67dmrblc.fsf@camel.fastserv.com>,
Uri Guttman <uri@camel.fastserv.com> writes:
> i saw your long reply which was similar to mine. either one should help
> her out of her 'no experts' depression. :-)
Heh, I surely hope so.
Martien
--
Martien Verbruggen |
Webmaster www.tradingpost.com.au | Make it idiot proof and someone will
Commercial Dynamics Pty. Ltd. | make a better idiot.
NSW, Australia |
------------------------------
Date: 14 Oct 1998 19:53:28 -0400
From: mjd@op.net (Mark-Jason Dominus)
Subject: Re: Are there no PERL experts out there?? Is there no one who can solve this??
Message-Id: <703dho$cbh$1@monet.op.net>
In article <7038of$9fb$1@pilot.njin.net>,
David Alan Black <dblack@pilot.njin.net> wrote:
>You wouldn't want Mark-Jason to suffer the
>disappointment of being rejected by your script, now would you?
Yeah, me and G. Gordon Liddy are gonna come and whup his ass.
------------------------------
Date: Thu, 15 Oct 1998 01:59:56 +0200
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: Are there no PERL experts out there?? Is there no one who can solve this??
Message-Id: <Pine.HPP.3.95a.981015015902.27792C-100000@hpplus01.cern.ch>
On 14 Oct 1998, Abigail wrote:
> One reads the documentation.
maybe that's why the questioner needs an expert.
------------------------------
Date: Wed, 14 Oct 1998 19:54:31 -0400
From: Mark Cain <mark@uninetwork.com>
To: brian d foy <comdog@computerdog.com>
Subject: Re: Batch-changing URL case in HTML pages with perl
Message-Id: <362539B7.44514B92@uninetwork.com>
case sensitive?
following this link:
HttP://Www.NEtscAPe.coM/
Not trying to pick on you. Just wondering what you meant by "URLs are case sensitive" as the
above link is a URL and it is not case sensitive on my browser of Netscape. Communicator 4.06
[Win98].
Mark Cain
brian d foy wrote:
> In article <362515d2.1673064@news.vnet.net>, macalex@nospamvnet.net (Gordon Rankin) posted:
>
> >Is anyone aware of any perl scripts, shareware utilities, or programs
> >etc. that will open a batch of HTML files, change the case of URLs in
> >the file from mixed or upper to all lower case, and save the file?
>
> URLs are case sensitive. what problem are you trying to solve?
>
> --
> brian d foy <comdog@computerdog.com>
> Kernel Steve Austin - stronger, faster, threaded
> <URL:http://kernel.steve.austin.pm.org>
------------------------------
Date: Thu, 15 Oct 1998 00:23:37 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Batch-changing URL case in HTML pages with perl
Message-Id: <Pine.GSO.4.02A.9810141721510.1979-100000@user2.teleport.com>
On Wed, 14 Oct 1998, Mark Cain wrote:
> case sensitive?
>
> following this link:
>
> HttP://Www.NEtscAPe.coM/
>
> Not trying to pick on you. Just wondering what you meant by "URLs are
> case sensitive"
1. The URI is (or may be) case sensitive. Hostnames and protocols are not.
2. This has nothing to do with Perl. See the docs, FAQs, and newsgroups
about URLs and URIs if you need more information about URLs and URIs.
Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: 14 Oct 1998 20:48:11 -400
From: Lloyd Zusman <ljz@asfast.com>
Subject: Re: Batch-changing URL case in HTML pages with perl
Message-Id: <ltg1cqwsz8.fsf@asfast.com>
comdog@computerdog.com (brian d foy) writes:
> In article <362515d2.1673064@news.vnet.net>,
> macalex@nospamvnet.net (Gordon Rankin) posted:
>
> >Is anyone aware of any perl scripts, shareware utilities, or programs
> >etc. that will open a batch of HTML files, change the case of URLs in
> >the file from mixed or upper to all lower case, and save the file?
To Gordon Rankin: I will build a script for you, using HTML::Parser,
which will help you solve your problem. Look for it in your email
before the weekend.
> URLs are case sensitive. what problem are you trying to solve?
URL's are case sensitive when being sent to web servers which do
case-sensitive filename matching. Web servers running on Microsoft
boxes do not do case-sensitive filename matching.
In a mixed Unix/Microsoft environment, people developing web content
on the Microsoft side of things tend to be careless about the case of
the letters used in file names. Once these files get sent over to
Unix-based web servers, big problems often result due to these case
inconsistencies.
Some FTP packages that run on Microsoft boxes offer an option to
convert all file names to either all-upper or all-lower case when
sending them to the target machine. This solves one part of the
problem. However, the URL's within web pages would also have to be
converted to all-upper or all-lower case in order to fix this problem
fully.
This is likely to be similar to the problem being faced by Gordon
Rankin.
In case any of you might think that what I described here is abstruse
and highly unlikely, I would like to point out that this the exact
situation that exists at a major Wall Street firm where I previously
was consulting. Nowadays, many companies are using large numbers of
both Microsoft and Unix boxes within their corporate networks, and
therefore, I believe that this sort of thing is actually a rather
common problem.
--
Lloyd Zusman ljz@asfast.com
perl -e '$n=170;for($d=2;($d*$d)<=$n;$d+=(1+($d%2))){for($t=0;($n%$d)==0;
$t++){$n=int($n/$d);}while($t-->0){push(@r,$d);}}if($n>1){push(@r,$n);}
$x=0;map{$x+=(($_>0)?(1<<log($_-0.5)/log(2.0)+1):1)}@r;print"$x\n"'
------------------------------
Date: 14 Oct 1998 19:20:33 -0400
From: ziggy@panix.com (Adam Turoff)
Subject: Re: Cool company has Perl jobs!
Message-Id: <703bk1$f61@panix.com>
Rufus Xavier Sarsaparilla <kirbyk@best.com> wrote:
>Uri Guttman <uri@camel.fastserv.com> wrote:
>>>>>>> "v" == versuslaw <versuslaw@my-dejanews.com> writes:
>>
>> v> We are an equal opportunity employer based in Redmond, Washington.
>>
>>too close to hell for me!!
But when you move out there, uri, it'll be all frozen over. Good skiing
conditions. :-)
>>i wonder if they know that perl is being used in such close proximity to
>>ground zero.
>
>I can top this. I work in the tools group for the service operations of
>WebTV, owned by the big M. We do most of our work in Perl, on unix
>machines running Solaris. So, Microsoft pays me to write perl for unix.
>I even went to the Perl conference this year on Microsoft's dime.
Microsoft is big enough that practically anything you say about it is true.
For instance, they have documented their use of Linux internally in the
development of IE/UNIX. Yes, Microsoft uses Linux as a software development
platform.
>Of course, we're just a bought startup, rather than part of MS proper, so
>the rules are a little different. Someday, they might care more about
>what tools we use to do our jobs - that's the point where I take my
>now reasonable perl experience back to the open market, most likely.
>Until then, though, perl inside of microsoft is a reality.
We'll see if you repeat the hotmail.com syndrome. :-)
Z.
------------------------------
Date: Wed, 14 Oct 1998 23:43:37 GMT
From: Elaine -HappyFunBall- Ashton <eashton@bbnplanet.com>
Subject: Re: Cool company has Perl jobs!
Message-Id: <362534A8.C12ACC99@bbnplanet.com>
Adam Turoff wrote:
> But when you move out there, uri, it'll be all frozen over. Good skiing
> conditions. :-)
New England will be frozen over before then. My skiis are itchin' :)
> Microsoft is big enough that practically anything you say about it is true.
> For instance, they have documented their use of Linux internally in the
> development of IE/UNIX. Yes, Microsoft uses Linux as a software development
> platform.
This shouldn't be a suprise to anyone, though IE on Solaris, to me,
seems like a blasphemy. I'm sure they have UNIX of all flavours floating
all over the MS Campus. We host a part of MS here...I know of at least
one Solaris box they have. *gasp*
> >Of course, we're just a bought startup, rather than part of MS proper, so
> >the rules are a little different. Someday, they might care more about
> >what tools we use to do our jobs - that's the point where I take my
> >now reasonable perl experience back to the open market, most likely.
> >Until then, though, perl inside of microsoft is a reality.
>
> We'll see if you repeat the hotmail.com syndrome. :-)
I'm sure they use all sorts of tools on the inside. Just because we hate
the attitude and what MS stands for in a FSF World doesn't mean that
there aren't a bunch of geeks on the inside rebelling and using what
makes their lives easier. Just like the rest of us.
e.
After all, the cultivated person's first duty is to
always be prepared to rewrite the encyclopedia. - U. Eco -
------------------------------
Date: 15 Oct 1998 09:19:30 +1000
From: dformosa@zeta.org.au (David Formosa)
Subject: Re: encryption
Message-Id: <703bi2$33d$1@godzilla.zeta.org.au>
In <MPG.108e84dcf032d03898980d@nntp.hpl.hp.com> lr@hpl.hp.com (Larry Rosler) writes:
>[Posted to comp.lang.perl.misc and a copy mailed.]
[...]
>Orlando Frooninckx <Frook@mail.dma.be> wrote:
>! does anyone have a nice encryption function example so I can crypt
>! sentences before writing them to a file?
>As Michael Gebis proposed, if you are just writing them to a file but
>can't decrypt them, you might as well use 'unlink' (and save the disk
>space).
There are uses for one way encrytion, in fact on the grand scheam of things
one-way-encrtion is as importent as two way encrytion.
--
Please excuse my spelling as I suffer from agraphia. See the URL in my
header to find out more.
------------------------------
Date: 15 Oct 1998 00:08:13 GMT
From: gebis@fee.ecn.purdue.edu (Michael J Gebis)
Subject: Re: encryption
Message-Id: <703edd$1h6@mozo.cc.purdue.edu>
stanley@skyking.OCE.ORST.EDU (John Stanley) writes:
}In article <MPG.108e84dcf032d03898980d@nntp.hpl.hp.com>,
}Larry Rosler <lr@hpl.hp.com> wrote:
}>In article <702lru$q1i$1@news.NERO.NET> on 14 Oct 1998 17:09:18 GMT, John
}>Stanley <stanley@skyking.OCE.ORST.EDU> says...
}>
}>> Decryption was not part of the problem statement.
}>
}>Orlando Frooninckx <Frook@mail.dma.be> wrote:
}>! does anyone have a nice encryption function example so I can crypt
}>! sentences before writing them to a file?
}>
}>As Michael Gebis proposed, if you are just writing them to a file but
}>can't decrypt them, you might as well use 'unlink' (and save the disk
}>space).
}I am not writing them anywhere. I did not create the problem statement.
}For all I know, Orlando wants to create a password file of some kind
}using sentences instead of simple passwords. You know, the kind of thing
}where the user seeking authentication enters his pass sentence and it is
}encrypted and compared to the encrypted copy.
Orlando:
Do you want to encrypt and decrypt data? "use Crypt::DES;"
Do you want to perform a message digest? "use SHA;"
You can choose a different encryption module, or a different message
digest module and still be ok. See CPAN for your choices, and Applied
Cryptography by Schneier for how to make your choice. Doing any one
of the above is relatively easy, and relatively safe.
All other answers are misleading, wrong, difficult, or just plain
dangerous. Using "crypt" to produce a message digest is so dumb it
hurts.
--
Mike Gebis gebis@ecn.purdue.edu mgebis@eternal.net
------------------------------
Date: Wed, 14 Oct 1998 23:12:55 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: ftp.pl perl ftp library
Message-Id: <Pine.GSO.4.02A.9810141612030.1979-100000@user2.teleport.com>
On Thu, 15 Oct 1998, Arran Price wrote:
> I cant find any docs on how to use it, the script itself dosent say
> howto...
Software without docs is useless. Throw it out and get a
properly-documented module from CPAN. Hope this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 14 Oct 1998 19:04:25 -0400
From: Mark Cain <mark@uninetwork.com>
To: Antti-Jussi.Korjonen@sonera.fi
Subject: Re: how to remove trailing spaces?
Message-Id: <36252DF9.3ADEF999@uninetwork.com>
try this:
# search for zero or more of the space character juxtaposed to the EOL
# and replace it with nothing
$temp =~ s/ *$//;
Read perlre.
hth,
Mark
Antti-Jussi Korjonen wrote:
> How do I remove trailing spaces?
> $temp=~ tr/\s$//d; this doesn't work, what would?
>
> --
>
> __/ __/ __/ __/ Antti-Jussi Korjonen
> __/ __/ __/ __/ __/__/ Vaajakatu 5 D 85
> __/ __/ __/ __/ __/__/ 33720 TAMPERE, FINLAND
> __/ __/ __/__/__/ __/ __/ tel. +358-(0)40-577 83 23
> Antti-Jussi.Korjonen@sonera.fi
> --------->> http://www.students.tut.fi/~k150556 <<---------
>
------------------------------
Date: Wed, 14 Oct 1998 18:18:07 -0700
From: kfinstad@unm.edu (K. Finstad)
Subject: MacPerl windows
Message-Id: <kfinstad-1410981818070001@ppp-150.unm.edu>
Does anyone know how to clear a window (e.g., STDOUT) of text?
I have a very text-intensive project that fills up the window, and on
slower machines (Classic IIs), the output starts jumping and flickering. I
can't find any documentation anywhere (books or pods) that describe how to
do this. One thing I tried is redirecting STDOUT to a new window, which
works, but then the getc() command I'm using doesn't seem to work with any
STDIN other than Dev:Console (the MacPerl window), even after a redirect.
Thanks,
Kraig Finstad
------------------------------
Date: Wed, 14 Oct 1998 20:19:31 -0400
From: dmiller@stratos.net (Donald J. Miller III)
Subject: Perl and extracting multiple tar archives.
Message-Id: <dmiller-1410982019310001@as5300-1-6.stratos.net>
Hello,
I am trying to write a Perl script which will read a list of filenames in
a file to extract from a multiple tar archive. Essentially, it is a list
of 14 filenames from 28 tar archives. I wish to read every other file on
the tape. I know this involves the use of the mt command.
I wrote a script which is mainly a while loop to read the filenames from
the list and execute via system() the proper tar and mt commands. The
problem has been that mt seems to be unpredictable on my HP-UX box and it
may not advance the tape one full record without requiring a second
invocation of the mt command. I have tried to incorporate this into my
script either through
system("mt -t $TAPE fsf 2") or system("mt -t $TAPE fsf 1");
running the previous system () command twice. I have even tried rerunning
the system("tar ....") command then another system("mt..."), however the
script fails apparently due to tar and mt's flaky nature.
In short, does anyone have a method that would allow me to perform this task?
Here is what the loop looks like:
...truncated open FILE routine..
while (defined($filename = <ARCHIVELIST>)) {
chomp $filename;
system("tar xvf $TAPE $filename") && system("mt -t $TAPE fsf 1");
}
close (ARCHIVELIST) || die;
Thanks,
D. Miller
------------------------------
Date: Thu, 15 Oct 1998 00:37:45 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Perl and extracting multiple tar archives.
Message-Id: <Pine.GSO.4.02A.9810141732520.1979-100000@user2.teleport.com>
On Wed, 14 Oct 1998, Donald J. Miller III wrote:
> the script fails apparently due to tar and mt's flaky nature.
Maybe you need to get a fix for tar and mt. If your vendor won't help you,
start porting Linux to your hardware. :-)
> system("tar xvf $TAPE $filename") && system("mt -t $TAPE fsf 1");
It would be safer and more efficient (and might even fix your problem) to
use the multiple-argument form of system.
system('tar', 'xvf', $TAPE, $filename)
&& system('mt', '-t', $TAPE, 'fsf', 1);
In this way, you won't have any chance of calling a shell which could
mis-interpret characters within $TAPE or $filename. And since you won't be
calling a shell, the return value from system will be derived from the
program's exit status, rather than the shell's exit status, so that may
help with your problem.
Good luck!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 14 Oct 1998 16:12:21 -0700
From: joey@kite.kitenet.net (Joey Hess)
Subject: problem with OO code in a Safe
Message-Id: <slrn72aale.pvn.joey@kite.kitenet.net>
I have a problem trying to run certian object oriented code inside a Safe.
Try this program - I don't understand why the 2 different pieces of code
should return different things, or why the second should fail with 'Can't
locate object method "name" via package "bar" at (eval 6) line 1.' when run
inside a Safe.
Help!
package foo;
use vars qw($AUTOLOAD);
sub new {
my $proto=shift;
my $class = ref($proto) || $proto;
my $this = {};
bless($this, $class);
return $this;
}
sub AUTOLOAD {
my $this=shift;
my $name = $AUTOLOAD;
$name =~ s/.*://;
if (@_) {
return $this->{$name} = shift;
}
else {
return $this->{$name};
}
}
package bar;
use foo;
use vars qw(@ISA);
@ISA=qw{foo};
# Main program here.
package main;
use Safe;
$a=foo->new;
$b=bar->new;
$a->friend($b);
$b->friend($a);
$a->name("a");
$b->name("b");
my $safe=Safe->new;
$safe->share(qw{$a});
my @testcode=(
'$a->friend->name',
'sub test1 { return $a->friend->name }; return test1()',
);
foreach (@testcode) {
print '-'x 80 ."\nCode:\t\t$_\n";
my @ret=eval($_);
print "Outside a safe:\t",@ret,$@,"\n";
my @ret=$safe->reval($_);
print "Inside a safe:\t",@ret,$@,"\n";
}
------------------------------
Date: Thu, 15 Oct 1998 00:21:08 GMT
From: Tom Phoenix <rootbeer@teleport.com>
Subject: Re: Random numbers
Message-Id: <Pine.GSO.4.02A.9810141720280.1979-100000@user2.teleport.com>
On Wed, 14 Oct 1998, Jon wrote:
> Is there anyway a script can generate random numbers, like any
> number one through ten?
Yes, there is. Look for the word 'random' in the perlfunc manpage. Hope
this helps!
--
Tom Phoenix Perl Training and Hacking Esperanto
Randal Schwartz Case: http://www.rahul.net/jeffrey/ovs/
------------------------------
Date: Wed, 14 Oct 1998 23:44:43 GMT
From: Randal Schwartz <merlyn@stonehenge.com>
Subject: Re: Sorry
Message-Id: <8cemsabtef.fsf@gadget.cscaper.com>
>>>>> "Larry" == Larry Wall <larry@kiev.wall.org> writes:
Larry> That's easy. Perl is worse than Python because people wanted it worse.
As I like to put it, "Remember that the P in Perl stands for Practical.
The P in Python doesn't seem to stand for anything."
:-)
--
Name: Randal L. Schwartz / Stonehenge Consulting Services (503)777-0095
Keywords: Perl training, UNIX[tm] consulting, video production, skiing, flying
Email: <merlyn@stonehenge.com> Snail: (Call) PGP-Key: (finger merlyn@teleport.com)
Web: <A HREF="http://www.stonehenge.com/merlyn/">My Home Page!</A>
Quote: "I'm telling you, if I could have five lines in my .sig, I would!" -- me
------------------------------
Date: 12 Jul 98 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Special: Digest Administrivia (Last modified: 12 Mar 98)
Message-Id: <null>
Administrivia:
Special notice: in a few days, the new group comp.lang.perl.moderated
should be formed. I would rather not support two different groups, and I
know of no other plans to create a digested moderated group. This leaves
me with two options: 1) keep on with this group 2) change to the
moderated one.
If you have opinions on this, send them to
perl-users-request@ruby.oce.orst.edu.
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 3977
**************************************