[18251] in Perl-Users-Digest
Perl-Users Digest, Issue: 419 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Mar 5 14:06:07 2001
Date: Mon, 5 Mar 2001 11:05:23 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <983819122-v10-i419@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 5 Mar 2001 Volume: 10 Number: 419
Today's topics:
Re: acronym <dave@dave.org.uk>
Chaning file/folder permission on Windows <gberman@cisco.com>
Re: Commenting problems <peter.sundstrom-eds@eds.com>
Re: Cut the space <mischief@velma.motion.net>
different $/ for different filehandle? <daniel.heiserer@bmw.de>
DynaLoader not building on Slackware Linux <drawson1@earthlink.net>
Fast BSD checksum in perl? <modemch@eventsdigital.com>
Re: flock and close with empty read strangeness (Abigail)
Re: flock and close with empty read strangeness <mischief@velma.motion.net>
Re: Help Matt with small programs THANKS AGAIN!! <ren@tivoli.com>
Re: Help Matt with small programs <ren@tivoli.com>
Re: Help with sockets <dennis.kowalsk@daytonoh.ncr.com>
Re: How to list installed modules (MD5) (Rafael Garcia-Suarez)
Re: How to list installed modules (MD5) (Rafael Garcia-Suarez)
Re: How to list installed modules (MD5) (Anno Siegel)
Re: How to list installed modules (MD5) (Randal L. Schwartz)
Re: How to list installed modules (MD5) <bart.lateur@skynet.be>
IE5 Instances - DBI Connect <tward10@jaguar.com>
Re: length op <mjcarman@home.com>
Millisecond Time Help (Yes I've consulted the FAQ) <donotreply@interbulletin.bogus>
New posters to comp.lang.perl.misc <gbacon@cs.uah.edu>
Newbie - Question about shift <remalone@sympatico.ca>
Re: Newbie - Question about shift <shanem@ll.mit.edu>
Re: Perl Newbie 2 questions <mischief@velma.motion.net>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 05 Mar 2001 18:30:38 +0000
From: Dave Cross <dave@dave.org.uk>
Subject: Re: acronym
Message-Id: <npm7at01da8mjagubb2tjmk1ft3k8v41q4@4ax.com>
On Mon, 05 Mar 2001 10:21:05 GMT, "Tim Fooy" <broertje@pandora.be>
wrote:
>I know this has nothing to do with Perl, but since I can't find a newsgroup
>on PHP I hope I can post the question here: can anyone tell me what the
>letters of PHP stand for? I looked everywhere on the official php site but
>couldn't find it.
>
>Thanks for any suggestions!
<pedant>It's not an acronym tho'</pedant>
Dave...
--
<http://www.dave.org.uk> SMS: sms@dave.org.uk
------------------------------
Date: Mon, 5 Mar 2001 16:26:40 +0200
From: "Gadi Berman" <gberman@cisco.com>
Subject: Chaning file/folder permission on Windows
Message-Id: <983802371.133124@sj-nntpcache-5>
Hi,
Can anyone please tell me how to change permissions on NT files/directories.
I need to add/remove groups from the list and change permissions.
Thanks,
Gadi.
------------------------------
Date: Mon, 5 Mar 2001 11:39:28 +1300
From: "Peter Sundstrom" <peter.sundstrom-eds@eds.com>
Subject: Re: Commenting problems
Message-Id: <97ug7d$i64$1@hermes.nz.eds.com>
"deborah.knight1" <debbie.knight@ntlworld.com> wrote in message
news:Qlxo6.9219$mt.1383445@news2-win.server.ntlworld.com...
> Hello,
>
> I've edited a cgi scrpit using notepad, wordpad and ultraedit, using both
> the # and /*..*/ for comments but none work, with the comments showing up
in
> both netscape and IE from home and my server.
>
> This is the code:
>
> #!/usr/local/bin/perl
>
> /*comment see if it works*/
> #this perhaps
>
> print "content-type:text/html\n\n";
>
> <HTML><HEAD><TITLE>Hiya there</TITLE></HEAD>
> <BODY><H1>Web page</H1></BODY></HTML>
Why are you posting this yet again? Your previous postings received
answers. Did you not understand the answers you received?
------------------------------
Date: Mon, 05 Mar 2001 18:25:25 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: Cut the space
Message-Id: <ta7mgln16mcle3@corp.supernews.com>
Chris Fedde <cfedde@fedde.littleton.co.us> wrote:
> In article <97sk62$7ig$1@eng-ser1.erg.cuhk.edu.hk>,
> Ivan Leung <khleung@cse.cuhk.edu.hk> wrote:
>>How can I cut the blank space(s) at the end of a string?
>>
>>Thanks.
>>
> this is documented in the faq:
> perlfaq blank
It's not entirely clear what is wanted here. Is it,
1.) strip any extra spaces at both ends (front and back) of a
string with the extra effect of squashing multiple whitespace
characters within the string to single spaces
2.) strip the extra spaces at the front and back of a string
with no extra effects
3.) strip just extra spaces at the back end of a string with
no extra effects
So, I've included an example of each. `perldoc perlop' and
`perldoc perlre' should help someone find out how these work.
The example numbers match the questions asked above.
Example 1
#########
A bunch of posts about the efficiency of ways to do this went by
a few months ago. I believe the group came to a conclusion that
the following is fastest, although it has the (sometimes but not
always desirable) side effect that it squashes tabs and multiple
spaces in the middle of the text to single spaces.
If the side effect is desirable, then this may be the best bet.
I've found that the question of squashing multiple spaces has
come up close to the one about trimming the ends pretty often,
so I offer this as a possible alternative.
$string =~ tr/\t / /s;
$string =~ s/^\s//;
$string =~ s/\s$//;
Example 2
#########
If you don't want the side effect and want to do it in one line,
$string =~ s/^\s+|\s+$//g;
should do the trick. This is probably not as efficient as the one
in the FAQ, but it works and is reasonably clear.
Example 3
#########
If you really want to strip extra spaces at the `end' of the line,
meaning after everything, as opposed to the `ends' of the line (start
and finish), then this is all you need:
$string =~ s/\s+$//;
That should be a clear and fairly quick way to do it.
I hope at least one of these is helpful.
Chris
--
Christopher E. Stith
Even in the worst of times, there is always someone who's
never had it better. Even in the best of times, there is
always someone who's never had it worse.
------------------------------
Date: Mon, 05 Mar 2001 17:43:10 +0100
From: Daniel Heiserer <daniel.heiserer@bmw.de>
Subject: different $/ for different filehandle?
Message-Id: <3AA3C21E.6DB095CB@bmw.de>
This is a multi-part message in MIME format.
--------------61B6EB80F8419D3F92A9CE54
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Hi,
is there away to have different Input-record-separators
for different Filehandles.
e.g.
open(ip1,"<gf1");
open(ip2,"<gf2");
$/="\n"; #for gf1
$/="prompt>"; #for gf2
thanks, daniel
--------------61B6EB80F8419D3F92A9CE54
Content-Type: text/x-vcard; charset=us-ascii;
name="daniel.heiserer.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Card for Daniel Heiserer
Content-Disposition: attachment;
filename="daniel.heiserer.vcf"
begin:vcard
n:Daniel;Heiserer,
tel;fax:41696
tel;home:1409782
tel;work:21187
x-mozilla-html:FALSE
adr:;;;;;;
version:2.1
email;internet:daniel.heiserer@bmw.de
x-mozilla-cpt:;-3136
fn:Heiserer, Daniel
end:vcard
--------------61B6EB80F8419D3F92A9CE54--
------------------------------
Date: Mon, 05 Mar 2001 17:25:31 GMT
From: Dan Rawson <drawson1@earthlink.net>
Subject: DynaLoader not building on Slackware Linux
Message-Id: <omh7ato4c4h8isl4cgj634hgmljkecqos1@4ax.com>
I'm trying to build 5.6.0 on Slackware Linux, but the DynaLoader.a
file never builds (and therefore Perl won't build . . . ).
5.005003 built successfully on this system.
I've tried to work my way through the various make files, but I
haven't been able to determine where it's failing . . . only that
lib/auto/DynaLoader/DynaLoader.a doesn't exist.
TIA . . . .
Dan
------------------------------
Date: 05 Mar 2001 13:57:43 -0500
From: Modemch <modemch@eventsdigital.com>
Subject: Fast BSD checksum in perl?
Message-Id: <ulmqkoxg8.fsf@eventsdigital.com>
Hi All.
I'm trying to write a fast BSD checksum algorithm in perl, and, so far, the
results are real bad. I'm using sysread, then unpack to an array, and then
checksum the array. It's extremely slow compared to the 'sum' command.
With C++, I'm doing this - works great:
c = instream.get();
while (!instream.eof()) {
/* Right-rotate the 32-bit checksum */
if (checksum & 1)
checksum = (checksum >> 1) + 0x8000;
else
checksum >>= 1;
checksum += c;
checksum &= 0xffff;
c = instream.get();
}
Is there a real easy way to do this in perl that I'm just missing? the
unpack function can do checksums, but I need the BSD one, and not the one
it does. Thanks in advance.
--
Regards,
Modemch
------------------------------
Date: 5 Mar 2001 15:24:35 GMT
From: abigail@foad.org (Abigail)
Subject: Re: flock and close with empty read strangeness
Message-Id: <slrn9a7btj.8a8.abigail@tsathoggua.rlyeh.net>
ZepHead (groovyt@erols.com) wrote on MMDCCXLIII September MCMXCIII in
<URL:news:groovyt-1A1DC2.02344005032001@virt-reader.news.rcn.net>:
`` In article <6r94at02303mce70v55o8jcc5608ef95bp@4ax.com>,
`` Bart Lateur <bart.lateur@skynet.be> wrote:
``
``
`` > least, there should be at least one file mode that DOES create a file if
`` > it didn't exist, DOES NOT truncate the file, and leaves the seek pointer
`` > at the start of the file. Like "+<", but with built-in
`` > create-if-missing. And which is garanteed to work across platforms.
`` > You'd still have to truncate by hand, or maybe, just maybe, the file
`` > could be automatically be truncated as soon as you write to the file.
`` >
``
`` yep
``
`` IMHO any function that messes with a file (in any sway)
`` should never mess with that file unless there is a lock.
`` (I guess NT has this part right)
So, while I'm reading /etc/passwd, the system administrator cannot
add new accounts?
I don't think so.
Abigail
--
perl5.004 -wMMath::BigInt -e'$^V=Math::BigInt->new(qq]$^F$^W783$[$%9889$^F47]
.qq]$|88768$^W596577669$%$^W5$^F3364$[$^W$^F$|838747$[8889739$%$|$^F673$%$^W]
.qq]98$^F76777$=56]);$^U=substr($]=>$|=>5)*(q.25..($^W=@^V))=>do{print+chr$^V
%$^U;$^V/=$^U}while$^V!=$^W'
------------------------------
Date: Mon, 05 Mar 2001 17:48:56 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: flock and close with empty read strangeness
Message-Id: <ta7kc8i69qr452@corp.supernews.com>
Bart Lateur <bart.lateur@skynet.be> wrote:
> ZepHead wrote:
>>how about <<
>>
>>this would read only and create and not truncate
> What's the purpose of creating a file that you can't write to? No, sis,
> creating of and writing to a file are connected. No create without
> write.
Especially since create and write require similar privs on the OS level.
Can you imagine the headache of implementing "if the user has write
permissions on the directory, they can read a file that doesn't exist"?
Chris
--
Christopher E. Stith
It's not the U in UBE that pisses people off. It's the B.
-- Martien Verbruggen in clp.misc
------------------------------
Date: 05 Mar 2001 09:42:08 -0600
From: Ren Maddox <ren@tivoli.com>
Subject: Re: Help Matt with small programs THANKS AGAIN!!
Message-Id: <m38zmkdxyn.fsf@dhcp9-175.support.tivoli.com>
On Fri, 2 Mar 2001, mshort@usol.com wrote:
> HA!!! I got it!!
>
> $num=0;
> while ($num>=0){
> $num++;
> next if (int($num / 5) != ($num/5));
> last if $num==100;
> print "$num ";$num++;
> }
Now you are incrementing $num twice any time you print it. It works,
since if a number matches your criteria (divisible by 5, which, BTW,
is more succinctly expressed as "next if $num % 5;"), then the next
number obviously isn't going to match. But I doubt that's how you
intend for it to work, otherwise, you might as well just increment by
5 each time.
As has already been mentioned, the *right* way to handle this
incrementing is either to put it in a continue block, or use a c-style
for loop.
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: 05 Mar 2001 09:56:40 -0600
From: Ren Maddox <ren@tivoli.com>
Subject: Re: Help Matt with small programs
Message-Id: <m34rx8dxaf.fsf@dhcp9-175.support.tivoli.com>
On 3 Mar 2001, abigail@foad.org wrote:
> {local $, = " ";
> print grep {$_ % 5 == 0} 0 .. 99
> }
For that much verbiage, you might as well just use join:
print join " ", grep { $_ % 5 == 0 } 0 .. 99;
or, golf style:
print join" ",grep!($_%5),0..99
of course, skipping the local for golf gives:
$,=" ";print grep!($_%5),0..99
which can be improved to:
$,=$";print grep!($_%5),0..99
--
Ren Maddox
ren@tivoli.com
------------------------------
Date: Mon, 5 Mar 2001 09:55:33 -0500
From: "Dennis Kowalski" <dennis.kowalsk@daytonoh.ncr.com>
Subject: Re: Help with sockets
Message-Id: <3aa3a8e5$1@rpc1284.daytonoh.ncr.com>
I humbly ask for forgiveness of my stupidity.
Your example does indeed work. I just suceeded in sending a message to the
server and getting a reply back.
What confused me in the example was the nature of it.
It is in effect, both the server and client programs.
That messed up my thinking because my server is not me but a program on
another host.
I did the fork, sent the msg in the parent and got the reply in the child.
I am still leaning this stuff.
Thanks again
Ben L. <um@no.com> wrote in message news:3aa00c14$1_2@news2.one.net...
> Yes, the IPC page DOES have an example, exactly the same one that I
pointed
> out. I understand what you are trying to do, and you can't do it the same
> way in Perl that you do in C. In Perl, if you open a socket to a remote
> host, and you write to the socket and then right after that you try to
read
> from the socket to get the remote host's response, it WILL NOT WORK. If
you
> fork() your process, and write in the parent and read in the child, you
are
> still using the same socket, and you can then send and receive with your
> remote host without your script failing.
>
> If you were to actually look at the example I mentioned, *INTERACTIVE*
> client example using IO::Socket, you would see that the example SENDS and
> RECEIVES using the SAME socket, like your C program does.
>
>
> > I have checked the IPC web pages and they all show examples of a connect
> and
> > then a read, but I have not found an example of one that sends and
> receives.
>
> You didn't check very well; I gave you the exact URL and the exact
> section that demonstrates what you want to do:
>
> > > http://www.perl.com/pub/doc/manual/html/pod/perlipc.html
> > >
> > > Check out the interactive client example under the TCP with IO::Socket
> > > section. Enjoy!
> > >
>
>
------------------------------
Date: Mon, 05 Mar 2001 14:15:54 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: How to list installed modules (MD5)
Message-Id: <slrn9a77sb.ob9.rgarciasuarez@rafael.kazibao.net>
Anno Siegel wrote in comp.lang.perl.misc:
> According to Børge Haga <borge.haga@nextra.spamno.com.invalid>:
> > 1) This is probably a stupid question, but is there an easy way to detect
> > which modeules have been installed for a Perl installation? I need to
> > have MD5 installed, but I'm not sure if it's part of the standard
> > distribution and I don't even know which distribution have been
> > installed on the machine in question.
>
> "perldoc perllocal" gives you a list of modules that have been
> installed via the CPAN module. This excludes modules that come
> with the standard distribution and those that have been installed
> by other means than CPAN (even if they are distributed on CPAN).
Are you sure ? Modules packaged with MakeMaker should update
perllocal.pod, even if they're not installed via CPAN.pm.
See the manpage for ExtUtils::MakeMaker :
[...]
make install per default writes some documentation of what has been
done into the file `$(INSTALLARCHLIB)/perllocal.pod'.
[...]
--
Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/
------------------------------
Date: Mon, 05 Mar 2001 14:17:47 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: How to list installed modules (MD5)
Message-Id: <slrn9a77vs.ob9.rgarciasuarez@rafael.kazibao.net>
Sam Kington wrote in comp.lang.perl.misc:
> "Børge Haga" wrote:
> >
> > 1) This is probably a stupid question, but is there an easy way to detect
> > which modeules have been installed for a Perl installation? I need to
> > have MD5 installed, but I'm not sure if it's part of the standard
> > distribution and I don't even know which distribution have been
> > installed on the machine in question.
>
> One way is
> eval {
> use MD5;
> };
> if ($@) {
> print "MD5 not installed\n";
> } else {
> print "MD5 installed at ",$INC{"MD5.pm"},"\n";
> }
A more elaborate way would be the following script, that I found useful:
#!/usr/local/bin/perl
# pmver : Prints versions and locations of modules passed to the command-line.
# -l prints only the location (useful in shell commands such as
# view `pmver -l Foo::Bar`).
use Getopt::Std;
getopts('l');
die "Usage: $0 [-l] module-names...\n" unless $#ARGV > -1;
for (@ARGV) {
if (eval "require $_") {
unless ($opt_l) {
my $v = ${"${_}::VERSION"} || 'no version number';
print qq($_: $v\n);
}
tr!:!/!s;
print qq( Located at ) unless $opt_l;
print qq($INC{"$_.pm"}\n);
} else {
print "$_: not found\n" unless $opt_l;
}
}
__END__
--
Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/
------------------------------
Date: 5 Mar 2001 14:31:54 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: How to list installed modules (MD5)
Message-Id: <98080q$9j8$3@mamenchi.zrz.TU-Berlin.DE>
According to Rafael Garcia-Suarez <rgarciasuarez@free.fr>:
> Anno Siegel wrote in comp.lang.perl.misc:
> > According to Børge Haga <borge.haga@nextra.spamno.com.invalid>:
> > > 1) This is probably a stupid question, but is there an easy way to detect
> > > which modeules have been installed for a Perl installation? I need to
> > > have MD5 installed, but I'm not sure if it's part of the standard
> > > distribution and I don't even know which distribution have been
> > > installed on the machine in question.
> >
> > "perldoc perllocal" gives you a list of modules that have been
> > installed via the CPAN module. This excludes modules that come
> > with the standard distribution and those that have been installed
> > by other means than CPAN (even if they are distributed on CPAN).
>
> Are you sure ? Modules packaged with MakeMaker should update
> perllocal.pod, even if they're not installed via CPAN.pm.
> See the manpage for ExtUtils::MakeMaker :
>
> [...]
> make install per default writes some documentation of what has been
> done into the file `$(INSTALLARCHLIB)/perllocal.pod'.
> [...]
Now you mention it, I realize I'm not entirely sure.
So it's the MakeMaker-generated Makefile, not CPAN.pm that does it,
which makes quite some sense. This would mean that perllocal.pod
should be pretty much up to date for all modules that come from CPAN.
Anno
------------------------------
Date: 05 Mar 2001 06:36:51 -0800
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: How to list installed modules (MD5)
Message-Id: <m1ae70e0zg.fsf@halfdome.holdit.com>
>>>>> "Rafael" == Rafael Garcia-Suarez <rgarciasuarez@free.fr> writes:
Rafael> A more elaborate way would be the following script, that I found useful:
Rafael> #!/usr/local/bin/perl
Rafael> # pmver : Prints versions and locations of modules passed to the command-line.
Rafael> # -l prints only the location (useful in shell commands such as
Rafael> # view `pmver -l Foo::Bar`).
Rafael> use Getopt::Std;
Rafael> getopts('l');
Rafael> die "Usage: $0 [-l] module-names...\n" unless $#ARGV > -1;
Rafael> for (@ARGV) {
Rafael> if (eval "require $_") {
Rafael> unless ($opt_l) {
Rafael> my $v = ${"${_}::VERSION"} || 'no version number';
Rafael> print qq($_: $v\n);
Rafael> }
Rafael> tr!:!/!s;
Rafael> print qq( Located at ) unless $opt_l;
Rafael> print qq($INC{"$_.pm"}\n);
Rafael> } else {
Rafael> print "$_: not found\n" unless $opt_l;
Rafael> }
Rafael> }
Rafael> __END__
Even fancier, lifted (mostly) from the CPAN manpage, with a lot
less heavy lifting on your part:
@ARGV = qw(CGI LWP HTTP::Daemon); # demo
use CPAN;
for $mod (CPAN::Shell->expand("Module", @ARGV)) {
printf "Module %s is installed as %s, CPAN version is %s\n",
$mod->id, $mod->inst_version, $mod->cpan_version;
}
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
------------------------------
Date: Mon, 05 Mar 2001 15:55:51 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: How to list installed modules (MD5)
Message-Id: <bad7at43mf3r6h45sv5h7m5icd6rsalt4u@4ax.com>
Børge Haga wrote:
>1) This is probably a stupid question, but is there an easy way to detect
>which modeules have been installed for a Perl installation? I need to
>have MD5 installed, but I'm not sure if it's part of the standard
>distribution and I don't even know which distribution have been
>installed on the machine in question.
use MD5;
If it's not installed, the script won't run. You can try this at the
command line, if you can telnet in:
perl -MMD5 -e ''
If it doesn't complain, the file is installed.
>2) If it's not installed, where is the correct place to go and get it?
CPAN (<search.cpan.org>), or Activestate's website if it's for Win32
(under /PPMpackages/5.6/). Also check out the FAQ in perlfaq8:
* How do I install a module from CPAN?
* How do I keep my own module/library directory?
--
Bart.
------------------------------
Date: Mon, 5 Mar 2001 14:36:50 -0000
From: "Trevor Ward" <tward10@jaguar.com>
Subject: IE5 Instances - DBI Connect
Message-Id: <9808a3$ocj11@eccws12.dearborn.ford.com>
Here is a weird problem we are having.
Have CGI program which names the browser window when opened. To stop the CGI
program being run in multiple windows.
This works great in Netscape the program always runs in the browser window
it was originally run in. In IE it doesn't and we get DBI connect errors.
The reason we need it to run in the same window is if you have two
instyances of the cgi programs running the DBI connect reference gets
messed up.
I know this is really a browser issue but I was hoping somebody may have hit
this problem before. and be able to enlighten us to a solution. Or
alternatively HELP please so far our production Database Password has been
displayed. whoops but fixed the error display problem.
------------------------------
Date: Mon, 05 Mar 2001 08:06:42 -0600
From: Michael Carman <mjcarman@home.com>
Subject: Re: length op
Message-Id: <3AA39D72.3CAFC5F3@home.com>
Tassilo von Parseval wrote:
>
> "Eduard Grinvald" <eg344@nyu.edu> wrote:
>
>> After preprocessing my data, i saw that 104megs of text, when parsed,
>> where taking up [...]
>
> You say you want to put aprox. 104 MB of textual data into hashes?
> Well, putting it carefully, I doubt that this is a) a good idea and b)
> possible at all.
While I tend to agree with you on A, I don't at all on B. Straight from
the perl manpage:
[...] Perl does not arbitrarily limit the size of your data--if
you've got the memory, Perl can slurp your whole file as a single
string.
So our friend just needs plenty of RAM. I'd be more worried about having
key collisions in the hashing function that (perl-caused) memory
limitations.
-mjc
------------------------------
Date: Mon, 05 Mar 2001 16:53:54 +0000
From: Steven Morrow <donotreply@interbulletin.bogus>
Subject: Millisecond Time Help (Yes I've consulted the FAQ)
Message-Id: <3AA3C4A2.19D49B47@interbulletin.com>
I'm trying to time stamp data entries, but second time is not of high enough resolution to be unique.
I have consulted perlfaq8 which suggests using Time::HiRes to get time of day to fractional seconds, but have had problems with the module.
I am using Windows NT 4.0 with Active Perl v5.6.0 bulit for MSWin32-x86-multi-thread.
I downloaded the Time::HiRes module from CPAN and extracted it to my c:\perl\site\lib directory. The direcory for the module is c:\perl\site\lib\Time-HiRes-01.20. When I ran 'nmake test' everything tested and worked OK.
Then I tried to manually run the test perl script.
perl 01test.t (I'm not sure why they used the extention .t) and got the following response:
Can't locate loadable object for module Time::Hires in @INC (@INC contains: C:/PERL/lib c:/PERL/site/lib .) at 01test.t line 11
Compilation failed in require at 01test.t line 11.
BEGIN failed--compilation aborted at 01test.t line 11.
Any help would be appreciated.
Thanks in Advance,
Steven Morrow
snjmorrow@hotmail.com
_______________________________________________
Submitted via WebNewsReader of http://www.interbulletin.com
------------------------------
Date: Mon, 05 Mar 2001 16:08:57 -0000
From: Greg Bacon <gbacon@cs.uah.edu>
Subject: New posters to comp.lang.perl.misc
Message-Id: <ta7egpfc83kh30@corp.supernews.com>
Following is a summary of articles from new posters spanning a 7 day
period, beginning at 26 Feb 2001 16:09:16 GMT and ending at
05 Mar 2001 21:59:39 GMT.
Notes
=====
- A line in the body of a post is considered to be original if it
does *not* match the regular expression /^\s{0,3}(?:>|:|\S+>|\+\+)/.
- All text after the last cut line (/^-- $/) in the body is
considered to be the author's signature.
- The scanner prefers the Reply-To: header over the From: header
in determining the "real" email address and name.
- Original Content Rating (OCR) is the ratio of the original content
volume to the total body volume.
- Find the News-Scan distribution on the CPAN!
<URL:http://www.perl.com/CPAN/modules/by-module/News/>
- Please send all comments to Greg Bacon <gbacon@cs.uah.edu>.
- Copyright (c) 2001 Greg Bacon.
Verbatim copying and redistribution is permitted without royalty;
alteration is not permitted. Redistribution and/or use for any
commercial purpose is prohibited.
Totals
======
Posters: 143 (38.5% of all posters)
Articles: 301 (22.9% of all articles)
Volume generated: 610.6 kb (24.2% of total volume)
- headers: 250.0 kb (4,920 lines)
- bodies: 352.8 kb (11,715 lines)
- original: 237.3 kb (8,293 lines)
- signatures: 7.5 kb (159 lines)
Original Content Rating: 0.673
Averages
========
Posts per poster: 2.1
median: 1 post
mode: 1 post - 84 posters
s: 3.0 posts
Message size: 2077.4 bytes
- header: 850.6 bytes (16.3 lines)
- body: 1200.2 bytes (38.9 lines)
- original: 807.3 bytes (27.6 lines)
- signature: 25.5 bytes (0.5 lines)
Top 10 Posters by Number of Posts
=================================
(kb) (kb) (kb) (kb)
Posts Volume ( hdr/ body/ orig) Address
----- -------------------------- -------
26 48.0 ( 25.1/ 22.9/ 14.9) "Parrot" <parrot0123@yahoo.ca>
13 21.2 ( 10.2/ 11.0/ 6.1) "Ben L." <um@no.com>
11 27.7 ( 8.7/ 19.0/ 8.8) "Joe Williams" <joeykid6@yahoo.com>
9 22.5 ( 9.4/ 13.1/ 7.5) "Bill Kelly" <billk@cts.com>
8 13.2 ( 7.4/ 5.8/ 3.3) Micah Cowan <micah@cowanbox.com>
8 19.9 ( 8.6/ 11.3/ 5.5) stan_no_spam_for_me@alamo.nmsu.edu
7 14.9 ( 6.3/ 8.6/ 3.6) "Dave Brondsema" <brondsema@my-deja.com>
6 10.6 ( 4.9/ 5.7/ 3.4) Miguel Cruz <mnc@admin.u.nu>
5 10.4 ( 5.0/ 4.0/ 2.5) Ilmari Karonen <usenet11380@itz.pp.sci.fi>
5 10.5 ( 3.6/ 6.9/ 3.8) "Holly Bortfeld" <maximom@mindspring.com>
These posters accounted for 7.5% of all articles.
Top 10 Posters by Volume
========================
(kb) (kb) (kb) (kb)
Volume ( hdr/ body/ orig) Posts Address
-------------------------- ----- -------
48.0 ( 25.1/ 22.9/ 14.9) 26 "Parrot" <parrot0123@yahoo.ca>
27.7 ( 8.7/ 19.0/ 8.8) 11 "Joe Williams" <joeykid6@yahoo.com>
26.1 ( 1.7/ 24.4/ 20.8) 2 "PhillyFan" <philly_fan1@hotmail.com>
22.5 ( 9.4/ 13.1/ 7.5) 9 "Bill Kelly" <billk@cts.com>
21.2 ( 10.2/ 11.0/ 6.1) 13 "Ben L." <um@no.com>
19.9 ( 8.6/ 11.3/ 5.5) 8 stan_no_spam_for_me@alamo.nmsu.edu
14.9 ( 6.3/ 8.6/ 3.6) 7 "Dave Brondsema" <brondsema@my-deja.com>
13.6 ( 2.2/ 11.3/ 2.0) 3 Shazad Iqbal <iqbals8@cs.man.ac.uk>
13.2 ( 7.4/ 5.8/ 3.3) 8 Micah Cowan <micah@cowanbox.com>
10.6 ( 4.9/ 5.7/ 3.4) 6 Miguel Cruz <mnc@admin.u.nu>
These posters accounted for 8.6% of the total volume.
Top 10 Posters by OCR (minimum of three posts)
==============================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
0.998 ( 3.3 / 3.3) 3 "Kalle Anka" <kalle@tvettsvamp.a.se>
0.975 ( 1.8 / 1.8) 3 "Public <Anonymous_Account>" <remailer@anon.xg.nu>
0.859 ( 3.6 / 4.1) 3 Ken Brown <Ken.Brown@DIALWRAP.COM>
0.818 ( 1.1 / 1.3) 3 "deborah.knight1" <debbie.knight@ntlworld.com>
0.778 ( 3.5 / 4.5) 3 kj Copeland <kj@codegeek.org>
0.770 ( 1.3 / 1.7) 3 ivo welch <ivo.nospam@yale.edu>
0.746 ( 4.8 / 6.5) 3 newsone@cdns.caNOSPAM
0.730 ( 1.8 / 2.5) 3 Ilmari Karonen <usenet11383@itz.pp.sci.fi>
0.727 ( 2.6 / 3.6) 4 Ilmari Karonen <usenet11381@itz.pp.sci.fi>
0.708 ( 4.7 / 6.6) 3 "Sharon Weis" <stiroff@elsitech.com>
Bottom 10 Posters by OCR (minimum of three posts)
=================================================
(kb) (kb)
OCR orig / body Posts Address
----- -------------- ----- -------
0.568 ( 3.3 / 5.8) 8 Micah Cowan <micah@cowanbox.com>
0.556 ( 6.1 / 11.0) 13 "Ben L." <um@no.com>
0.553 ( 3.8 / 6.9) 5 "Holly Bortfeld" <maximom@mindspring.com>
0.536 ( 2.5 / 4.6) 4 "Matthew Azzaro" <azzaro@oswego.edu>
0.483 ( 5.5 / 11.3) 8 stan_no_spam_for_me@alamo.nmsu.edu
0.471 ( 1.5 / 3.2) 3 "Aaron Cline" <acline@okstateerasecaps.edu>
0.463 ( 8.8 / 19.0) 11 "Joe Williams" <joeykid6@yahoo.com>
0.423 ( 3.6 / 8.6) 7 "Dave Brondsema" <brondsema@my-deja.com>
0.246 ( 0.8 / 3.3) 3 Eric Liao <ekliao@pacbell.net>
0.174 ( 2.0 / 11.3) 3 Shazad Iqbal <iqbals8@cs.man.ac.uk>
28 posters (19%) had at least three posts.
Top 10 Targets for Crossposts
=============================
Articles Newsgroup
-------- ---------
35 comp.lang.perl.modules
29 comp.unix.programmer
14 comp.unix.shell
12 comp.unix.solaris
12 comp.unix.questions
4 alt.drugs.hard
4 alt.flame
4 alt.2600
3 alt.perl
3 comp.lang.c
Top 10 Crossposters
===================
Articles Address
-------- -------
9 "Public <Anonymous_Account>" <remailer@anon.xg.nu>
6 Edouard MERCIER <emercier@net2s.com>
5 nl-pm@amsterdam.pm.org
3 foo <foo8259@yahoo.com>
3 mayer32@relay.bfl.at
3 Eric Liao <ekliao@pacbell.net>
3 "J.A. Gutierrez" <spd@daphne.cps.unizar.es>
3 W Scott Joynes <wayne@joynes.fsbusiness.co.uk>
3 Edouard MERCIER <emerciern@et2s.com>
3 "John Pritchard-Williams" <monojohnny@yahoo.com>
------------------------------
Date: Mon, 05 Mar 2001 18:38:40 GMT
From: "Rick M" <remalone@sympatico.ca>
Subject: Newbie - Question about shift
Message-Id: <Q2Ro6.372584$JT5.11938549@news20.bellglobal.com>
Hi,
I have seen this in a number of scripts and can't quite figure it out.
my $var = shift;
Would someone be kind enough to elaborate on the books explanation,
pp 189 of Programming Perl 2nd ed.
I am guessing that this is totally different that
shift(@array);
Thank you
Rick M
------------------------------
Date: Mon, 05 Mar 2001 14:05:18 -0500
From: Shane McDaniel <shanem@ll.mit.edu>
Subject: Re: Newbie - Question about shift
Message-Id: <3AA3E36E.A662490@ll.mit.edu>
I'm assuming this was the first line in a subroutine. I don't have the
book infront of me.
Something you'll need to learn about perl are the default variable, or
at least that's what I call them. They are $_ and @_, there's probably
a %_ though I'm not sure what for.
When you call a subroutine the parameters are put in @_ and passed to
the subroutine. In the subroutine you get the parameters off of the
array by doing
my $var = shift @_;
remember though that I called $_ and @_ "default" variables. Therefor
if I don't give shift an arguement it will automatically use @_ as it's
arguement. therefor the line above becomes
my $var = shift;
Lots of functions use $_ and @_ so it's good to get used to them.
here's another examble
foreach (@array) <=> foreach $_ (@array)
{ print ; } <=> { print $_; }
Rick M wrote:
>
> Hi,
> I have seen this in a number of scripts and can't quite figure it out.
> my $var = shift;
> Would someone be kind enough to elaborate on the books explanation,
> pp 189 of Programming Perl 2nd ed.
>
> I am guessing that this is totally different that
> shift(@array);
>
> Thank you
> Rick M
------------------------------
Date: Mon, 05 Mar 2001 18:02:40 -0000
From: Chris Stith <mischief@velma.motion.net>
Subject: Re: Perl Newbie 2 questions
Message-Id: <ta7l60hikohod2@corp.supernews.com>
Godzilla! <godzilla@stomp.stomp.tokyo> wrote:
> Aaron Cline wrote:
> (snippage)
>> I need to know how to search though a screen returned
>> from a program...
> This is not possible. You cannot search a display screen.
On some systems you actually can read text out of display memory.
What the OP probably wants, though, is to simply redirect STDOUT
of one program to STDIN of another, and grab the information from
there.
Since this is the part that's working for the OP, the helpful thing
would be to give him a regex to grabe the info he wants -- or to
show how to delete the unwanted parts, as you have done way down
towards the end of your post. Helpful, if the OP decides to read
that far. :-)
Chris
--
Christopher E. Stith
People understand instinctively that the best way for computer programs to
communicate with each other is for each of the them to be strict in what they
emit, and liberal in what they accept. The odd thing is that people themselves
are not willing to be strict in how they speak, and liberal in how they listen.
-- Larry Wall, 2nd State of the Onion Address, August 1998
------------------------------
Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.
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 419
**************************************