[16375] in Perl-Users-Digest
Perl-Users Digest, Issue: 3787 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jul 24 18:05:50 2000
Date: Mon, 24 Jul 2000 15:05:23 -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: <964476322-v9-i3787@ruby.oce.orst.edu>
Content-Type: text
Perl-Users Digest Mon, 24 Jul 2000 Volume: 9 Number: 3787
Today's topics:
Re: Anyone working on any XS books? <dan@tuatha.sidhe.org>
Re: batch ping <remarqNOreSPAM@doolittle.net.invalid>
Re: Callback in SNMP module <mcnuttj@nin.iats.missouri.edu>
cgi-perl <gvinjamu@cceb.upenn.edu>
Re: close(STDOUT) trick doesn't seem to work when HTTP/ (brian d foy)
Re: compiling perl on NT into an exec. <theglauber@my-deja.com>
Creating and Deleting a file. <cajual@hotmail.com>
Re: Creating and Deleting a file. <makarand_kulkarni@my-deja.com>
Re: File & Directory Reading <billy@arnis-bsl.com>
Re: file extension <danielxx@bart.nl>
Re: file extension <danielxx@bart.nl>
Re: golf apocalypse post-mortem? (Craig Berry)
Re: Hash within an array problem (Tad McClellan)
Re: help w/ regular expression <nospam@nospam.com>
Re: help w/ regular expression <bart.lateur@skynet.be>
Re: help w/ regular expression <lr@hpl.hp.com>
Re: HELP: longSyntax ok, but: rHsh->{myKey} UNDEFINED?? (David Combs)
Re: How to loop like this - for(a000 ... x999) ??? (Craig Berry)
Re: How to loop like this - for(a000 ... x999) ??? <thoren@southern-division.com>
Re: Installing BerkeleyDB on RedHat 6 lsobilo@whitingcorp.com
Re: IO:Socket and Timeout => "5" ? <postmaster@rask.nospam.kampsax.k-net.dk>
Re: Keeping quoted text intact within a split (Pat Traynor)
Need bookmark script <randythefirstNOraSPAM@hotmail.com.invalid>
Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 24 Jul 2000 18:48:16 GMT
From: Dan Sugalski <dan@tuatha.sidhe.org>
Subject: Re: Anyone working on any XS books?
Message-Id: <Qb0f5.4649$f_5.22943@news1.rdc1.ct.home.com>
Drew Simonis <care227@attglobal.net> wrote:
> brian d foy wrote:
>>
>> > At TPC last week I think I overheard one of the O'Reilly editors
>> > chatting with one of the Perl gurus about his (guru's) working on
>> > an XS book for O'Reilly, but I can't remember now which guru it
>> > was, unfortunately.
>>
>> it's not something that i saw on the seasonal list from ORA, although
>> it is one of the books that i suggested to Manning.
>>
>> writing an XS book might be a foolhardy thing now that Perl 6 might
>> not even have XS.
>>
> brian,
> Have you heard about any replacment for the functionality XS provides?
> Or is XS thought to be too cumbersome to wield effectively?
I'll be very surprised if there's not some way to write extensions to perl
in a compiled langauge (C, C++, Fortran, whatever). Whether it takes on
the same form as the current XS interface is quite up in the air. (The
current interface is... rather lacking in many ways)
Dan
------------------------------
Date: Mon, 24 Jul 2000 12:21:42 -0700
From: pldoolittle <remarqNOreSPAM@doolittle.net.invalid>
Subject: Re: batch ping
Message-Id: <129d2255.d424f730@usw-ex0107-055.remarq.com>
Ade Talabi <adetalabi@clara.co.uk> wrote:
>you either set up a matrix of 30x100 and use 30 threads to ping
each
>column...
>
>the pinging would take you at most 5 mins...
>
>a pinging along the 30 columsn with 100 threads would probably
take
>about 2 mins....
>
>
>happy pinging...
>
>"Timothy R. Kriz" wrote:
>>
>> I have the need to ping over 3000 machines once a day to check
for
>> connections.
>> I can make my script ping 1 machine at a time, but would like
to issue,
>> say, 50 pings a time.
>> Is this a fork, or is there a more simple way?
>> Any suggestions appreciated.
>>
>> Tim
>
>--
>We see, whatever we want to see, whether visible or not
>- AT. June 2000.
>
>
-----------------------------------------------------------
Got questions? Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com
------------------------------
Date: 24 Jul 2000 19:49:35 GMT
From: Justin McNutt <mcnuttj@nin.iats.missouri.edu>
Subject: Re: Callback in SNMP module
Message-Id: <8li6kf$vb3$1@dipsy.missouri.edu>
Justin McNutt <mcnuttj@nin.iats.missouri.edu> wrote:
> Okay, I've looked all over the place (including 'perldoc SNMP' over and
> over) and I can't figure out how to do this.
> Here's the basic idea:
> I want to send a *lot* (~65000) SNMP 'GET's asynchronously, and collect
> the data in a hash as it returns. According to the perldoc page for UCDs
> SNMP module:
> $sess->getnext(<vars> [,<callback>])
> do SNMP GETNEXT, multiple <vars> formats accepted,
> returns retrieved value(s), <vars> passed as
> arguments are updated to indicate next
> lexicographical <obj>,<iid>,<val>, and <type>
> Note: simple string <vars>,(e.g., 'sysDescr.0') form
> is not updated. If <callback> supplied method will
> operate asyncronously
> And furthermore:
> Acceptable callback formats
> <callback> may be one of the following forms:
[snip]
> [ \&subname, $arg1, ... ]
[snip]
> &SNMP::MainLoop([<timeout>, [<callback>]])
> to be used with async SNMP::Session calls. MainLoop
> must be called after initial async calls so return
> packets from the agent will not be processed. If no
> args suplied this function enters an infinite loop so
> program must be exited in a callback or externally
> interupted. If <timeout(sic)
[snip]
Okay, I've gotten a bit closer. My original code was missing the
MainLoop function completely, and the next program I wrote was
missing the timeout (MainLoop ran forever, *exactly* as described
in the docs... <grin>).
My problem now seems to be understanding references (I think).
Consider the following code:
#!/usr/bin/perl
use SNMP;
$SNMP::use_sprint_value=1;
&SNMP::initMib();
$ip = $ARGV[0];
$comm = $ARGV[1];
for ( my $x = 0 ; $x < 255 ; $x++ ) {
$fullip = $ip.'.'.$x;
$sess[$x] = new SNMP::Session(
DestHost => $fullip,
Community => $comm
);
$mib = 'sysDescr';
$vb[$x] = new SNMP::Varbind([$mib]);
$sess[$x]->getnext($vb[$x], [\&poller, $sess[$x], $x]);
}
SNMP::MainLoop(10);
print "Done.\n";
die "\n";
sub poller {
$i++;
print "Foo! $i\n";
}
----end code snippet----
Okay, now the idea here is to create an array of Varbinds (@vb), each
of which points to an object that is defined like this in the SNMP.pm
module:
package SNMP::Varbind;
$tag_f = 0;
$iid_f = 1;
$val_f = 2;
$type_f = 3;
sub new {
my $type = shift;
my $this = shift;
$this ||= [];
bless $this;
}
sub tag {
$_[0]->[$tag_f];
}
sub iid {
$_[0]->[$iid_f];
}
sub val {
$_[0]->[$val_f];
}
sub type {
$_[0]->[$type_f];
}
----end second code snippet----
So given this much, which part of the references to either @vb or the
data contained therein am I screwing up? I'd like to be able to print
like this (or the correct equivalent):
print "$vb[$x]->[$SNMP::Varbind::val_f] is the data returned.\n";
Thanks in advance for any help!
--J
------------------------------
Date: Mon, 24 Jul 2000 16:19:29 -0400
From: Govind Vinjamuri <gvinjamu@cceb.upenn.edu>
Subject: cgi-perl
Message-Id: <397CA4D1.8B973170@cceb.upenn.edu>
This is a multi-part message in MIME format.
--------------5862DE3A239CCAD1E7641142
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
The web site is for changing passwords and small functions in netscape
email. but recently the script is not. cannot connect ot the server
error. I cannot debug. appreciate you help. Attached is copy of the
error
--
Govind Vinjamuri
215-573-5977
--------------5862DE3A239CCAD1E7641142
Content-Type: application/x-perl;
name="wdh.pl"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="wdh.pl"
at /appl/gnu/lib/perl5/site_perl/Mozilla/LDAP/Utils.pm line 29
BEGIN failed--compilation aborted at /appl/gnu/lib/perl5/site_perl/Mozilla/LDAP/Utils.pm line 29.
BEGIN failed--compilation aborted at /appl/gnu/lib/perl5/site_perl/Mozilla/LDAP/Conn.pm line 32.
BEGIN failed--compilation aborted at /usr/netscape/suitespot/https-sultan/cgi-bin/wdh.pl line 3.
--------------5862DE3A239CCAD1E7641142--
------------------------------
Date: Mon, 24 Jul 2000 14:37:17 -0400
From: brian@smithrenaud.com (brian d foy)
Subject: Re: close(STDOUT) trick doesn't seem to work when HTTP/1.1
Message-Id: <brian-ya02408000R2407001437170001@news.panix.com>
In article <397C84C9.B2564646@bestwebbuys.com>, Steve Loyola <sloyola@bestwebbuys.com> posted:
> The Netscape requests process as expected, but the IE requests appear to die
> (with no mention in the error_log) as soon as "close(STDOUT)" is called. I know
> I can simply leave STDOUT open for the duration of the script, but I was hoping
> that I could prevent the user's browser logo from continuing to spin while my
> script was logging its actions (which could theoretically get blocked since I
> use file locking on the log file.
>
> Any ideas?
move to mod_perl. take care of the content handling in the content
handling phase, and leave the extra for the cleanup phase.
--
brian d foy
CGI Meta FAQ <URL:http://www.smithrenaud.com/public/CGI_MetaFAQ.html>
Perl Mongers <URL:http://www.perl.org/>
------------------------------
Date: Mon, 24 Jul 2000 18:06:32 GMT
From: The Glauber <theglauber@my-deja.com>
Subject: Re: compiling perl on NT into an exec.
Message-Id: <8li0j4$1hb$1@nnrp1.deja.com>
In article <8lhvqh$us$1@nnrp1.deja.com>,
victor@daemos.com wrote:
> Hi,
> I know this is possible, but I can't seem to find any reference to
> this on the internet. I want to compile a perl script that i
currently
> have workin on perl for NT into an executable so I don't need the
> interpreter. Does anybody know where I get the files to do this?
Check http://www.activestate.com, look around for the "Perl Development
Kit". There are other possibilities too, but i can't endorse this any
of them, since i haven't tried them.
glauber
--
Glauber Ribeiro
theglauber@my-deja.com http://www.myvehiclehistoryreport.com
"Opinions stated are my own and not representative of Experian"
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: Mon, 24 Jul 2000 15:38:37 -0400
From: Christopher <cajual@hotmail.com>
Subject: Creating and Deleting a file.
Message-Id: <MPG.13e6653eea096edd989682@news.ica.net>
Hi,
I'm new to PERL so forgive me if these are easy questions....
1. How do you create a file?
2. How do you delete a file?
thanks,
Chris.
------------------------------
Date: Mon, 24 Jul 2000 12:51:24 -0700
From: Makarand Kulkarni <makarand_kulkarni@my-deja.com>
To: Christopher <cajual@hotmail.com>
Subject: Re: Creating and Deleting a file.
Message-Id: <397C9E3C.71B8262F@my-deja.com>
> 1. How do you create a file?
perldoc -f open
>
> 2. How do you delete a file?
perldoc -f unlink
------------------------------
Date: Mon, 24 Jul 2000 14:45:53 -0500
From: Ilja Tabachnik <billy@arnis-bsl.com>
Subject: Re: File & Directory Reading
Message-Id: <397C9CF1.5F60F315@arnis-bsl.com>
Koen Lesenne wrote:
>
> Dear All,
>
> I'm currently using the following statement to read an entire directory. The
> . and .. are filtered out by default but now I would also like to exclude
> the "*.gif" and "*.jpg" files. Can someone help me with this please ?
>
> opendir(FH,"/Website/CONFIGURATION/") or die "Cannot open dir: $!";
> @filelist = grep(!/^\.{1,2}$/, readdir(FH));
> closedir(FH);
>
@filelist = grep !/^\.{1,2}$/ && !/\.gif$/ && !/\.jpg$/, readdir(FH);
Hope this helps.
Ilja.
------------------------------
Date: Mon, 24 Jul 2000 21:15:04 GMT
From: "Daniel van den Oord" <danielxx@bart.nl>
Subject: Re: file extension
Message-Id: <sl2f5.2165$Gd1.25589@Typhoon.bART.nl>
Ahh nice going *S*.. thanks I'Il look into that !!
"Steve Kemp" <skx@tardis.ed.ac.uk> schreef in bericht
news:Pine.GSO.4.10.10007241326550.19774-100000@tardis.tardis.ed.ac.uk...
|
| On Mon, 24 Jul 2000, Daniel van den Oord wrote:
|
| > I made a simpel script to view a directory list with an index and
security
| > so it can't get out of that directory !!
| > http://195.38.226.149/cgi-bin/filer.pl
|
|
| http://195.38.226.149/cgi-bin/filer.pl?direct=.\..\.\..\
|
| !!
|
| Steve
| ---
|
------------------------------
Date: Mon, 24 Jul 2000 21:33:18 GMT
From: "Daniel van den Oord" <danielxx@bart.nl>
Subject: Re: file extension
Message-Id: <yC2f5.2166$Gd1.25577@Typhoon.bART.nl>
Any solution for this I've tried to split the Param you get and look if
there's a " .. " in it but it doesn't work like you can see I also tried to
split it when the slashes are backwards but that to deosn't work !!
"Steve Kemp" <skx@tardis.ed.ac.uk> schreef in bericht
news:Pine.GSO.4.10.10007241326550.19774-100000@tardis.tardis.ed.ac.uk...
|
| On Mon, 24 Jul 2000, Daniel van den Oord wrote:
|
| > I made a simpel script to view a directory list with an index and
security
| > so it can't get out of that directory !!
| > http://195.38.226.149/cgi-bin/filer.pl
|
|
| http://195.38.226.149/cgi-bin/filer.pl?direct=.\..\.\..\
|
| !!
|
| Steve
| ---
|
------------------------------
Date: Mon, 24 Jul 2000 18:57:34 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: golf apocalypse post-mortem?
Message-Id: <snp4culi3j191@corp.supernews.com>
George M. Kuetemeyer (george.kuetemeyer@mail.tju.edu) wrote:
: A tournament over the net would be a lot of fun. Here's a few ideas:
:
: * Perhaps a 4 day event, like the Masters, or British Open.
Given how hard it is to make room in most techies' schedules, probably a
one-day thing on the weekend, or a weekday evening, would make more sense.
: * Answers sent via e-mail. Must be received within 24 hours of question
: postings.
It would probably be much easier to do it via a web form; this simplifies
answer parsing and time-stamping of entries.
--
| Craig Berry - http://www.cinenet.net/users/cberry/home.html
--*-- "Turning and turning in the widening gyre
| The falcon cannot hear the falconer." - Yeats, "The Second Coming"
------------------------------
Date: Mon, 24 Jul 2000 13:01:03 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Hash within an array problem
Message-Id: <slrn8notif.8qb.tadmc@magna.metronet.com>
[ removed alt.perl ]
On Mon, 24 Jul 2000 12:31:03 -0400, Robert Mark <robm@web-impact.com> wrote:
>
>I am having a problem assigning information to an hash array withs
>belongs to a normal array.
>
>Example.
>
>#!/usr/bin/perl
Perl itself would have told you where your mistake was,
if you could only be troubled to _ask_ for its help:
#!/usr/bin/perl -w
>local @my_array=();
You should also have the "use strict" pragma enabled in *all*
of your Perl programs.
You should always prefer my() to local().
>assign();
>display();
>
># assign data to my hashes
>sub assign
>{
> for ($i=0; $i < 5; $i++)
> {
> $my_array[$i]={};
>
> %my_hash=$my_array[$i];
$my_array[$i] contains a reference (to an anonymous hash).
You are using the reference as a hash key (and stomping out a new
hash each time through the loop).
Hash keys are stringified.
You cannot get from a stringified representation of a reference
back to the original reference.
You can delete that line of code. It doesn't do anything useful.
> $my_hash{index}="entry_$i";
$my_array[$i]{index}="entry_$i";
> }
> print "@my_array\n";
That will still print the references, because that _is_
what is the @my_array.
If you want to dereference them then you can do that:
for ($i=0; $i < 5; $i++)
{
foreach (sort keys %{$my_array[$i]})
{
print "$i: $_ ==> $my_array[$i]{$_}\n";
}
}
>}
>
># retrieve the data from the hashes and printout the result.
>sub display
>{
> for ($i=0; $i < 5; $i++)
> {
> $my_hash=$my_array[$i];
> print "Value of $i is $my_hash{index}\n";
You need do dereference the reference:
print "Value of $i is $my_hash->{index}\n";
>Anyone understand what is happening.
Anyone that understands Perl's references does.
Multilevel data structures in Perl are implemented by storing
_references_ to aggregate data types (which you need to
*de*reference), not by storing the aggregate data types themselves.
You should read up on Perl's references:
perldoc perlreftut
perldoc perlref
perldoc perllol
perldoc perldsc
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 24 Jul 2000 19:26:07 GMT
From: The WebDragon <nospam@nospam.com>
Subject: Re: help w/ regular expression
Message-Id: <8li58f$r28$0@216.155.32.41>
In article <chflnss9el6jkudcoevqohggnudsp51a3u@4ax.com>, Bart Lateur
<bart.lateur@skynet.be> wrote:
| Eric Bohlman wrote:
|
| >sub extract_phone {
| > my $arg=shift;
| > if ($arg =~ /([-\d\s()]+)$/ and ($1 =~ tr/0-9//)>=7) {
| > ($arg=$1) =~ tr/0-9//cd;
| > }
| > $arg;
| >}
|
| The prevalence of lexical variables is getting a bit out of hand. What
| happened to $_, which is supposed to be the variable of choice for uses
| like this?
|
| sub extract_phone {
| local $_ = shift;
| if (/([-\d\s()]+)$/ and ($1 =~ tr/0-9//)>=7) {
| $_ = $1;
| tr/0-9//cd;
| }
| return $_;
| }
neither one worked until I added (my $test = $1) -- kept getting a
# Modification of a read-only value attempted, <DATA> chunk 13.
File 'Untitled'; Line 6
error. 'This cuz I'm using 5.004 ?
-=-
#!perl -w
use strict;
sub extract_phone {
local $_ = shift;
if (/([-\d\s()]+)$/ and ((my $test = $1) =~ tr/0-9//)>=7) {
($_ = $1) =~ tr/0-9//cd;
}
$_;
}
foreach (<DATA>) {
chomp;
print extract_phone($_),"\n";
}
__DATA__
213-555-1111
(213) 555-2222
213/555-3333
2135554444
213 555 5555
fn=213-555-6666
fn=(213) 555-7777
fn=213 555 8888
fn=2135559999
fn=213 555 0000
This is a string
432 cars are going
213-555-9876 phones are ringing
-=-
--
send mail to mactech (at) webdragon (dot) net instead of the above address.
this is to prevent spamming. e-mail reply-to's have been altered
to prevent scan software from extracting my address for the purpose
of spamming me, which I hate with a passion bordering on obsession.
------------------------------
Date: Mon, 24 Jul 2000 20:58:41 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: help w/ regular expression
Message-Id: <4tapnsg7rhpdb7qr60cbks3469l483lro7@4ax.com>
The WebDragon wrote:
>
>neither one worked until I added (my $test = $1) -- kept getting a
> # Modification of a read-only value attempted, <DATA> chunk 13.
> File 'Untitled'; Line 6
>error. 'This cuz I'm using 5.004 ?
No. 5.6 still doesn't know that tr/...// only serves to count
characters.
--
Bart.
------------------------------
Date: Mon, 24 Jul 2000 14:48:13 -0700
From: Larry Rosler <lr@hpl.hp.com>
Subject: Re: help w/ regular expression
Message-Id: <MPG.13e6597b89d5e4d498abe2@nntp.hpl.hp.com>
In article <4tapnsg7rhpdb7qr60cbks3469l483lro7@4ax.com> on Mon, 24 Jul
2000 20:58:41 GMT, Bart Lateur <bart.lateur@skynet.be> says...
> The WebDragon wrote:
>
> >neither one worked until I added (my $test = $1) -- kept getting a
> > # Modification of a read-only value attempted, <DATA> chunk 13.
> > File 'Untitled'; Line 6
> >error. 'This cuz I'm using 5.004 ?
>
> No. 5.6 still doesn't know that tr/...// only serves to count
> characters.
I thought so too, until I tested it. On both 5.005_03 and 5.6.0, the
following program works fine (prints "1\n"):
#!/usr/bin/perl -w
use strict;
'x' =~ /(.)/;
print $1 =~ tr/x//, "\n";
But if we change tr/x// to tr/x/x/, it doesn't compile.
As Eric Bohlman posted the following line of code, and you reposted it
with a minor change:
if ($arg =~ /([-\d\s()]+)$/ and ($1 =~ tr/0-9//)>=7) {
why do you now say that it doesn't compile?
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: 24 Jul 2000 18:43:40 GMT
From: dkcombs@netcom.com (David Combs)
Subject: Re: HELP: longSyntax ok, but: rHsh->{myKey} UNDEFINED??
Message-Id: <8li2os$hmo$2@slb1.atl.mindspring.net>
In article <397d2952.39668781@news.newsguy.com>,
Keith Calvert Ivey <kcivey@cpcug.org> wrote:
>dkcombs@netcom.com (David Combs) wrote:
>
>> # NEXT LINE WORKS OK!!
>
>Perhaps, but only accidentally.
>
>> print(STDERR $indentStr, "[$i]: WORKS OK!!!: NOW, TRY FOR x=>{curLine}: ",
>> dQuoteIt(%{$recordHashRef}->{"curLine"}), "\n");
>
>Unless you've given your variable an intentionally misleading
>name, I think you want dQuoteit($recordHashRef->{curLine}). In
>any case, you definitely don't want that %.
>
Hmmm. I suppose that is yet another undocumented DWIMS -- because
it seems to "work".
Fixing it, it still works (hey, with perl, you don't know
until you actually TRY it!):
# NEXT LINE WORKS OK!!
print(STDERR $indentStr, "[$i]: WORKS OK!!!: NOW, TRY FOR x=>{curLine}: ",
# dQuoteIt(%{$recordHashRef}->{"curLine"}), "\n");
dQuoteIt(${$recordHashRef}->{"curLine"}), "\n");
>> # BUT NOT THIS ONE!!!!!: "Use of uninitialized value in print at test4-19jul00.pl line 261.":
>> print(STDERR $indentStr, "[$i]: FAILS!!!: ", dQuoteIt($recordHashRef->{curline}), "\n");
>
>'curline' ne 'curLine'
Yes, thanks. Now, why didn't -w CATCH it?:
881 ====> h5
877 sh prepare-for-nightly-find-and-preserve.sh 1 /opt5/homepreserve5/dkc/nightly-find-dot-nams.nam
878 sh prepare-for-nightly-find-and-preserve.sh 2
879 cp -p test4-19jul00.pl test4-19jul00--misspelled-curline-not-caught-bug.pl
880 perl -w test4-19jul00.pl
881 h5
882 ====>
882 ====>
882 ====> !perl
perl -w test4-19jul00.pl
-- why are you using that silly
>capitalization style anyway?
>
I do not understand this perl-people's "religious" commandment
that "thou shall not mix cases in variable or sub names --
you shall instead use underlines".
My reasons:
. I like long names that fully describe what the variable is --
even VERY long names (30 chars and more).
. Yes, I have a 20-in screen, so it fits.
But NOT in emacs' C-x 3 two vertical side-by-side buffers
(plus follow-mode turned on), which gives me only 77-cols
before the "$" ("line truncated") char.
. So it SAVES SCARCE SPACE.
. Also, when I want a "listing" that I can scotch tape
into long la-120 type long (but narrowish) paper that
I can mark up -- that has width-lim too, and sun's "lp"
has no "wrap" switch (which would still look ugly, even
if it did).
THAT'S why I use mixed case, and am not about to change
just because of all the many clpmisc posts critizing
people who do it that way.
Is that sufficient reason, or are there some REASONS for
this perl-commandment?
Thanks
And thanks even more for finding the misspelling (lower-case
"ell") that -w did NOT find (5.6 bug???).
David
>--
>Keith C. Ivey <kcivey@cpcug.org>
>Washington, DC
------------------------------
Date: Mon, 24 Jul 2000 18:53:14 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: How to loop like this - for(a000 ... x999) ???
Message-Id: <snp44qul3j1123@corp.supernews.com>
Thoren Johne (thoren@southern-division.com) wrote:
: > for (my $key = 'a000'; $key le 'b999'; $key++) {
: > print "$key\n";
: > }
:
: personaly, i would prefer
:
: print "$_\n" for 'a000'..'z999'
Definitely better for that particular purpose; I had the sense the OP
wanted to do more with each value, so I used the for{BLOCK} form. Also, I
started using Perl when a huge range like that would actually expand into
a list of 26,000 entries internally, so I got used to iterating manually.
This no longer happens in recent perls, but it's a hard habit to break.
--
| Craig Berry - http://www.cinenet.net/users/cberry/home.html
--*-- "Turning and turning in the widening gyre
| The falcon cannot hear the falconer." - Yeats, "The Second Coming"
------------------------------
Date: Mon, 24 Jul 2000 21:54:16 +0200
From: "Thoren Johne" <thoren@southern-division.com>
Subject: Re: How to loop like this - for(a000 ... x999) ???
Message-Id: <8li77s$49d$13$2@news.t-online.com>
Craig Berry <cberry@cinenet.net> wrote in message
news:snp44qul3j1123@corp.supernews.com...
> Thoren Johne (thoren@southern-division.com) wrote:
> : > for (my $key = 'a000'; $key le 'b999'; $key++) {
> : > print "$key\n";
> : > }
> :
> : personaly, i would prefer
> :
> : print "$_\n" for 'a000'..'z999'
>
> Definitely better for that particular purpose; I had the sense the OP
> wanted to do more with each value, so I used the for{BLOCK} form.
perhaps we should tell the OP to read
perldoc perlop
for the 'range' operators
that way he could find that ... is not the right form in his context ;)
if he wants to do more with with each value, a look into
perldoc -f map
won't do him any harm
> Also, I started using Perl when a huge range like that would actually
> expand into a list of 26,000 entries internally, so I got used to
> iterating manually.
> This no longer happens in recent perls, but it's a hard habit to break.
i wish someone would tell me that *not* using the lvalue sub's is bad habit,
but hmm... 'WARNING: Lvalue subroutines are still experimental and the
implementation may change in future versions of Perl.'
gruß
thoren
8#X
--
----------------------------------------------------------------------
Thoren Johne - 8#X - thoren@southern-division.com
Southern Division Classic Bikes - www.southern-division.com
------------------------------
Date: Mon, 24 Jul 2000 20:06:38 GMT
From: lsobilo@whitingcorp.com
Subject: Re: Installing BerkeleyDB on RedHat 6
Message-Id: <8li7ka$6ve$1@nnrp1.deja.com>
In article <3977bd91.388258045@news.ionet.net>,
perl@imchat.com (Mark P.) wrote:
> On Thu, 20 Jul 2000 12:09:55 GMT, hagayd@my-deja.com wrote:
>
> >Hi,
> >
> >We were using BerkeleyDB.pm to communicate with Berkeley dB. It
worked
> >fine on the Solaris OS. Then we wrote a time consuming script that
> >needed to run in parallel on a Linux cluster. When we have tried to
> >install it we encounter a problem that described in the CPAN
> >documentation :
> >
> >Linux Notes
> > -----------
> >
> > Newer versions of Linux (e.g. RedHat 6) ship with a C library that
has
> > a version of Berkeley DB linked into it. This makes it very
difficult
> >to
> > build DB_File with anything other than the version of Berkeley DB
that
> > shipped with your Linux release. If you do try to use a different
> > version of Berkeley DB you will probably get the error described in
the
> > "Incompatible versions of db.h and libdb" section of this file.
> >
> > As yet I haven't found a satisfactory way around this problem. If
you
> > do know a workaround to this problem which doesn't involve replacing
> > the built in version of Berkeley DB I would like to hear from you.
> >
>
> I'm running BerkeleyDB on RedHat 6.01. I downloaded the latest
> version from sleepycat, not the RPM, and it installed fine. DB_File
> installed fine along with MLDBM, but BerkeleyDB.pm refused to install.
> Since I really didn't need anything more than DB_File and MLDBM then I
> just discounted it, although I did bring it to the attention of
> Sleepycat.
> FWIW, this needs to be brought to the attention of the
> programmer of BerkeleyDB.pm.
>
> MP
>
I'm trying to install DB-2.7.7 on RedHat Linux 6.0 for use with
squidGuard (which requires DB V2.X). Running make install gives the
following error:
Installing DB include files: /usr/local/BerkeleyDB/include ...
/bin/cp: /usr/local/src/db-2.7.7/dist/../include/db_cxx.h: No such file
or directory
Did you run into this?
Larry Sobilo
Sent via Deja.com http://www.deja.com/
Before you buy.
------------------------------
Date: 24 Jul 2000 0:39:46 +0200
From: "Rask Ingemann Lambertsen" <postmaster@rask.nospam.kampsax.k-net.dk>
Subject: Re: IO:Socket and Timeout => "5" ?
Message-Id: <998.240T2300T395644postmaster@rask.nospam.kampsax.k-net.dk>
I have the same problem, a timeout of 13 minutes regardless of what I
specify. The timeout only works _after_ the connection has been
established.
Redhat Linux 6.2/i386, stock kernel 2.2.16 and the version of the perl
RPM is perl-5.00503-10.
On 23-Jul-00 13:55:18, Colin Keith wrote the following about "Re: IO:Socket and Timeout => "5" ?":
> Werks fer me. Not much help I know, maybe update the
> version of IO::Socket ?
> perl -mIO::Socket -e 'print $IO::Socket::VERSION;'
> 1.1603
Thanks for trying, but this version has the problem:
$ perl -mIO::Socket -e 'print $IO::Socket::VERSION;'
1.1603
Regards,
/ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻTŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ\
| Rask Ingemann Lambertsen | postmaster@rask.nospam.kampsax.k-net.dk |
| A4000, 896 kkeys/s (RC5-64) | "ThrustMe" on XPilot and EFnet IRC |
| Reality is that which, when you stop believing in it, it still exists. |
------------------------------
Date: Mon, 24 Jul 2000 20:40:02 GMT
From: pat@ssih.com (Pat Traynor)
Subject: Re: Keeping quoted text intact within a split
Message-Id: <397da973.35579715@news.giganews.com>
On Fri, 21 Jul 2000 16:11:59 GMT, aqutiv@my-deja.com wrote:
>In article <39786a4f.21700685@news.giganews.com>,
> pat@ssih.com (Pat Traynor) wrote:
>> [ ... ]
>> Thanks in advance...
>>
>
>#Here you go:
> [ ... ]
Excellent. Thank you VERY much!!
------------------------------
Date: Mon, 24 Jul 2000 14:28:13 -0700
From: randythefirst <randythefirstNOraSPAM@hotmail.com.invalid>
Subject: Need bookmark script
Message-Id: <069bdb04.77dcec0d@usw-ex0102-016.remarq.com>
Hi
I am looking for a perl script to put on my web site that will
allow me to store bookmarks. What I would like is a script that
generates an html page which lists my favorite site. At the
bottom would be a button that takes you to a login. After login
you would be allowed to edit the bookmarks.
Does this script already exist or do I need to write it?
http://cgi.resourceindex.com/Programs_and_Scripts/Perl/
may have it, if so, where might I look.
I am taking Perl, so an offer write one for a price is nice, but
no dice.
Also, actually something close would be great, that would allow
me study the script and make changes to suit.
Any assistance would be greatly appriciated.
Thank you in advance for your time.
Randy
-----------------------------------------------------------
Got questions? Get answers over the phone at Keen.com.
Up to 100 minutes free!
http://www.keen.com
------------------------------
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 V9 Issue 3787
**************************************