[19405] in Perl-Users-Digest
Perl-Users Digest, Issue: 1600 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 23 18:10:27 2001
Date: Thu, 23 Aug 2001 15:10:11 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <998604610-v10-i1600@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Thu, 23 Aug 2001 Volume: 10 Number: 1600
Today's topics:
Performance : Shell X Perl <sandra@ccuec.unicamp.br>
Re: Performance : Shell X Perl <rsherman@ce.gatech.edu>
Re: Performance : Shell X Perl <jhalpin@nortelnetworks.com_.nospam>
Re: Perl OO needs the opposite of SUPER:: <joe+usenet@sunstarsys.com>
Re: Re-join (Steve)
Re: Self-Searchable Perl documention - Extremely Useful (John Holdsworth)
Re: specific tutorial... (Steve)
Re: Using %{$hashref} or %$hashref to dereference?? <uri@sysarch.com>
Re: Why is $i so popular? <rpresser@NOSPAMimtek.com.invalid>
Win32: how much disk space free? <florian@haftmann-online.de>
Re: Win32: how much disk space free? <callgirl@la.znet.com>
zipping in perl (mk)
Re: zipping in perl <djberge@uswest.com>
Re: zipping in perl <bcaligari@fireforged.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 23 Aug 2001 15:10:49 -0400
From: Sandra Regina <sandra@ccuec.unicamp.br>
Subject: Performance : Shell X Perl
Message-Id: <3B855539.70739BCF@ccuec.unicamp.br>
HI,
Is there anybody that could tell me what is better a shell or a perl
program to do a specific
task?
Is there any doc available that compares the two languages (for
example perl and ksh, ou perl and csh)?
Thanks in advance !
Sandra
sandra@ccuec.unicamp.br
------------------------------
Date: Thu, 23 Aug 2001 14:33:05 +0500
From: Robert Sherman <rsherman@ce.gatech.edu>
Subject: Re: Performance : Shell X Perl
Message-Id: <3B84CDD1.9ADE800B@ce.gatech.edu>
Sandra Regina wrote:
>
> HI,
>
> Is there anybody that could tell me what is better a shell or a perl
> program to do a specific
> task?
> Is there any doc available that compares the two languages (for
> example perl and ksh, ou perl and csh)?
>
> Thanks in advance !
>
> Sandra
> sandra@ccuec.unicamp.br
mostly depends on the task and your skills...
in general, the shell is better for smaller tasks, and for portability
(provided you use sh, as it is the most consistent across the board)
perl is usually better for larger programs and has more flexibility (it
is generally easier to do more complex things in perl, and there are
lots of handy modules available on CPAN), but it is not guaranteed to be
consistent or even exist on every *nix box...and there is no point in
firing up the perl interpreter for something that can be accomplished
easily in the shell.
--
robert sherman
css, cee
georgia institute of technology
atlanta, ga, usa
------------------------------
Date: 23 Aug 2001 15:02:54 -0500
From: Joe Halpin <jhalpin@nortelnetworks.com_.nospam>
Subject: Re: Performance : Shell X Perl
Message-Id: <yxs7ofp6mtn5.fsf@nortelnetworks.com_.nospam>
Sandra Regina <sandra@ccuec.unicamp.br> writes:
> Is there anybody that could tell me what is better a shell or a
> perl program to do a specific task?
Depends on what the specific task is, and what you'd count as
"better".
For example, say you want to run through a large directory tree,
containing many thousands of files, and do something with some or all
of the files. Also say that "better" here means "faster" as you'll be
doing it a lot.
In that case, Perl's a no-brainer. Especially if you can do the
processing with what Perl has builtin. It will be much faster than
using find with shell commands.
> Is there any doc available that compares the two languages (for
> example perl and ksh, ou perl and csh)?
Don't know of one like that, but there's one that compares csh with
Bourne derived shells:
http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/index.html
Joe
------------------------------
Date: 23 Aug 2001 15:43:21 -0400
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: Perl OO needs the opposite of SUPER::
Message-Id: <m3ae0qd0km.fsf@mumonkan.sunstarsys.com>
Ilya Zakharevich <nospam-abuse@ilyaz.org> writes:
> John Lin <johnlin@chttl.com.tw>], who wrote in article
> <a73bcad1.0108221715.239a688a@posting.google.com>:
> > > package EvenReport;
> > > use base 'Report';
> > > sub report { "even" }
> > >
> > > package ExtendedReport; # an abstract "interface"
> > > sub report {
> > > local *report;
> > > "extended " . shift() -> report; # similar to SUPER::report
> > > }
>
> This works in toy situations only. Your `local *report' is a global
> override, as opposed to an object-specific override. Thus if
> shift()->report calls `report' on some *other* objects which are kids
> of ExtendedReport, this would break.
^^^^^^^^^^^^^^^^
If by "break" you mean "ignore ExtendedReport::report()", that's
certainly true. But that isn't necessarily undesirable here- it might
be the "Right Thing" if say ExtendedReport::report is just supposed to
add a single header (and/or footer) to a collection of printed reports.
Moreover, unlike John Lin's original approach, there's no implied ISA
relationship in this code between Report-based objects and
ExtendedReport ones. I probably should have stressed this point more.
Of course, there would be an obvious problem whenever a mixin kid
tried overriding ExtendedReport::report(); but it isn't clear
to me how, or even if, overriding was supposed to work with John's
":virtual" subs.
Anyway, here's a hopefully less "broken" version:
package ExtendedReport;
use Class::ISA;
sub super {
my ($self, $method) = @_ ;
my @isa = Class::ISA::super_path(ref $self || $self);
1 until not @isa or __PACKAGE__ eq shift @isa;
no strict 'refs';
for (@isa) {
return *{$_ . '::' . $method}{CODE} || next;
}
return undef;
}
sub report {
my ($self) = @_;
"extended " . $self -> super("report") -> (@_);
}
YMMV
--
Joe Schaefer "A cynic is a man who knows the price of everything and the
value of nothing."
--Oscar Wilde
------------------------------
Date: 23 Aug 2001 18:07:36 GMT
From: steve@zeropps.uklinux.net (Steve)
Subject: Re: Re-join
Message-Id: <slrn9oagub.dc9.steve@zero-pps.localdomain>
On Fri, 24 Aug 2001 00:01:15 +0800, Just in wrote:
>Its me again . . .
>
>Appreciate the help given in spite of my vagueness . . .
>
>Apart from joining the lines that end with misspelled words
>(nice one Tad ; ), I am still stuck . . .
>
>Let me elaborate, a full line ends with a ;
>
>The following is therefore split on to two lines :-
>NAME * * * * * 6130 1-9999 10%
> >0.5% N8 CHECKSETUP ;
>
>So it should actually read:-
>NAME * * * * * 6130 1-9999 10%
>>0.5% N8 CHECKSETUP;
>
>Printing this out is fine using :-
>$Line = $_;
>s/\n// if((length($Line) < 60) && !(Line =~ /;$/));
You've got to read the next line, as it is you just seem to be taking "\n",
off the current line, but you didn't post your code so I can't be sure.
--
Cheers
Steve email mailto:steve@zeropps.uklinux.net
%HAV-A-NICEDAY Error not enough coffee 0 pps.
web http://www.zeropps.uklinux.net/
or http://start.at/zero-pps
6:54pm up 40 days, 20:59, 2 users, load average: 1.00, 1.10, 1.12
------------------------------
Date: 23 Aug 2001 12:55:31 -0700
From: coldwave@bigfoot.com (John Holdsworth)
Subject: Re: Self-Searchable Perl documention - Extremely Useful!
Message-Id: <2a46b11e.0108231155.38985e41@posting.google.com>
dkcombs@panix.com (David Combs) wrote in message news:<9ll790$fvi$2@news.panix.com>...
> In article <74f348f7.0108120702.662a6771@posting.google.com>,
> Yves Orton <demerphq@hotmail.com> wrote:
> >...
> >Incidentally, I stayed up all night enhancing your activestate search
> >engine (found a couple of minor gliitches, but who cares). Check your
> >mails for a copy of my mods.
> >
>
> How about posting it here so everyone can
> see it too.
>
> Good or bad idea?
Good idea. I'm curious about these glitches. The code did rather
"evolve" into existence.
Can anybody help me get OpenPSP onto CPAN? So far nothing has
happened. Do I need to be a mason or something ?-)
john
------------------------------
Date: 23 Aug 2001 18:07:37 GMT
From: steve@zeropps.uklinux.net (Steve)
Subject: Re: specific tutorial...
Message-Id: <slrn9oahh0.dc9.steve@zero-pps.localdomain>
On Thu, 23 Aug 2001 16:10:29 +0100, Nathan Randle wrote:
>I have learnt the basics surrounding Perl now I think but I want to make a
>log in system for a program I am making. Is there any specific tutorials on
>the web that explain how to make a log-in system?
There'll be some useful security stuff here:
http://www.stonehenge.com/merlyn/
also have a look at perldoc perlsec.
--
Cheers
Steve email mailto:steve@zeropps.uklinux.net
%HAV-A-NICEDAY Error not enough coffee 0 pps.
web http://www.zeropps.uklinux.net/
or http://start.at/zero-pps
7:02pm up 40 days, 21:06, 2 users, load average: 1.00, 1.02, 1.06
------------------------------
Date: Thu, 23 Aug 2001 21:25:18 GMT
From: Uri Guttman <uri@sysarch.com>
Subject: Re: Using %{$hashref} or %$hashref to dereference??
Message-Id: <x7heuyh3jw.fsf@home.sysarch.com>
>>>>> "AS" == Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> writes:
AS> According to Uri Guttman <uri@sysarch.com>:
>>
>> this is slightly different than the paren thing. parens only group and
>> don't (normally) affect values.
AS> I'm not sure what you mean. Random balanced parentheses strewn about
AS> "1 + 2 * 3" certainly change the value.
1 + (2 * 3) doesn't change it. nor does ( 1 + (2 * 3)).
you can't apply a deref and have it be a noop unlike parens. that si my
point. parens are not considered an op, they just group and change
precedence. deref is an op so making it look like one with the braces is
easier.
>> the proper full syntax and %$href can be seen as the shortcut. most
>> people look at it the other way with a normal %$href and %{$href} as the
>> disambiguated version.
AS> I don't quite follow your argument, but I'm with you that %{$href} is
AS> the full form and %$href is syntactic sugar. But then, so is m// vs.
AS> //, and everyone writes the latter. The full form isn't necessarily
AS> the stylistically preferred one.
that is just my argument, the full form is easie to teach (just as
randal said in this thread) and for all levels of perl hackers to read
so i use it all the time.
>> so you can be consistant here by always using the {} in derefs. it
>> doesn't follow like parens where you can go down an infinite corridor of
>> nesting. you can't nest %{} unless the data allows it.
>>
>> so i use {} in my derefs all the time for style reasons. i feel it just
>> makes it more obvious that a simple deref is going on. and i code for
>> others to read, not for golf or obsfucation or cool constructs. others
>> disagree and that is what style is all about.
AS> I am less decided on that point. In particular for scalar refs
AS> I'm quite happy with the $ref and $$ref distinction. ${$ref}
AS> looks overblown for a measly scalar, somehow :)
i agree somewhat there. i don't use scalar ref too often but i think i
do the $$ref too. but for @ and % i always use {} for the reasons i
stated.
uri
--
Uri Guttman --------- uri@sysarch.com ---------- http://www.sysarch.com
SYStems ARCHitecture and Stem Development ------ http://www.stemsystems.com
Search or Offer Perl Jobs -------------------------- http://jobs.perl.org
------------------------------
Date: 23 Aug 2001 19:49:24 GMT
From: Ross Presser <rpresser@NOSPAMimtek.com.invalid>
Subject: Re: Why is $i so popular?
Message-Id: <Xns9106A0F5FFFBApt101594@209.155.56.94>
anno4000@lublin.zrz.tu-berlin.de (Anno Siegel) wrote:
> I don't have a cite to prove it, but it seems more than plausible
> that the designers of FORTRAN had this convention in mind when they
> decided about the default types of variables depending on their
> first letter.
It seems to me that early versions of FORTRAN didn't have a way to
declare types; if you used a name beginning with I through N, it was
an integer, if not, it wasn't. The default was the only choice.
I may be wrong about this, of course.
--
Ross Presser * ross_presser@imtek.com
"Back stabbing is a sport best played by those that can't stand face
to face with their opponent." - Danny Taddei
------------------------------
Date: Thu, 23 Aug 2001 20:14:13 +0100
From: Florian Haftmann <florian@haftmann-online.de>
Subject: Win32: how much disk space free?
Message-Id: <3B855605.CD915F10@haftmann-online.de>
Hi!
I want to examine (Win32) how much disk space (drive A: or B:) is
available?
How to do?
-f.h.
------------------------------
Date: Thu, 23 Aug 2001 11:31:25 -0700
From: Kira <callgirl@la.znet.com>
Subject: Re: Win32: how much disk space free?
Message-Id: <3B854BFD.9A89E4A8@la.znet.com>
Florian Haftmann wrote:
> I want to examine (Win32) how much disk space (drive A: or B:) is
> available?
Click on START
Select SETTINGS
Select CONTROL PANEL
Click on UP FOLDER
Right Click a DRIVE LETTER
Select PROPERTIES
Lots of very detailed information will be displayed.
Godzilla!
------------------------------
Date: 23 Aug 2001 12:40:17 -0700
From: mkarasick@diggstown.com (mk)
Subject: zipping in perl
Message-Id: <41c8ef03.0108231140.7cb5d72b@posting.google.com>
Anybody know a package out there that lets me zip files for NT? Thanks.
------------------------------
Date: Thu, 23 Aug 2001 14:49:29 -0500
From: Mr Sunblade <djberge@uswest.com>
Subject: Re: zipping in perl
Message-Id: <3B855E49.505A4D47@uswest.com>
mk wrote:
> Anybody know a package out there that lets me zip files for NT? Thanks.
Archive::Zip (available on CPAN - search.cpan.org).
Regards,
Dan
--
"Evil will always triumph because Good is *dumb*."
-- Dark Helmet, 'Spaceballs: The Movie'
------------------------------
Date: Thu, 23 Aug 2001 20:06:57 -0000
From: "Brendon Caligari" <bcaligari@fireforged.com>
Subject: Re: zipping in perl
Message-Id: <9m3ndb0311p@enews4.newsguy.com>
"mk" <mkarasick@diggstown.com> wrote in message
news:41c8ef03.0108231140.7cb5d72b@posting.google.com...
> Anybody know a package out there that lets me zip files for NT? Thanks.
I don't know of any (but there might be) though you might be using the
WinZip Command Line Support Addon.
http://www.winzip.com/wzcline.htm
Brendon
++++
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
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.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.
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 V10 Issue 1600
***************************************