[25056] in Perl-Users-Digest
Perl-Users Digest, Issue: 7306 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Oct 25 21:05:41 2004
Date: Mon, 25 Oct 2004 18:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 25 Oct 2004 Volume: 10 Number: 7306
Today's topics:
Re: arrays of arrays question <usenet@morrow.me.uk>
Re: arrays of arrays question <nospam@nospam.com>
Re: Common file operations <bik.mido@tiscalinet.it>
Re: Common file operations <jurgenex@hotmail.com>
Re: Common file operations <jgibson@mail.arc.nasa.gov>
Re: Convert excel formula to perl <usa1@llenroc.ude.invalid>
Re: copying files <usenet@morrow.me.uk>
Re: copying files <usenet@morrow.me.uk>
Re: copying files <usa1@llenroc.ude.invalid>
Detecting a Process using Perl Win32 <tom.tingdale@sbcglobal.net>
Re: Detecting a Process using Perl Win32 <usa1@llenroc.ude.invalid>
Re: Fast random string generation <bik.mido@tiscalinet.it>
Re: foreach vs. for <usenet@morrow.me.uk>
Re: foreach vs. for <usenet@morrow.me.uk>
Re: list vs array <usenet@morrow.me.uk>
Re: list vs array <bik.mido@tiscalinet.it>
Re: list vs array <matthew.garrish@sympatico.ca>
Re: list vs array <nospam@nospam.com>
Re: list vs scalar context for localtime? <abigail@abigail.nl>
Re: list vs scalar context for localtime? <uri@stemsystems.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 25 Oct 2004 16:19:25 +0100
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: arrays of arrays question
Message-Id: <t4iv42-4o4.ln1@osiris.mauzo.dyndns.org>
Quoth "daniel kaplan" <nospam@nospam.com>:
>
> >>PLEASE could you learn to type English? If English is not your first
> >>language, I apologise, but I suspect it is; if it is, then you should be
> >>ashamed of yourself.
>
> yeah, i try, but give me the benefit of a doubt that i can neither type nor
> spell as an actual defect...my other one, not sure if it's realted is i
> won't remember your name for two months.
OK, please accept my apologies... most people writing like that are just lazy.
You're still in the killfile, though.
Ben
--
'Deserve [death]? I daresay he did. Many live that deserve death. And some die
that deserve life. Can you give it to them? Then do not be too eager to deal
out death in judgement. For even the very wise cannot see all ends.'
ben@morrow.me.uk
------------------------------
Date: Mon, 25 Oct 2004 18:43:29 -0400
From: "daniel kaplan" <nospam@nospam.com>
Subject: Re: arrays of arrays question
Message-Id: <1098744266.637802@nntp.acecape.com>
>>OK, please accept my apologies... most people writing like that are just
lazy.
>>You're still in the killfile, though.
thanks?
------------------------------
Date: Tue, 26 Oct 2004 00:42:28 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Common file operations
Message-Id: <l30rn0d384u5798ibmbsl0raqf0g1qtrek@4ax.com>
On Mon, 25 Oct 2004 15:52:30 -0300, "Shmuel (Seymour J.) Metz"
<spamtrap@library.lspace.org.invalid> wrote:
> 1. If I have a partial file name, how do I get the complete path?
> I tried canon and glob, but both returned the partial name.
I don't trust you! (Minimal) examples?
Also, see 'perldoc -q glob'.
> 2. If I have a directory name and a file specification, ho do I find
> all files in that directory matching the specification. File::Find
> and issuing an ls command seem like overkill. I could use readdir
Then just use File::Find. Ever heard about regexen?
> if I don't need a recursive search, but I was hoping for an
> equivalent of SysFileTree in OS/2.
Then glob() should do. Again, you should show some actual example
proving that it doesn't. See also
perldoc -f glob
perldoc File::Glob
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Mon, 25 Oct 2004 22:56:30 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Common file operations
Message-Id: <ywffd.5216$LT1.3686@trnddc09>
Shmuel (Seymour J.) Metz wrote:
> I'm trying to find Perl equivalents for some common operations in
> other languages. I'm also looking for some style guides.
>
> 1. If I have a partial file name, how do I get the complete path?
Your question is not clear to me. Or maybe it is actually two questions?
First part would be to get the list of all filename, which match the given
partial name. Please note, typically this is not a 1:1 relationship but a
1:n because a given partial name can be completed into many actual names.
glob() will do that for you.
And the second part would be how to prepend the CWD to the file names found.
That's a trivial job for the double quote operator or the concatenation
operator ".".
> I tried canon and glob, but both returned the partial name.
Where did you find a function "canon"? glob() is the right tool.
Please show us the actual code, then we may be able to find out why you
didn't get the results you expected.
> 2. If I have a directory name and a file specification, ho do I find
> all files in that directory matching the specification.
What is a file specification in your terminlogoy?
> File::Find
> and issuing an ls command seem like overkill. I could use readdir
> if I don't need a recursive search, but I was hoping for an
> equivalent of SysFileTree in OS/2.
If you don't want to recurse into subdirectories then use readdir() (and
maybe stat() and other file information utilities to determine if each file
matches the specification).
If you want to recurse then use File::Find (and maybe stat() and other file
information utilities to determine if each file matches the specification).
jue
------------------------------
Date: Mon, 25 Oct 2004 16:25:00 -0700
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: Common file operations
Message-Id: <251020041625004613%jgibson@mail.arc.nasa.gov>
In article <417d597e$12$fuzhry+tra$mr2ice@news.patriot.net>, Seymour J.
<spamtrap@library.lspace.org.invalid> wrote:
> I'm trying to find Perl equivalents for some common operations in
> other languages. I'm also looking for some style guides.
>
> 1. If I have a partial file name, how do I get the complete path?
> I tried canon and glob, but both returned the partial name.
What computer language allows you to enter a partial file name and get
a complete path? Or do you mean you have a partial or relative path
representation and you want to get the full, absolute path name? If the
latter, check out the File::Spec::Unix module or its brethren.
>
> 2. If I have a directory name and a file specification, ho do I find
...
[answered elsewhere in this thread]
------------------------------
Date: 25 Oct 2004 23:30:26 GMT
From: "A. Sinan Unur" <usa1@llenroc.ude.invalid>
Subject: Re: Convert excel formula to perl
Message-Id: <Xns958DC66FCFE22asu1cornelledu@132.236.56.8>
squash@peoriadesignweb.com (Duke of Hazard) wrote in
news:2d21b838.0410250538.4d378a8f@posting.google.com:
> Is there an easy way to convert a formula like this:
>
> C1+B1 * (E23/D2)
>
> into something perl can evaluate like this:
>
> $C1 + $B1 * ($E23/$D2);
>
> My brute force method would be test each individual character in the
> excel formula and then write subroutines for addition, and
> multiplication. Is there something easier?
>
> I would like the user to be able to type in equation like excel and
> have perl do the math on them.
Well, where do C1, B1, E23 and D2 come from?
My reading of your problem description indicates that you are not trying to
read Excel files. Just 'cause I had a tough day and need to relax, I am
going to try to write something which I think corresponds to what you are
after. (Goes away for a while ...) OK ... The following would be one way, I
guess. (I fully expect and hope to have my errors corrected. After all, I
hadn't tried writing a calculator since high school.)
#! perl
$| = 1;
use strict;
use warnings;
use Regexp::Common 'number';
my %vars;
for(
print '> ';
my $input = <STDIN>;
print '> ')
{
$input =~ s/^\s*//;
$input =~ s/\s*$//;
next if $input eq '';
last if $input =~ /^quit/i;
if($input =~ /^show/i){
for my $var (sort {$a cmp $b} keys %vars) {
print "\t$var = $vars{$var}\n";
}
next;
}
if($input
=~ /^([A-Za-z]{1,2}[0-9]{1,5})\s*=\s*($RE{num}{real})$/) {
$vars{$1} = $2;
next;
}
my $var;
($var, $input) = ($input =~ /^(\S+)\s*=\s*(\S+)$/);
$input =~ s/[\$\%\@\{\}]//g;
my $value = do {
no warnings 'uninitialized';
$input =~ s{([A-Za-z]{1,2}[0-9]{1,5})}/$vars{$1}/ge;
eval $input;
};
print "Error in formula\n" and next if $@;
$vars{$var} = $value if defined $var;
print "$value\n";
}
__END__
D:\Home> perl ef.pl
> a1=5
> a2 = (22/33)*a1-rand(10)
-3.50077311197917
> show
a1 = 5
a2 = -3.50077311197917
> quit
D:\Home>
Sinan.
------------------------------
Date: Mon, 25 Oct 2004 16:13:03 +0100
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: copying files
Message-Id: <vohv42-4o4.ln1@osiris.mauzo.dyndns.org>
Quoth abigail@abigail.nl:
> Ben Morrow (usenet@morrow.me.uk) wrote on MMMMLXXII September MCMXCIII in
> <URL:news:acnt42-to4.ln1@osiris.mauzo.dyndns.org>:
> %%
> %% Quoth "A. Sinan Unur" <usa1@llenroc.ude.invalid>:
> %% >
> %% > I think this justifies my preference for not shelling out for wholesale
> %% > file operations, but using File::Copy.
> %%
> %% s/for.*operations/ever/
> %% s/(?=using)/ or writing/
> %% s/File::Copy/an appropriate module/
>
>
> Giving us:
>
> I think this justifies my preference for ever, but or writingusing
> an appropriate module
GAH!!! :)
> Perhaps you want to say that you prefer using an appropriate module
> instead of shelling out. I fully agree with that. That's why I
> shell out to copy a file - because File::Copy isn't appropriate. ;-)
OK... I would certainly accept your arguments for using cp given
xthread. I would still be inclined to write a *useful* File::Copy
module, though; if only because a fair bit of my code needs to run on
random Win32 machines without the benefit of cp (yes, I do know about
(and use, when I can) the ports).
Ben
--
$.=1;*g=sub{print@_};sub r($$\$){my($w,$x,$y)=@_;for(keys%$x){/main/&&next;*p=$
$x{$_};/(\w)::$/&&(r($w.$1,$x.$_,$y),next);$y eq\$p&&&g("$w$_")}};sub t{for(@_)
{$f&&($_||&g(" "));$f=1;r"","::",$_;$_&&&g(chr(0012))}};t # ben@morrow.me.uk
$J::u::s::t, $a::n::o::t::h::e::r, $P::e::r::l, $h::a::c::k::e::r, $.
------------------------------
Date: Mon, 25 Oct 2004 16:16:32 +0100
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: copying files
Message-Id: <gvhv42-4o4.ln1@osiris.mauzo.dyndns.org>
Quoth "A. Sinan Unur" <usa1@llenroc.ude.invalid>:
> Abigail <abigail@abigail.nl> wrote in
> news:slrncnofsn.3ac.abigail@alexandra.abigail.nl:
>
> > A. Sinan Unur (usa1@llenroc.ude.invalid) wrote on MMMMLXXII September
> > MCMXCIII in <URL:news:Xns958C826FE4F67asu1cornelledu@132.236.56.8>:
>
> Is the date supposed to be wrong above? :)
http://www.catb.org/~esr/jargon/html/S/September-that-never-ended.html
I wonder if this should go in the faq (except we don't have a faq for this
group)? :)
Ben
--
For far more marvellous is the truth than any artists of the past imagined!
Why do the poets of the present not speak of it? What men are poets who can
speak of Jupiter if he were like a man, but if he is an immense spinning
sphere of methane and ammonia must be silent? [Feynmann] ben@morrow.me.uk
------------------------------
Date: 25 Oct 2004 23:34:10 GMT
From: "A. Sinan Unur" <usa1@llenroc.ude.invalid>
Subject: Re: copying files
Message-Id: <Xns958DC712213B8asu1cornelledu@132.236.56.8>
Ben Morrow <usenet@morrow.me.uk> wrote in
news:gvhv42-4o4.ln1@osiris.mauzo.dyndns.org:
> Quoth "A. Sinan Unur" <usa1@llenroc.ude.invalid>:
>> Abigail <abigail@abigail.nl> wrote in
>> news:slrncnofsn.3ac.abigail@alexandra.abigail.nl:
>>
>> > A. Sinan Unur (usa1@llenroc.ude.invalid) wrote on MMMMLXXII
>> > September MCMXCIII in
>> > <URL:news:Xns958C826FE4F67asu1cornelledu@132.236.56.8>:
>>
>> Is the date supposed to be wrong above? :)
>
> http://www.catb.org/~esr/jargon/html/S/September-that-never-ended.html
>
> I wonder if this should go in the faq (except we don't have a faq for
> this group)? :)
Thanks for the link, Ben. I guess I had totally forgotten about that.
OK ... All her posts have the same date ... pheeeewww :)
Sinan.
------------------------------
Date: Mon, 25 Oct 2004 22:01:11 GMT
From: Tom Tingdale <tom.tingdale@sbcglobal.net>
Subject: Detecting a Process using Perl Win32
Message-Id: <cntqn0ljli76jgit7sel1hjk9om7e6co4m@4ax.com>
I have a perl program that launchs every minutes using a Windows Task
Scheduler to process some files. If the Perl program is still running,
I don't want to run it again until the previous Perl application has
finished. It is possible to detect whether or not my Perl application
is already running?
------------------------------
Date: 25 Oct 2004 23:46:37 GMT
From: "A. Sinan Unur" <usa1@llenroc.ude.invalid>
Subject: Re: Detecting a Process using Perl Win32
Message-Id: <Xns958DC92EC5B0Basu1cornelledu@132.236.56.8>
Tom Tingdale <tom.tingdale@sbcglobal.net> wrote in
news:cntqn0ljli76jgit7sel1hjk9om7e6co4m@4ax.com:
> I have a perl program that launchs every minutes using a Windows Task
> Scheduler to process some files. If the Perl program is still running,
> I don't want to run it again until the previous Perl application has
> finished. It is possible to detect whether or not my Perl application
> is already running?
One relatively more portable way is to use lock files. See
perldoc -q lock
You can also try Win32::Process::Info:
http://search.cpan.org/~wyant/Win32-Process-Info-1.002/Info.pm
Sinan.
------------------------------
Date: Tue, 26 Oct 2004 00:35:32 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Fast random string generation
Message-Id: <mopqn0leut72ktn0agbsft0f6ov9c9csdl@4ax.com>
On Mon, 25 Oct 2004 16:36:17 +0200, Michele Dondi
<bik.mido@tiscalinet.it> wrote:
>OK, here are the benchmarks of some of the proposed solutions along
>with some other idea.
>
>BTW: I'm to say the least in a rush and I could absoultely NOT verify
>that my 'Pack2' solution is correct. But in case it is notm then I
>guess that it can be easily corrected.
OK, I'm back again and now I have some more time. I done some *quick*
tests on 'Pack2' and[*] it *seems* to work as expected. At least, I
can't see any big misbehaviour...
In the meanwhile I thought that *if* the program will be run only
under Linux (don't know about other unices), then it may read from
/dev/urandom as well. So I added, more out of curiosity than for other
reasons, a sub like
sub Dev1 {
open my $fh, '<', '/dev/urandom' or
die "Can't access `/dev/urandom': $!\n";
local $/ = \20_000;
scalar <$fh>;
}
and I noticed that it was much faster than I had expected, so I also
tested a version
sub Dev2 {
local $/ = \20_000;
scalar <$fh>;
}
that doesn't open() /dev/urandom each time. The speed increase is
noticeable but not impressive. Here are the updated results (omitting
qw/Map1 Map2 S/ solutions from previous post):
Rate Subst Vec Pack1 Loop1 Loop2 Dev1 Dev2 Pack2
Subst 71.0/s -- -3% -9% -18% -24% -73% -73% -78%
Vec 73.2/s 3% -- -6% -15% -21% -72% -73% -77%
Pack1 78.1/s 10% 7% -- -10% -16% -70% -71% -76%
Loop1 86.4/s 22% 18% 11% -- -7% -67% -68% -73%
Loop2 93.1/s 31% 27% 19% 8% -- -64% -65% -71%
Dev1 259/s 265% 254% 232% 200% 178% -- -3% -19%
Dev2 267/s 276% 265% 242% 210% 187% 3% -- -17%
Pack2 321/s 351% 338% 310% 271% 244% 24% 20% --
[*] Apart the naive assumption that ~0 will yield (2**32-1), which in
fact does (here, now!) - but of course it is not reliable in terms of
portability...
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Mon, 25 Oct 2004 15:57:12 +0100
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: foreach vs. for
Message-Id: <8rgv42-4o4.ln1@osiris.mauzo.dyndns.org>
Quoth Sisyphus <kalinaubears@iinet.net.au>:
> Ben Morrow wrote:
> >
> > There are two distinct meanings of the 'for' keyword in Perl. The first
> > is in the C-style for loop
> >
> > for (init; cond; loop) {
> >
> > , which is (almost) just a wrapper for a while loop, and you almost
> > never need. The second is a pure synonym for 'foreach'
> >
>
> So is the first ..... isn't it ?
> I mean 'for' and 'foreach' are simply synonymous, irrespective of which
> of the "two distinct meanings" you're referring to.
Yes, you are correct. Sorry... I didn't know that :).
Ben
--
Joy and Woe are woven fine,
A Clothing for the Soul divine William Blake
Under every grief and pine 'Auguries of Innocence'
Runs a joy with silken twine. ben@morrow.me.uk
------------------------------
Date: Mon, 25 Oct 2004 16:09:39 +0100
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: foreach vs. for
Message-Id: <jihv42-4o4.ln1@osiris.mauzo.dyndns.org>
Quoth Sherm Pendley <spamtrap@dot-app.org>:
> Ben Morrow wrote:
>
> > There are two distinct meanings of the 'for' keyword in Perl. The first
> > is in the C-style for loop
> >
> > for (init; cond; loop) {
> >
> > , which is (almost) just a wrapper for a while loop, and you almost
> > never need.
>
> That's the one I was thinking of. I can think of a few cases where it
> might be necessary - iterating over every third element in an array, for
> example
Yess.... I suppose
for (my $i = 0; $i < @a; $i += 3) { ... }
might be clearer than
my $threes;
for my $i (@a) {
next if $threes++ % 3;
...
}
, but I'd still probably use the latter :).
> - but like you say here it's almost never needed.
It can always be replaced with a while with a continue block, which IMHO
is clearer. There is a slight difference of scoping (
for (my $i = 0; $i < 3; $i++) { ... }
scopes $i to the whole loop; to get the same effect with while you need
{
my $i = 0;
while ($i < 3) { ... }
continue { $i++ }
}
which I believe may be a *touch* slower due to the extra BLOCK), but
this is rarely an issue.
> On the other hand - and this is where it's a matter of style - any Perl
> style "foreach" loop can also be written as a C style "for". So if
> you're a C programmer who's comfortable with that style, there's no
> strong reason *not* to use it.
It's ugly. It requires you to subscript all over the place, instead of
accessing the values directly. A C-style loop can only (easily) iterate
over an array; a Perl-style iterates over a list, so it is easy to
change
for my $i (@a) {
to
for my $i (@a, @b) {
or
for my $i (sort @a) {
, which will give you $i aliased to the original elements of @a, still,
so you can modify them.
Ben
--
And if you wanna make sense / Whatcha looking at me for? (Fiona Apple)
* ben@morrow.me.uk *
------------------------------
Date: Mon, 25 Oct 2004 16:30:20 +0100
From: Ben Morrow <usenet@morrow.me.uk>
Subject: Re: list vs array
Message-Id: <cpiv42-4o4.ln1@osiris.mauzo.dyndns.org>
Quoth Arndt Jonasson <do-not-use@invalid.net>:
>
> The perldoc says (among other things):
>
> "and you foreach() across a list."
>
> Would it be reasonable to also say that you foreach() across an array,
> since what you do to $_ while looping affects the argument to foreach?
Hmmm... good question :)
I'm going to answer 'no', at the risk of being confusing. You iterate
over a list of aliases into the original array. You may think this is
equivalent, but consider
for my $i (sort @a) {
...
}
: here you are sorting that list of aliases and then iterating over the
sorted list, but they are *still aliases*. You can modify the original
array through them.
Ben
--
It will be seen that the Erwhonians are a meek and long-suffering people,
easily led by the nose, and quick to offer up common sense at the shrine of
logic, when a philosopher convinces them that their institutions are not based
on the strictest morality. [Samuel Butler, paraphrased] ben@morrow.me.uk
------------------------------
Date: Tue, 26 Oct 2004 00:35:30 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: list vs array
Message-Id: <meuqn051erk27nschseeg5n9t9qsonmglo@4ax.com>
On Mon, 25 Oct 2004 10:27:02 -0400, "daniel kaplan"
<nospam@nospam.com> wrote:
>> It seems that I just can't grasp the sense of this man's words...
>> apart that their tone is arrogant and irrespectful...
>
>yes michele, it's all me. i would suggest, you re-read the first 9 posts of
>this thread....am only giving as i am receiving
Huh?!? Let me see...
On Fri, 22 Oct 2004 12:40:48 -0400, "daniel kaplan"
<nospam@nospam.com> wrote:
>could someone please tell the difference between a "list" and an
>"array"...or is it simply the way you reference direct data vs. assigned
>data (to a variable) ?
>
>thanks ahead
This is a FAQ, but you asked gently and I see nothing wrong with this
question...
On 22 Oct 2004 16:46:59 GMT, "A. Sinan Unur"
<1usa@llenroc.ude.invalid> wrote:
>This is a FAQ. Indeed, if you type
>
>perldoc -q "What is the difference between a list and an array?"
>
>on the command line, or look at perlfaq4 in the documentation installed on
>your computer, you will find the answer.
>
>Have you read the posting guidelines for this group? You need to check the
>FAQ list first.
... in fact you have been quite as gently pointed to the FAQ, i.e.
relevant documentation.
On Fri, 22 Oct 2004 13:13:08 -0400, "daniel kaplan"
<nospam@nospam.com> wrote:
>Ok, may I ask this then?
>
>Since I am not using anything commandline, in fact I had to remove Perl and
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
This seems *slightly* arrogant, as far as tone is concerned. And if
you don't use anything from the cmd line, then blame on you, I may
add...
>Debugger from my machine cause of what it did, I am purely working
>remotely....Text here, upload to Server, then run.
... this is simply nonsense for Perl can't have done anything to your
machine. But let's put all this apart and...
>
>What sites then, may I aks, is the main one to go for, fo FAQ? Like
>Perldoc, and Cpan. I have their links saved, but unsure as to their
>relationship..i.e. which one is the main, etc etc?
... let's say that this is an acceptable question too! Notwithstanding
the previous points, that may have irritated someone, you still have
been answered properly and certainly not offensively...
On 22 Oct 2004 17:20:52 GMT, "A. Sinan Unur"
<1usa@llenroc.ude.invalid> wrote:
>"daniel kaplan" <nospam@nospam.com> wrote in
>news:1098465205.879168@nntp.acecape.com:
>
>You need to quote enough of the previous messages to give context.
... here! ...
>> Since I am not using anything commandline, in fact I had to remove
>> Perl and Debugger from my machine cause of what it did,
>
>Let's get one thing straight. Neither Perl nor the debugger did anything to
>your machine. You did it.
... and here...
>> I am purely working remotely....Text here, upload to Server, then run.
>
>Do you have shell access on the server? If so, you can use perldoc on the
>server.
... and here...
>> What sites then, may I aks, is the main one to go for, fo FAQ? Like
>> Perldoc, and Cpan. I have their links saved, but unsure as to their
>> relationship..i.e. which one is the main, etc etc?
>
>http://faq.perl.org/
>
>See also: http://faq.perl.org/perlfaq2.html#What_modules_and_ext
>
>http://www.perldoc.com/
... and here...
Yes, the tone in some points is slightly harsh, but only in a way that
is commensurated to what you wrote in the first place.
On Fri, 22 Oct 2004 13:30:56 -0400, "daniel kaplan"
<nospam@nospam.com> wrote:
>Don't take it against Perl...ActiveState took forever to load on my machine,
>and the before or after speeds are much higher. And please, no personal
>attacks...know enough about kumputers.
He did never attack your person. He was commenting what you wrote and
much in the only direction it would have been reasonable to, for you
say you know enough about computers but what you wrote both in the
last post and in this one *seems* to contradict you.
I *think* that "ActiveState took forever to load on my machine" means
that AS Perl's installation is a lenghty process: yes, it is! So what?
Unless disk space is an issue, I don't see why you shouldn't have a
local version of Perl installed on your system. However much time this
would take IMHO is worth the effort.
Oh, BTW: you are always free to doubt about the truth of my words, but
I have installed different versions of AS Perl and it has never driven
me to impotence...
Also, it is so nonsensincal that it puzzles me as to know what you
mean with "the before or after speeds are much higher" (a sentence
whose semantic content AFAICT is null).
>> http://faq.perl.org/
>Thanks, found it, but then can I ask what CPAN is? Is there a relationship?
Yes, you can ask? Funny enough one of the entries of the FAQ, however
you decide to access it, *is* your question.
>Are they alternatives?
Huh?!? How can two completely different things be alternatives?
On Fri, 22 Oct 2004 17:36:23 GMT, "Paul Lalli" <mritty@gmail.com>
wrote:
>Do you really not see the irony in saying that you just found the FAQ,
>but not checking that FAQ before asking this question?
>
>There is a FAQ that exactly matches your question: "What is CPAN?"
And you were still answered gently!
On Fri, 22 Oct 2004 13:53:47 -0400, "daniel kaplan"
<nospam@nospam.com> wrote:
>> There is a FAQ that exactly matches your question: "What is CPAN?"
>
>I did look, and what I got: CPAN is the Comprehensive Perl Archive Network,
>a large collection of Perl software and documentation. You can begin ......
>
>But I still don't understand the relationship. Is CPAN a subset of Perl?
Personally I find such a question so stupid that I'm not sure if I
would have ever answered to it, but...
On Fri, 22 Oct 2004 18:06:01 GMT, "Paul Lalli" <mritty@gmail.com>
wrote:
>> But I still don't understand the relationship. Is CPAN a subset of
>>Perl?
>
>What part of "a large collection of Perl software and documentation" is
>unclear? And what do you mean by "subset" of Perl? Perl is a language.
>CPAN is a large collection of sofware written in that language and
>documentation about that language.
... you still received an on-topic answer. Yes, it has the *added
value* of a dose of sarcasm, but believe me, I can hardly imagine
anyone avoiding to to reply in a similar way.
So what?!?
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
.'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
------------------------------
Date: Mon, 25 Oct 2004 20:01:32 -0400
From: "Matt Garrish" <matthew.garrish@sympatico.ca>
Subject: Re: list vs array
Message-Id: <vtgfd.5693$rs5.377885@news20.bellglobal.com>
"Michele Dondi" <bik.mido@tiscalinet.it> wrote in message
news:meuqn051erk27nschseeg5n9t9qsonmglo@4ax.com...
>
> I *think* that "ActiveState took forever to load on my machine" means
> that AS Perl's installation is a lenghty process: yes, it is! So what?
>
I've never found the actual perl installation to be lengthy, what can take
forever on a Windows install is the html documentation generation that AS
performs at the end. I've had that process take 10-20 minutes on older
machines, which is a lifetime for most Windows users.
Matt
------------------------------
Date: Mon, 25 Oct 2004 20:45:36 -0400
From: "daniel kaplan" <nospam@nospam.com>
Subject: Re: list vs array
Message-Id: <1098751595.904388@nntp.acecape.com>
..I've never found the actual perl installation to be lengthy, what can take
..forever on a Windows install is the html documentation generation that AS
..performs at the end. I've had that process take 10-20 minutes on older
..machines, which is a lifetime for most Windows users
actually what i was refering to here, my apologies as some of these posts i
ignored, but what i meant was...
"Starting" ActiveState's Komodo (or VisualPerl. I forgot the actual name)
was incredibly slow. I believe someone else here also stated the same.
Actually, I found the entire app ran slow, in many of the functions. It was
so bad that when the trial period was over, they give you an option of
extending it, I actually just uninstalled it.
Not sure this belongs in ths thread anymore tho, as it appears to be quite
off topic. If anyone reading this is looking to discuss I did start the
thread "open-perl-ide qustion" askign for thoughts, and some people
mentioned some. Am curretnly using open-perl-ide and it's not so bad. Not
the most powerful, but not so bad.
------------------------------
Date: 25 Oct 2004 23:00:37 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: list vs scalar context for localtime?
Message-Id: <slrncnr1cl.3ac.abigail@alexandra.abigail.nl>
Uri Guttman (uguttman@athenahealth.com) wrote on MMMMLXXIII September
MCMXCIII in <URL:news:m34qki31en.fsf@linux.local>:
$$ >>>>> "IW" == Ian Wilson <scobloke2@infotop.co.uk> writes:
$$
$$ IW> Which X and Y in `perldoc -X Y` will explain why we need parentheses
$$ IW> around localtime in
$$
$$ -X??
$$
$$ IW> my ($d,$m,$y) = (localtime)[3,4,5];
$$
$$ IW> AFAIK Perl uses parentheses for list context and for precedence, I
$$ IW> think they are used here to force a list context?
$$
$$ IW> In the assignment statement, since the LHS is a list, I'd have thought
$$ IW> it would supply a list context to the RHS anyway.
$$
$$ IW> Also, it superficially appears to me that the [3,4,5] ought to be a
$$ IW> hint that the thing to the left ought not to be interpreted in a
$$ IW> scalar context.
$$
$$ try to parse localtime[3,4,5].
$$
$$ without trying, it looks like illegal syntax. a [] subscript needs a
$$ list or an array (scalar or list mode) to index into. (localhost)
$$ provides the list whereas localhost doesn't.
localtime [3,4,5] is legal syntax. It's equivalent to
localtime ([3,4,5]).
$ perl -wle 'print scalar localtime [3,4,5]'
Sun Apr 21 15:56:32 1974
$
$$ the parens are always for precedence or syntax and (almost) never to
$$ create a list. list/scalar context is provided by nearby code and not by
$$ the list (or what looks like a list) itself.
Here, it's used for precedence: first the function call, then the index.
Abigail
--
print 74.117.115.116.32, 97.110.111.116.104.101.114.32,
80.101.114.108.32, 72.97.99.107.101.114.10;
------------------------------
Date: Mon, 25 Oct 2004 23:33:34 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: list vs scalar context for localtime?
Message-Id: <x7d5z6jrwu.fsf@mail.sysarch.com>
>>>>> "A" == Abigail <abigail@abigail.nl> writes:
A> $$ without trying, it looks like illegal syntax. a [] subscript needs a
A> $$ list or an array (scalar or list mode) to index into. (localhost)
A> $$ provides the list whereas localhost doesn't.
A> localtime [3,4,5] is legal syntax. It's equivalent to
A> localtime ([3,4,5]).
like i said, i didn't try :)
uri
--
Uri Guttman ------ uri@stemsystems.com -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs ---------------------------- http://jobs.perl.org
------------------------------
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.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
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 7306
***************************************