[6822] in Perl-Users-Digest
Perl-Users Digest, Issue: 447 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 7 18:17:21 1997
Date: Wed, 7 May 97 15:00:21 -0700
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Wed, 7 May 1997 Volume: 8 Number: 447
Today's topics:
Re: absolute novice - help me start (rga)
Re: Ask a stupid question! thanks. (Kyzer)
Re: canned replies (I R A Aggie)
Re: checking IP's & MAC of 40,000 hosts <jeffs@statsci.com>
Re: clever coding required <ajohnson@gpu.srv.ualberta.ca>
Re: FTP support in perl (I R A Aggie)
getgr... only sees first occurance of a group /etc/grou <kevin@vtaix.cc.vt.edu>
Re: hashes, -d's "x", and Data::Dumper <jesse@ginger.sig.bsh.com>
Re: informix and perl <boei@trifox.com>
Re: Installing DBI with Perl5.003 (John D Groenveld)
Re: join and references (David Alan Black)
Re: mail from perl 5.003 program on solaris 2.5.1 (Kyzer)
Module to generate a parse tree (Camerson Schaus)
Re: Notice to antispammers - is there a list of spammer (Dave Regan)
Re: Perl auto-replier (rga)
Perl CORBA IIOP module? <rpang@us.oracle.com>
Re: Please Help a Newbie (rga)
Re: Possible inclusion into FAQ (David Alan Black)
Re: Possible inclusion into FAQ (Greg Bacon)
Re: Possible inclusion into FAQ (Tad McClellan)
splitting text (Zachary Brown)
Re: splitting text (David Alan Black)
Re: splitting text (Greg Bacon)
Re: Trouble with Emacs auto formatter <jesse@ginger.sig.bsh.com>
Urgent: Need help with web site design for a class I'm <gary.stoker@MCI2000.com>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 07 May 1997 21:03:04 GMT
From: rga@io.com (rga)
Subject: Re: absolute novice - help me start
Message-Id: <3370ed2c.2084176@news.io.com>
"chris" <chris.lee@globasatcom.com> wrote:
Make sure <perl.exe> is in your dos pathway
Go to the directory with the <perl_file_name.pl>
Type C:> perl perl_file_name.pl
You don't need to start the file w/ #!/usr/local/bin/perl
for Windows95, the perl for win32's interprets it anway.
You don't need to have <filename.pl> associated with
<perl.exe> unless you want to doulble click on the
<filename.pl> and call the interpretor to it.
I keep the *.pl association for my editor, so I can
pull up the script fast.
Russell
http://www.io.com/~rga/
RGA Home Pages and Rainbow Garden !
Stories, Inspiration, Morning Thought.
http://www.io.com/~rga/rainbow.html
------------------------------
Date: 7 May 1997 19:43:26 GMT
From: junkmail@sysc.abdn.ac.uk (Kyzer)
Subject: Re: Ask a stupid question! thanks.
Message-Id: <5kqm0u$k5q@info.abdn.ac.uk>
>From the lips of %,5\.&'=* sprang:
: As the title,this is a simple question :
: If I didn't have server. Is it possible to run perl on my PC.
: I only have Win95 and perl for Win32 in my PC.
Yes it is! Simply quit from Windows 95 and reboot your computer in DOS
mode. From there, you can type something like:
C:\PERL\PERL.EXE -w C:\WORK\MYSCRIPT.PL
: Someone said I need Website,is it true?
No, that's just damned outrageous lies! (chavfu nyy vaibyirq)
You only need a Website if you intend writing CGI.
: What software I need to install ,if I want to run perl?
delete all M$ software and install linux (and perl of course :)
: Thanks for telling me the answer.
You're welcome :)
And just for you, here is a test script!
#!/usr/bin/perl -w
$_="\/T\/b\/q\/,\/ \/V\/'\/z\/ \/f\/h\/p\/u\/ \/n\/ \/a\/v\/p\/r\/ \/t\/h\/l";
$_.="\/!\/ \/F\/r\/a\/q\/ \/z\/r\/ \/n\/y\/y\/ \/l\/b\/h\/e\/ \/z\/b\/a\/r\/";
$_.="\/l\/ \/e\/v\/t\/u\/g\/ \/a\/b\/j\/!\n";tr/a-zA-Z\//n-za-mN-ZA-M/d;print;
__END__
--
Stuart 'Kyzer' Caie - Kyzer/CSG |undergraduate of Aberdeen University |100%
http://www.abdn.ac.uk/~u13sac |My opinions aren't those of Aberdeen |Amiga -
kyzer@4u.net kyzer@hotmail.com |University or AUCC, thankfully.***** |always!
--
Random sig of the day:
Britcode(v1.1): Brit(S) H+++: U+++: a18 s+:- hf++>+++ b+ m+ x? X---:+
P-- S+++ M++ R-- A C-- T--- TV+ Ci MuI+ MuR++ MuJ--- Am+++ Ac+ B+ V---
------------------------------
Date: Wed, 07 May 1997 14:41:07 -0500
From: fl_aggie@hotmail.com (I R A Aggie)
Subject: Re: canned replies
Message-Id: <fl_aggie-ya02408000R0705971441080001@news.fsu.edu>
In article <5kqe0f$q3d@fridge-nf0.shore.net>, nvp@shore.net (Nathan V.
Patwardhan) wrote:
+ What kind of canned response were you looking for?
Probably an auto-responder for email. Yes?
James
--
Consulting Minister for Consultants, DNRC
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>
------------------------------
Date: Wed, 07 May 1997 13:48:58 -0700
From: Jeff Silverman <jeffs@statsci.com>
To: Diana March <diana.march@spamfree.fmr.com>
Subject: Re: checking IP's & MAC of 40,000 hosts
Message-Id: <3370EABA.6A40@statsci.com>
Diana March wrote:
>
> We have 40,000 hosts and 1 inaccurate database. I understand that this
> is a common problem that others may have had to deal with in the past
> and I was interested in getting some input from people who have had to
> deal with this issue.
>
> I have over 25 workstations at my disposal so I was considering
> splitting up the IP's and doing a fast ping however I am begining to
> wonder how useful the information returned would be. If a machine
> doesn't respond it doesn't necessarly mean that it isn't around.
>
> So I guess I have several questions;
>
> 1. Does anyone have a script for fast pinging a ton of machines?
See below.
> 2. How useful have you found this script to be?
Incredibly useful.
> 3. I will also need to get the MAC address does anyone have any
> suggestions as to where I should start?
See below. Use arp.
Note that arp only works for machines on a local LAN. You may have to
put copies of this script on the network and use rsh to run them.
>
> Thanks for you input.
> Diana
> diana.march@fmr.com
These are shell scripts I have been meaning to translate into Perl.
ea:
#! /bin/sh
fping $1 && arp -a | fgrep -i $1
make_ea_lists:
#! /bin/csh
# This C-shell script generates three lists of network addresses sorted
by name,
# by ethernet address, and by IP address.
echo This script works especially well on veg which is running SunOS 5.4
all_ea | fgrep at >> node_ea_list
sort -u node_ea_list +0 > by_name
sort -u node_ea_list +1 > by_ip
sort -u node_ea_list +3 > by_ea
sort -u node_ea_list > t1
rm node_ea_list
mv t1 node_ea_list
exit 0
all_ea:
#! /bin/csh
set NET=206.63.206.
#
# Start pinging at address 198.145.127.1, because 198.145.127.0 is a
broadcast
# on some systems. End at 198.145.127.254 because 198.145.127.255 is a
broadcast
# address on most systems
@ I = 1
while ($I <= 254)
## fping $NET$I && arp -a | fgrep $NET$I\)
fping $NET$I
if ( ! $status ) then
arp -a | fgrep $NET$I
else
echo "$NET$I would not answer a ping"
endif
@ I = $I + 1
end
## set NET=198.145.127.
## #
## # address on most systems
## @ I = 1
## while ($I <= 254)
fping $NET$I
if ( ! $status ) then
arp -a | fgrep $NET$I
else
echo "$NET$I would not answer a ping"
endif
@ I = $I + 1
end
The arp command works well on SunOS 4.1.3,
junior (206.63.206.48) at 0:a0:24:82:58:47
thyme (206.63.206.49) at 8:0:20:b:db:97
sail (206.63.206.1) at 8:0:20:1b:a:f8
sofer (206.63.206.177) at 0:60:97:14:82:8
bass (206.63.206.82) at 8:0:20:b:90:1d
sage (206.63.206.50) at 8:0:20:f:f0:4f
veg (206.63.206.34) at 8:0:20:2:c4:86
but on SunOS 5.5, arp doesn't give the IP address only the IP address.
Net to Media Table
Device IP Address Mask Flags Phys Addr
------ -------------------- --------------- ----- ---------------
hme1 mistral 255.255.255.255 08:00:20:09:f3:15
hme1 watchguard 255.255.255.255 00:a0:24:d1:b8:7c
hme1 emu 255.255.255.255 00:00:c0:81:fd:c7
hme1 nitro 255.255.255.255 00:40:05:1a:9c:d1
hme1 darwin 255.255.255.255 00:60:8c:64:f8:90
hme1 quake 255.255.255.255 08:00:20:75:f1:5a
hme1 yalgoo 255.255.255.255 00:40:05:1a:30:2e
hme1 perth 255.255.255.255 00:40:05:1a:84:00
hme1 wallaby 255.255.255.255 00:00:c0:7e:fd:c7
hme1 gecko 255.255.255.255 00:40:05:1a:30:4a
hme1 taco 255.255.255.255 00:a0:24:89:24:5a
--
Jeff Silverman NIC handle JS1463
PC Administrator & LAN man,
Mathsoft, Data Analysis Products Division (Formerly Statistical
Sciences)
1700 Westlake AVE N #500 Seattle WA 98109
(206) 283-8802 x266 (206) 283-8691 (FAX)
jeffs@statsci.com
------------------------------
Date: Wed, 07 May 1997 13:14:50 -0500
From: Andrew Johnson <ajohnson@gpu.srv.ualberta.ca>
Subject: Re: clever coding required
Message-Id: <3370C69A.3243446E@gpu.srv.ualberta.ca>
Martin Cohen wrote:
>
> Andrew Johnson wrote:
> -
> - alex wrote:
[snip]
>
> Any reason not to use /\b\s*|\s*\b/ as the regular expression for the
> split? Then you would only have to trim the front of the first field
> and the back of the last. I did *not* test this.
> --
> Martin Cohen - AMSAA-North - Custom House Rm 800 Phila PA 19106-2976
well, yours would remove *all* spaces except the leading
and trailing spaces, unless you really meant
s/\b\s*(\|)\s*\b/$1/g;
but, I had given mine as unnecesarily complicated
because the poster had a) wanted all leading and
trailing spaces in each field stripped *prior* to splitting,
and b) asked for clever code :-)
I was fairly sure someone would give the less fun answer
of stripping the leading and trailing spaces from the
overall string:
s/^\s*|\s*$//g;
and then just splitting on 'spaces | spaces'
($field1, $field2,...)=split /\s*\|\s*/;
regards
andrew
------------------------------
Date: Wed, 07 May 1997 15:47:27 -0500
From: fl_aggie@hotmail.com (I R A Aggie)
Subject: Re: FTP support in perl
Message-Id: <fl_aggie-ya02408000R0705971547270001@news.fsu.edu>
In article <336FE28D.7B73@fuse.net>, fritz@fuse.net wrote:
+ Can I do something similar form Perl, or do I need to get into sockets?
You mean something like:
use Net::FTP;
$ftp = Net::FTP->new("some.host.name");
$ftp->login("anonymous","me@here.there");
$ftp->cwd("/pub");
$ftp->get("that.file");
$ftp->quit;
Go to CPAN and get the netlib archive. You not only get FTP, but other
services as well.
James
--
Consulting Minister for Consultants, DNRC
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>
------------------------------
Date: Wed, 07 May 1997 17:08:14 -0400
From: Kevin Ternes <kevin@vtaix.cc.vt.edu>
Subject: getgr... only sees first occurance of a group /etc/group?
Message-Id: <3370EF3D.71BF7F27@vtaix.cc.vt.edu>
Hi;
I am trying to use either getgrgid or getgrnam on my system.
My system has so many users in a single group that it makes extra lines
for the group in /etc/group. The number of users on a line is limited
by the value of LINE_MAX. So part of my group file looks like:
menu::1000:user0001,user0002,....,user0112
menu::1000:user0113,user0114,...
menu::1000:user0225,...
The trouble occurs when I do something like
($d[1],$d[2],$d[3],$memberlist) = getgrnam(menu); # or getgrgid(1000)
The $memberlist is composed only of user0001 through user0112, that is,
the first menu group line.
I am using Perl5.003 on both HP-UX10.10 and AIX3.2.5 and see the
same behavior in both places. Am I doing something wrong or is this
how getgr... is supposed to behaive?
Thanks
-kevin
--
mailto:kevin@vtaix.cc.vt.edu
"Promoting better living through UNIX!"
------------------------------
Date: 07 May 1997 16:54:54 -0400
From: Jesse Glick <jesse@ginger.sig.bsh.com>
Subject: Re: hashes, -d's "x", and Data::Dumper
Message-Id: <4o911rvw81.fsf@ginger.sig.bsh.com>
Perhaps a more illustrative example of this bizarre behavior follows. Note
that the scalar is interpreted as both a string and a hash ref. Also note that
this property seems to be associated with the string itself. It is clear that
Data::Dumper etc. is not involved with this; the values involved come up empty
using the `ref' builtin, and that is what it looks for.
#!/usr/local/bin/perl5 -w
use Devel::Peek qw(Dump);
use Data::Dumper qw(Dumper);
$foo='first';
$bar='first';
$bar->{key}='val';
$baz='first';
$quux='second';
$oodle1='fi';
$oodle2='rst';
$oodle=$oodle1 . $oodle2;
print "Constant:\n";
Dump('first');
Dump('second');
foreach (qw(foo bar baz quux oodle)) {
info($_);
}
sub info {
my $thing=shift;
print "\n\$$thing:\n";
Dump($$thing);
print Dumper($$thing, \%{$$thing}, $$thing->{key});
}
__END__
Output:
Identifier "main::quux" used only once: possible typo at /tmp/fnerr line 9.
Identifier "main::baz" used only once: possible typo at /tmp/fnerr line 8.
Identifier "main::foo" used only once: possible typo at /tmp/fnerr line 5.
Identifier "main::oodle" used only once: possible typo at /tmp/fnerr line 12.
Constant:
SV = PVIV(0x1007d228)
REFCNT = 1
FLAGS = (POK,READONLY,pPOK)
IV = 39
PV = 0x100ab688 "first"
CUR = 5
LEN = 6
SV = PVIV(0x1007d088)
REFCNT = 1
FLAGS = (POK,READONLY,pPOK)
IV = 39
PV = 0x100ab6c8 "second"
CUR = 6
LEN = 7
$foo:
SV = PVIV(0x10024368)
REFCNT = 1
FLAGS = (POK,pPOK)
IV = 0
PV = 0x10019448 "first"
CUR = 5
LEN = 6
$VAR1 = 'first';
$VAR2 = {
key => 'val'
};
$VAR3 = 'val';
$bar:
SV = PVIV(0x100a9b48)
REFCNT = 1
FLAGS = (POK,pPOK)
IV = 0
PV = 0x10022f68 "first"
CUR = 5
LEN = 6
$VAR1 = 'first';
$VAR2 = {
key => 'val'
};
$VAR3 = 'val';
$baz:
SV = PVIV(0x100acd08)
REFCNT = 1
FLAGS = (POK,pPOK)
IV = 0
PV = 0x100ab7b8 "first"
CUR = 5
LEN = 6
$VAR1 = 'first';
$VAR2 = {
key => 'val'
};
$VAR3 = 'val';
$quux:
SV = PVIV(0x100acd28)
REFCNT = 1
FLAGS = (POK,pPOK)
IV = 0
PV = 0x100ab7c8 "second"
CUR = 6
LEN = 7
$VAR1 = 'second';
$VAR2 = {
key => undef
};
$VAR3 = undef;
$oodle:
SV = PV(0x1001a0b0)
REFCNT = 1
FLAGS = (POK,pPOK)
PV = 0x100ab7f8 "first"
CUR = 5
LEN = 6
$VAR1 = 'first';
$VAR2 = {
key => 'val'
};
$VAR3 = 'val';
--
Jesse "Da Juice" Glick
mailto:jglick@sig.bsh.com
617-867-1017
------------------------------
Date: Wed, 07 May 1997 14:01:16 -0700
From: Bob Eisner <boei@trifox.com>
To: frank@calweb.com
Subject: Re: informix and perl
Message-Id: <3370ED9C.3B2F@trifox.com>
Frank S. (Lpage) wrote:
>
> has anyone accessed informix databases using perl?
> i'd love to know how. thanks.
>
> frank
> --
Trifox has a product, VORTEXperl. It talks to multiple RDBMS.
It uses Perl Sockets so there is no need to re-build the Perl
runtime. It also support all versions of Informix 5, 6 & 7.
Please see http://www.trifox.com for details.
The beta version is available on our FTP server:
ftp://ftp.trifox.com/pub/products/perl/vtxperl.tar
Regards,
Bob Eisner
408.369.2392
------------------------------
Date: 7 May 1997 17:08:08 -0400
From: groenvel@cse.psu.edu (John D Groenveld)
Subject: Re: Installing DBI with Perl5.003
Message-Id: <5kqqvo$2gt$1@tholian.cse.psu.edu>
A more appropriate forum for your question is the dbi-users mailing list.
See the README or http://www.hermetica.com/technologia/DBI/ for details.
John
groenvel@cse.psu.edu
------------------------------
Date: 7 May 1997 19:32:05 GMT
From: dblack@icarus.shu.edu (David Alan Black)
Subject: Re: join and references
Message-Id: <5kqlbl$9ik@pirate.shu.edu>
Hello -
chopps@merit.edu (Christian E. Hopps) writes:
>Hi,
>I'm trying to join a reference with some other text. It appears
>that the data being referenced goes away when the only reference
>to it is within the joined object.
The problem is that if you store a reference as a string (or part
of a string), it loses its referencehood.
>$bar = "1 2 3";
>@list;
(That @list;, by the way, is pointless. You can either declare
it as my @list, and/or assign to it, but just mentioning it
doesn't do anything.)
Here's an illustration of the difference between a reference and
a string-whose-value-happens-to-be-the-string-representation-of-
a-reference:
#!/usr/local/bin/perl -w
$foo = [1,2,3];
$bar = "$foo";
print "\$foo is $foo\n";
print "and it's a reference\n" if ref $foo;
print "\$bar is $bar\n";
print "but it isn't a reference\n" unless ref $bar;
Your join()ing of a reference, like the assignment to $bar in this
example, leaves you only with a string.
David Black
dblack@icarus.shu.edu
------------------------------
Date: 7 May 1997 20:06:54 GMT
From: junkmail@sysc.abdn.ac.uk (Kyzer)
Subject: Re: mail from perl 5.003 program on solaris 2.5.1
Message-Id: <5kqncu$k5q@info.abdn.ac.uk>
>From the lips of Jesse Rendleman sprang:
: I was mocked for posting to comp.lang.perl, and so, I repost here...
tee hee :)
: I'm sending mail from a perl program with the following code:
[snipped source]
: which works when $to is a valid address, but when $to can't be
: delivered because it doesn't exist or such, the error mail isn't
: delivered to $from, instead it goes to "jesse@cybersource.com"?!
I don't think all mail daemons support 'Errors-to:'
: I've tried undefing any environment variables that might identify
: "jesse", but with no luck.
: Anyone got any ideas on this?
I believe the return address is based on your Real UID, therefore it's
impossible to avoid, unless you run a filter on the that user's mailbox,
doing whatever it likes when Subject contains "Returned Mail".
Consider talking directly to the sendmail daemon,
(try telnet [your mailhost] 25) , also consider using
the Net:SMTP module from CPAN.
--
Stuart 'Kyzer' Caie - Kyzer/CSG |undergraduate of Aberdeen University |100%
http://www.abdn.ac.uk/~u13sac |My opinions aren't those of Aberdeen |Amiga -
kyzer@4u.net kyzer@hotmail.com |University or AUCC, thankfully.***** |always!
--
Random sig of the day:
AtheistCode(v1.0) ACv1.0 DUR5 STR4 BIT4 ACT1 DEF4 DEB5 CON1 SLM5 XTN4 PUB2
------------------------------
Date: 7 May 1997 20:10:32 GMT
From: cam@cs.ualberta.ca (Camerson Schaus)
Subject: Module to generate a parse tree
Message-Id: <5kqnjo$i8h$1@scapa.cs.ualberta.ca>
I am looking for a perl module/source that will generate a parse tree
when given a grammar. Is there a module that will do this, I
searched the archives but couldn't find what I was looking for.
Thanks
Cam
cam@cs.ualberta.ca
------------------------------
Date: 7 May 1997 17:08:40 GMT
From: regan@office.ao.com (Dave Regan)
Subject: Re: Notice to antispammers - is there a list of spammers to pluginto procmail?
Message-Id: <5kqcuo$c1t$1@bashir.peak.org>
In article <8cafm74c2k.fsf@gadget.cscaper.com>,
Randal Schwartz <merlyn@stonehenge.com> writes:
>>>>>> "Dave" == Dave Regan <regan@ao.com> writes:
>
>Dave> There is a list that AOL maintains. It isn't necessarily in a format
>Dave> for directly plugging into procmail. See:
>Dave> http://www.idot.aol.com/preferredmail/
>
>Dave> With a short Perl program I'm sure you can remove the HTML wrapping
>Dave> and get straight to the addresses. From there it should be easy
>Dave> to add the wrapping to make it fit into procmail. Then you can fire
>Dave> the whole mess off with cron and not have to worry about it anymore
>Dave> (except for when AOL changes the format of the file. :))
>
>Ooh. Ooooh. I think you just gave me the content of my next
>WebTechniques column (due this week anyway :-). "Extract the meat of
>this webpage and generate the appropriate procmail blocklist". Yes.
>Cool. (Prior WebTechniques columns are online at
>http://www.stonehenge.com/merlyn/WebTechniques/ -- if for some reason
>you haven't already seen the announcement in comp.lang.perl.announce.)
I'm glad to be of help; I've learned much from your work in the past (and
present). Not to mention the work of Larry Wall and Tom Christiansen.
Now do I get one "Get Out of Jail Free" (a.k.a. "Ask A Stupid Question Free")
card for my help? :)
Dave Regan
regan@ao.com
------------------------------
Date: Wed, 07 May 1997 21:09:54 GMT
From: rga@io.com (rga)
Subject: Re: Perl auto-replier
Message-Id: <3370ef72.2665661@news.io.com>
Ronald.J.Kimball@dartmouth.edu (Chipmunk) wrote:
Olay, since this is still going on
Here's a cute addition.
Dear G*d, I know it doesn't belong here, BUT ..
found in the best of internet newsgroup.
Subject: Light bulbs
From: Birmingham City Council EDD Training Services
<training@bcceddts.demon.co.uk>
Newsgroups: uk.net.news.config
I hope this will help remind people to temper discussion of newsgroup
names and charters with a little humour and consideration (I found it
quoted on Usenet; the author was not credited) :
Q: How many internet mail list subscribers does it take
to change a light bulb?
A: 1,331:
1 to change the light bulb and to post to the mail
list that the light bulb has been changed
14 to share similar experiences of changing light
bulbs and how the light bulb could have been
changed differently.
7 to caution about the dangers of changing light bulbs.
27 to point out spelling/grammar errors in posts about
changing light bulbs.
53 to flame the spell checkers
156 to write to the list administrator complaining about
the light bulb discussion and its inappropriateness
to this mail list.
41 to correct spelling in the spelling/grammar flames.
109 to post that this list is not about light bulbs and
to please take this email exchange to alt.lite.bulb
203 to demand that cross posting to alt.grammar,
alt.spelling and alt.punctuation about changing
light bulbs be stopped.
111 to defend the posting to this list saying that we
are all use light bulbs and therefore the posts
**are** relevant to this mail list.
306 to debate which method of changing light
bulbs is superior, where to buy the best light bulbs,
what brand of light bulbs work best for this
technique, and what brands are faulty.
27 to post URLs where one can see examples of
different light bulbs
14 to post that the URLs were posted incorrectly, and
to post corrected URLs.
3 to post about links they found from the URLs that
are relevant to this list which makes light bulbs
relevant to this list.
33 to concatenate all posts to date, then quote
them including all headers and footers, and then
add "Me Too."
12 to post to the list that they are unsubscribing
because they cannot handle the light bulb
controversey.
19 to quote the "Me Too's" to say, "Me Three."
4 to suggest that posters request the light bulb FAQ.
1 to propose new alt.change.lite.bulb newsgroup.
47 to say this is just what alt.physic.cold_fusion
was meant for, leave it here.
143 votes for alt.lite.bulb.
RGA Home Pages and Rainbow Garden !
Stories, Inspiration, Morning Thought.
http://www.io.com/~rga/rainbow.html
------------------------------
Date: Tue, 6 May 1997 13:13:51 -0700
From: "Oracle News 2" <rpang@us.oracle.com>
Subject: Perl CORBA IIOP module?
Message-Id: <5kqng8$rqo$1@inet16.us.oracle.com>
Hi folks,
When I read the news, I came across a Perl IIOP module. Does anyone know
where I can find more information about it?
A related question. Is there any CORBA-Perl mapping definition underway
right now? I understand that Perl does not have the notion of datatypes
which makes such a mapping difficult. Has anyone thought about how to
overcome this difficulty?
Robert Pang
------------------------------
Date: Wed, 07 May 1997 20:57:22 GMT
From: rga@io.com (rga)
Subject: Re: Please Help a Newbie
Message-Id: <3370ec2b.1826850@news.io.com>
Jon Swoveland <jswovela@uvic.ca> wrote:
> So, my question is: does
>anybody know the syntax for writing the HTML file with these
>place-holders?
If you don't have an example HTML file that the perl
script has already been writing to, then you'll need to
look in the perl script itself to see what the script defines
as a place holder.
The script itself will define a pattern to match when placing
more HTML code in the existing HTML file.
Russell
http://www.io.com/~rga/
RGA Home Pages and Rainbow Garden !
Stories, Inspiration, Morning Thought.
http://www.io.com/~rga/rainbow.html
------------------------------
Date: 7 May 1997 20:31:31 GMT
From: dblack@icarus.shu.edu (David Alan Black)
Subject: Re: Possible inclusion into FAQ
Message-Id: <5kqor3$fia@pirate.shu.edu>
Hello -
"Vipul M. Shah" <vipul@xcaliber.com> writes:
>For us C/C++ lovers, what is the equivalent of the subscript operator for
>strings in Perl. I.e;
> how do I write
> int n = strlen(s);
>int t = 0;
>for (int i = 0; i < n; i++)
> {
>t += (int)s[i];
>}
>in Perl. Please CC responses to mailto:vipul@xcaliber.com.
for ( split '', $s ) { $t += ord }
But the C version is nice if you like typing or typing :-)
David Black
dblack@icarus.shu.edu
------------------------------
Date: 7 May 1997 20:56:21 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
To: "Vipul M. Shah" <vipul@xcaliber.com>
Subject: Re: Possible inclusion into FAQ
Message-Id: <5kqq9l$11o$1@info.uah.edu>
[Posted and mailed]
In article <5kpvut$3vo@news.xcaliber.com>,
"Vipul M. Shah" <vipul@xcaliber.com> writes:
: For us C/C++ lovers, what is the equivalent of the subscript operator for
: strings in Perl. I.e;
: how do I write
: int n = strlen(s);
: int t = 0;
: for (int i = 0; i < n; i++)
: {
: t += (int)s[i];
: }
:
: in Perl.
First, the answer to your question:
$str = 'Just another Perl hacker,';
$sum = 0;
$len = length $str;
for ($i = 0; $i < $len; $i++) {
$sum += ord(substr $str, $i, 1);
}
TMTOWTDI:
$str = 'Just another Perl hacker,';
$sum = 0;
for (split //, $str) {
$sum += ord;
}
In general, one expresses the same notion in C with
c = str[i];
as one does in Perl with
$c = substr $str, $n, 1;
Hope this helps,
Greg
--
Greg Bacon <gbacon@cs.uah.edu>
Unix / Perl Consultant
Perl Institute Partner - http://www.perl.org/
------------------------------
Date: Wed, 7 May 1997 15:47:49 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Possible inclusion into FAQ
Message-Id: <lppqk5.ht2.ln@localhost>
Vipul M. Shah (vipul@xcaliber.com) wrote:
: For us C/C++ lovers, what is the equivalent of the subscript operator for
: strings in Perl. I.e;
: how do I write
: int n = strlen(s);
: int t = 0;
: for (int i = 0; i < n; i++)
: {
: t += (int)s[i];
: }
You don't need subscripts to write that in Perl:
foreach (split //, $s) {
$t += ord($_);
}
--
Tad McClellan SGML Consulting
Tag And Document Consulting Perl programming
tadmc@flash.net
------------------------------
Date: 7 May 1997 15:02:41 -0400
From: zbrown@lynx.dac.neu.edu (Zachary Brown)
Subject: splitting text
Message-Id: <5kqjkh$odq@lynx.dac.neu.edu>
I'm having a tough time with the following problem:
How to split along the boundary between space and nonspace. So if I have
an array of items of text like "of him- or her-self to attain, etc.", I'd
like to split it into an array of
$a[0] = "of"
$a[1] = " "
$a[2] = "him-"
$a[3] = " "
$a[4] = "or"
$a[5] = " "
$a[6] = "her-self"
$a[7] = " "
$a[8] = "to"
$a[9] = " "
$a[10] = "attain,"
$a[11] = " "
$a[12] = "etc."
$a[13] = "\n"
and so on, with $a[14] starting at the beginning of the next item in the
original array.
I've tried splitting on \b, but that breaks punctuation into their own
items as well.
Zack
------------------------------
Date: 7 May 1997 19:41:22 GMT
From: dblack@icarus.shu.edu (David Alan Black)
Subject: Re: splitting text
Message-Id: <5kqlt2$aia@pirate.shu.edu>
Hello -
zbrown@lynx.dac.neu.edu (Zachary Brown) writes:
>I'm having a tough time with the following problem:
>How to split along the boundary between space and nonspace. So if I have
>an array of items of text like "of him- or her-self to attain, etc.", I'd
>like to split it into an array of
>$a[0] = "of"
>$a[1] = " "
>$a[2] = "him-"
>$a[3] = " "
>$a[4] = "or"
>$a[5] = " "
>$a[6] = "her-self"
>$a[7] = " "
>$a[8] = "to"
>$a[9] = " "
>$a[10] = "attain,"
>$a[11] = " "
>$a[12] = "etc."
>$a[13] = "\n"
>and so on, with $a[14] starting at the beginning of the next item in the
>original array.
my $line = "of him- or her-self to attain, etc.\n";
my @a = split /(\s+)/, $line;
foreach (0..$#a) { print "\$a[$_] = \"$a[$_]\"\n" }
Note the () around \s+ in the split regex. This causes split to
return the delimiters as array elements, interleaved with the
non-delimiter elements (for which there must be some better
name :-)
David Black
dblack@icarus.shu.edu
------------------------------
Date: 7 May 1997 21:02:24 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
To: zbrown@lynx.dac.neu.edu (Zachary Brown)
Subject: Re: splitting text
Message-Id: <5kqql0$11o$2@info.uah.edu>
[Posted and mailed]
In article <5kqjkh$odq@lynx.dac.neu.edu>,
zbrown@lynx.dac.neu.edu (Zachary Brown) writes:
: I'm having a tough time with the following problem:
:
: How to split along the boundary between space and nonspace. So if I have
: an array of items of text like "of him- or her-self to attain, etc.", I'd
: like to split it into an array of
: $a[0] = "of"
: $a[1] = " "
[ snip]
: $a[13] = "\n"
>From the perlfunc entry on split:
If the PATTERN contains parentheses, additional
array elements are created from each matching
substring in the delimiter.
split(/([,-])/, "1-10,20");
produces the list value
(1, '-', 10, ',', 20)
This is exactly the feature you want to take advantage of like so:
$str = "of him- or her-self to attain, etc.\n";
@ary = split /(\s+)/, $str;
Hope this helps,
Greg
--
Greg Bacon <gbacon@cs.uah.edu>
Unix / Perl Consultant
Perl Institute Partner - http://www.perl.org/
------------------------------
Date: 07 May 1997 16:02:54 -0400
From: Jesse Glick <jesse@ginger.sig.bsh.com>
To: Chris.Phillips@phys.utas.edu.au
Subject: Re: Trouble with Emacs auto formatter
Message-Id: <4obu6nvymp.fsf@ginger.sig.bsh.com>
You ARE using CPerl mode (vs. crappy Perl-Mode that comes with Emacs), aren't
you? If not, you have no right to complain...
I think it is available on CPAN somewhere, one of the misc directories
perhaps.
When will RMS wisen up and replace perl-mode for good? Some sort of licensing
issue?
--
Jesse "Da Juice" Glick
mailto:jglick@sig.bsh.com
617-867-1017
------------------------------
Date: 7 May 1997 21:06:35 GMT
From: "gary.stoker" <gary.stoker@MCI2000.com>
Subject: Urgent: Need help with web site design for a class I'm taking!
Message-Id: <01bc5b2a$71fa14a0$430737a6@debspar.colostate.edu>
Can anybody help me design an interactive form for my website using perl?
I've designed my web site using Microsoft's FrontPage and its file
extensions are not recognized at CSU. Perls are.
My web site is due Wednesday, May 14th. Any help would be greatly
appreciated.
Thanks,
Debbie
My e-mail address is debspar@holly.colostate.edu
------------------------------
Date: 8 Mar 97 21:33:47 GMT (Last modified)
From: Perl-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 8 Mar 97)
Message-Id: <null>
Administrivia:
The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc. For subscription or unsubscription requests, send
the single line:
subscribe perl-users
or:
unsubscribe perl-users
to almanac@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.misc (and this Digest), send your
article to perl-users@ruby.oce.orst.edu.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.
The Meta-FAQ, an article containing information about the FAQ, is
available by requesting "send perl-users meta-faq". The real FAQ, as it
appeared last in the newsgroup, can be retrieved with the request "send
perl-users FAQ". Due to their sizes, neither the Meta-FAQ nor the FAQ
are included in the digest.
The "mini-FAQ", which is an updated version of the Meta-FAQ, is
available by requesting "send perl-users mini-faq". It appears twice
weekly in the group, but is not distributed in the digest.
For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V8 Issue 447
*************************************