[12749] in Perl-Users-Digest
Perl-Users Digest, Issue: 159 Volume: 9
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jul 15 21:07:27 1999
Date: Thu, 15 Jul 1999 18:05:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 15 Jul 1999 Volume: 9 Number: 159
Today's topics:
Re: Accessing DBM file (Anno Siegel)
Anyone working on SMPP Protocol code? <brundlefly76@hotmail.com>
Re: C-like #define macros in Perl (Abigail)
CGI with Postscript? <kikim@cerc.utexas.edu>
Re: fork, children, and ground (Charles DeRykus)
Re: how do i convert a integer to string. (Larry Rosler)
How should I sort by different fields? <hiller@email.com>
Re: How to delete an element in the middle of an array (Anno Siegel)
Re: How to output derived value as float (Tad McClellan)
Re: Installing Modules Locally Help!!! (Earl Hood)
Re: Linux - Apache - Perl (Tad McClellan)
Re: long explanations wearying (was Re: Top 10 response <emschwar@rmi.net>
Re: loop problems (Greg Andrews)
Re: Net::NNTP problem <malcolm.dewjones@moh.hnet.bc.ca>
Perl Programmer Wanted ASAP - Great Rates $$$ <webmaster@accessx.com>
Perl search & replace in html spanning over several lin fredo67@hotmail.com
Re: Perl Wrapper (Earl Hood)
Re: Perl Wrapper (Anno Siegel)
Re: Q: panic pp_iter with foreach (Anno Siegel)
Re: regular expression (Tad McClellan)
Re: Statistics for comp.lang.perl.misc (Abigail)
Re: Test if a File Exists? (Abigail)
Re: Test if a File Exists? <tchrist@mox.perl.com>
Re: Tiny error in perlfaq5 (Abigail)
Re: Tom Christiansen is a perlscript himself... (Charles DeRykus)
Digest Administrivia (Last modified: 1 Jul 99) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 15 Jul 1999 23:49:37 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Accessing DBM file
Message-Id: <7mls2h$go2$1@lublin.zrz.tu-berlin.de>
Paul Lim <pylim@ecr.mu.oz.au> wrote in comp.lang.perl.misc:
>I hope someone can help me with this issue.
>
>I have a Perl script that runs a hack of Selena Sol's Calendar. I want
>to now link the password authentication to the user database on my web
>server (Apache). However I don't seem to be able to open the password
>file with the following code: (this was to test whether or not I could
>read the data)
>
> use DB_File;
> dbmopen (%DBM, "/www/vwliv/home/userdb/passwd", 0666) || die
>"Cannot open file passwd file: $!\n";
> while (($key, $value) = each %DBM) {
> print "key=$key, value=$value\n";
> }
> dbmclose %DBM;
>
>All this does when I run it is create a file "passwd" in the directory.
>The passwd DB is an NDBM (i assume) database created using the
>"user_manage.cgi" script, and is contained in the usual two files:
>"passwd.dir" and "passwd.pag".
Well, if it is an NDBM file you want to use NDBM_File. DB_File uses
Berkeley DB, which is different. Also, the use of dbmopen is ancient
and should not be used any more. See perldoc -f tie for instructions.
Anno
------------------------------
Date: Thu, 15 Jul 1999 23:12:11 GMT
From: Brundle <brundlefly76@hotmail.com>
Subject: Anyone working on SMPP Protocol code?
Message-Id: <7mlpri$ui4$1@nnrp1.deja.com>
I was wondering if anyone is working on Perl code for working with the
SMPP - Short Message Peer to Peer Interface - protocol (not to be
confused with the SNPP protocol!).
I have been having a hard time finding specs for this protocol, or
servers to test code against.
Any help would be appreciated.
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 15 Jul 1999 19:37:31 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: C-like #define macros in Perl
Message-Id: <slrn7osvld.c9j.abigail@alexandra.delanet.com>
Uri Guttman (uri@sysarch.com) wrote on MMCXLIV September MCMXCIII in
<URL:news:x7n1wxnbjo.fsf@home.sysarch.com>:
&&
&& d'oh! i knew that! can she allow her lusers to use deja? here is the url
&& for the post with the whole description of how i used -P
Well, access to deja isn't forbidden, but access to the keyboard is.
And there's no mouse.
Abigail
--
sub _'_{$_'_=~s/$a/$_/}map{$$_=$Z++}Y,a..z,A..X;*{($_::_=sprintf+q=%X==>"$A$Y".
"$b$r$T$u")=~s~0~O~g;map+_::_,U=>T=>L=>$Z;$_::_}=*_;sub _{print+/.*::(.*)/s}
*_'_=*{chr($b*$e)};*__=*{chr(1<<$e)};
_::_(r(e(k(c(a(H(__(l(r(e(P(__(r(e(h(t(o(n(a(__(t(us(J())))))))))))))))))))))))
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Thu, 15 Jul 1999 19:47:49 -0500
From: Kyoil Kim <kikim@cerc.utexas.edu>
Subject: CGI with Postscript?
Message-Id: <378E8134.EA2173D8@cerc.utexas.edu>
I executed the following cgi program, which shows simple ps file in a
web browser, but I got an error message
"the document contains no data". I don't know why. The codes are exactly
same with the one in the O'Reilly &
Associates's book, CGI programming. Please let me know what the problem
is. Thanks.
The codes are as follows.
=====================================================================
#!/usr/local/bin/perl
$GS = "usr/local/bin/gs";
$| = 1;
print "Content-type: image/gif", "\n\n";
($seconds, $minutes, $hour) = localtime(time);
if($hour > 12) {
$hour -= 12 ;
$ampm = "pm";
}
else {
$ampm = "am";
}
if ($hour == 0 ) {
$hour = 12;
}
$time = sprintf("%02d:%02d:%02d %s", $hour, $minutes, $seconds, $ampm);
$x = 80;
$y = 15;
open (GS, "|$GS -sDEVICE=gif8 -sOutputFile=- -q -g${x}x${y} - 2>/dev/null");
print GS <<End_of_PS_Code;
%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: 0 0 $x $y
%%EndComments
/Times-Roman findfont 14 scalefont setfont
/red {1 0 0 setrgbcolor} def
/black {0 0 0 setrgbcolor} def
black clippath fill
0 0 moveto
($time) red show
showpage
End_of_PS_Code
close(GS);
exit(0);
------------------------------
Date: Thu, 15 Jul 1999 23:49:50 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: fork, children, and ground
Message-Id: <FExrJ2.5Dp@news.boeing.com>
In article <378E3074.D35B967F@networkengines.com>,
jerrad pierce <jerrad@networkengines.com> wrote:
>Is it possible to have the child of a background process to come into the foreground when it forks?
>
No - if you mean a program backgrounded from a shell using
job control.
--
Charles DeRykus
------------------------------
Date: Thu, 15 Jul 1999 16:05:25 -0700
From: lr@hpl.hp.com (Larry Rosler)
Subject: Re: how do i convert a integer to string.
Message-Id: <MPG.11f8091162cfee6a989cde@nntp.hpl.hp.com>
[Posted and a courtesy copy mailed.]
In article <7mljd7$s1r$1@nnrp1.deja.com> on Thu, 15 Jul 1999 21:21:56
GMT, Dale Henderson <dhenders@cpsgroup.com> says...
> In article <7mg4kg$scg$1@nnrp1.deja.com>,
> cramey@my-deja.com wrote:
> > i want to convert an integer
> >
> > specifically
> >
> > 1111111 to a string with
> >
> > str[0] == 1
> > .
> > .
> > .
> > str[6] == 1
> >
> > is there an easy way to do this ?
> (newsfeed is on the fritz, posting from dejanews)
> you might try this. It does almost exactly what you ask.
<SNIP> of C-ish code reproduced more legibly in the benchmark below.
It's hard to know what to make of this submission, other than to take it
at face value. TMTOWTDI, isn't there? So here's a benchmark.
#!/usr/local/bin/perl -w
use strict;
use Benchmark;
my $x = 1_111_111;
timethese(1 << (shift || 0), {
Loop => sub {
my $num = $x;
my $len = int(log($num)/log(10));
my $str = " " x $len;
while ($num > 0) {
my $digit = $num%10;
substr($str, $len, 1) = sprintf("%d", $digit);
$num = int($num/10);
$len--;
}
"|$str|\n"
},
String => sub { "|$x|\n" },
});
__END__
Benchmark: timing 65536 iterations of Loop, String...
Loop: 14 wallclock secs (14.20 usr + 0.00 sys = 14.20 CPU)
String: 1 wallclock secs ( 0.39 usr + 0.00 sys = 0.39 CPU)
(warning: too few iterations for a reliable count)
Maybe we need an award for The Least Appropriate Way To Do It.
> --
> Dale Henderson <mailto:dhenders@cpsgroup.com>
...
If you put a magic invisible trailing space after the two dashes, proper
newsreaders will snip your signature automatically.
--
(Just Another Larry) Rosler
Hewlett-Packard Laboratories
http://www.hpl.hp.com/personal/Larry_Rosler/
lr@hpl.hp.com
------------------------------
Date: Fri, 16 Jul 1999 00:20:04 GMT
From: Jordan Hiller <hiller@email.com>
Subject: How should I sort by different fields?
Message-Id: <378E7AB8.D006722F@email.com>
I have a tab-delimeted file something like this (just an example):
Bob 43 M
Jane 42 F
Joe 67 M
My perl script needs to read in this file and print it out as a HTML table. That
part I can handle with a simple hash, split, and loop.
But, it must also be able to sort by any column before it makes the HTML table.
I've read the docs on sort and I understand how to use it for a simple array,
but I'm not sure what to do here. I'm not even sure how to lay out my data
structure. Can someone give me a bit of help?
Thanks,
Jordan
------------------------------
Date: 15 Jul 1999 23:09:13 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: How to delete an element in the middle of an array
Message-Id: <7mlpmp$gis$1@lublin.zrz.tu-berlin.de>
Matthew Bafford <*@dragons.duesouth.net> wrote in comp.lang.perl.misc:
>delete is a function to delete an element (or more) of a tied hash.
Any hash, really, but I guess that was a typo.
Anno
------------------------------
Date: Thu, 15 Jul 1999 14:08:39 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: How to output derived value as float
Message-Id: <738lm7.6lm.ln@magna.metronet.com>
Tom Kralidis (tom.kralidis@ccrs.nrcanDOTgc.ca) wrote:
: eg. $value = 5464085.0 + ((400 -1) * 5);
: print "$value";
: ...gives me 5466080
: How can I print out the first example as 5466080.0, to show one decimal
: place when 0?
printf '%.1f', $value;
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 15 Jul 1999 23:04:59 GMT
From: ehood@medusa.acs.uci.edu (Earl Hood)
Subject: Re: Installing Modules Locally Help!!!
Message-Id: <7mlper$jvn@news.service.uci.edu>
In article <378e632a.9265932@news.jps.net>,
Jonathan Chum <jchum@jps.net> wrote:
>I have telnet access, but the ISP don't let users have access to the
>root to install new modules. How can I install modules locally? How
Set the PREFIX value. For example:
perl Makefile.PL PREFIX=/tmp/myperl5
make
make test
make install
Change "/tmp/myperl5" to a pathname you can write to.
>can I setup my CGI scripts to access them?
You'll have to add an explicit "use lib ..." pragma to your local
perl lib area at the beginning of your programs. When you do
a "make install" make note of the pathnames listed for where module
files went.
--ewh
--
Earl Hood | University of California: Irvine
ehood@medusa.acs.uci.edu | Electronic Loiterer
http://www.oac.uci.edu/indiv/ehood/ | Dabbler of SGML/WWW/Perl/MIME
------------------------------
Date: Thu, 15 Jul 1999 13:11:43 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: Linux - Apache - Perl
Message-Id: <fo4lm7.4km.ln@magna.metronet.com>
JT (jett1not@homedot.com) wrote:
: I realize it's off-topic, but it's a simple question -
: what's the big deal?
Well if we are not going to respect topics, lets have a
single newsgroup with hundreds of thousands of articles
each day.
Then everybody would know where to go, but
they couldn't find anything when they got there.
You are not alone. There are thousands of people available for
making off-topic postings. Let's not encourage them to jump in.
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 15 Jul 1999 16:21:10 -0600
From: Eric The Read <emschwar@rmi.net>
Subject: Re: long explanations wearying (was Re: Top 10 responses)
Message-Id: <xkfzp0xk10p.fsf@valdemar.col.hp.com>
Mats Pettersson <mats.pettersson@falukuriren.se> writes:
> Why not split perl.misc to three groups like:
Isn't this a FAQ? And if not, should we make it one, given that the
people who ask it are generally the people who don't read the FAQs
anyway?
To answer your question Mats, it's because many newbies will never use
.newbie, because they want the real answers from the folks in
.professional. If no "professional" (by which you seem to mean people
who know their arse from their elbow) reads .newbie, then only newbies
will post there, and the newbies will give incorrect answers, inefficient
ones, and contradict the FAQ right and left.
There's already a newsgroup for CGI programmers--
comp.infosystems.www.authoring.cgi. If there's so much Perl traffic
there that you think it deserves its own newgroup, then feel free to take
on its creation yourself. In any event, the issues relevant to CGI are
relevant no matter what language you're writing your CGI programs in, and
it doens't seem fair to me to restrict discussion only to those using
Perl.
What this leaves us with, then, is the same situation we're in now--
clp.professional takes the place of .misc, .newbie is full of errors (if
it's full of anything at all), and .cgi will be essentially redundant
with ciwa.cgi. What good, exactly, do you see coming of this?
-=Eric
------------------------------
Date: 15 Jul 1999 16:04:32 -0700
From: gerg@shell.ncal.verio.com (Greg Andrews)
Subject: Re: loop problems
Message-Id: <7mlpe0$oeo$1@shell1.ncal.verio.com>
James Gerard Coleman <jgc5a@j2.mail.virginia.edu> writes:
>ok.. this is really confusing me..
>
>i've got this set of code:
>
>while(<INFILE>) {
> if ($_ =~ /authenticat/) { # look and see if value exists
> $tempauth[$i++] = $_; # put values into an array
> for ($j; $j<=$#tempauth; $j++) {
^^
shouldn't this be $j = 0 ?
> for ($k; $k<=$#cryptokeys; $k++) {
> print "$j ";
> }
> }
> }
>}
>
I'd have to say that I would write it a little differently
while (<INFILE>) {
next unless /authenticat/; # skip non-authenticat lines
push @tempauth, $_; # add line to array
for ($j = 0; $j <= $#tempauth; $j++) {
for ($k = 0; $k <= $#cryptokeys; $k++) {
print STDOUT "$j ";
}
}
}
Of course, if @cryptokeys has no elements, nothing will print out.
If the input file has no lines with "authenticat" in them, the same
thing will (won't) happen.
-Greg
------------------------------
Date: Thu, 15 Jul 1999 15:56:16 -0700
From: Malcolm Dew-Jones <malcolm.dewjones@moh.hnet.bc.ca>
Subject: Re: Net::NNTP problem
Message-Id: <378E6710.93015DF@moh.hnet.bc.ca>
...points added to the code below...
Oliver Ertl wrote:
>
> Hello,
>
> why is the program below not working ?
>
> #!/usr/bin/perl
> open(DB, "newsserver.db"); # Open the file
> @nntpserver = <DB>; # Read it into an array
At this point, surely each hostname string has an embedded LF at the
end. Perhaps each line needs to be chop'd or chomp'd.
> close(DB); # Close the file
>
> foreach $hostname (@nntpserver) {
> print "\n";
> print "Fetching newsgroups from $hostname\n";
>
> my $nntp = Net::NNTP->new("$hostname", Timeout=>60, Debug=>On) | die
Also, perhaps the single bar in " | die" is a problem. (I haven't
looked at the below.)
> "Couldn't connect to server $hostname";
> my $list = $nntp->list();
>
> open(OUTF,">groups/$hostname");
> for my $group (sort keys %{$list}) { # should sort I guess
> my $info = $list->{$group};
> print OUTF "$group\t"; # group name
> print OUTF "($info->[0] - $info->[1])"; # first and last article
> for (my $i=2;$i<@{$info};$i++) { # slow (but only 1 field
> over here anyway)
> print OUTF "$info->[$i]"; # extra information
> }
> print OUTF "\n";
> }
> close(OUTF);
>
> print "Done.\n";
> print "\n";
>
> $lines = 0;
> open(FILE, "groups/$hostname") or die "Can't open $filename";
> while (sysread FILE, $buffer, 4096) {
> $lines += ($buffer =~ tr/\n//);
> }
> print "Newsserver : $hostname\n";
> print "Port : 119\n";
> print "No. of groups : $lines\n\n";
> close FILE;
> }
>
> --
> Suedostbayern Online Tel ......: +49 8679 912213
> Oliver Ertl Fax ......: +49 8679 969742
> Talhauser Str. 18 Mobil ....: +49 172 8352913
> 84508 Burgkirchen/Alz eMail ....: oe@sob-online.net
> Germany Homepage .: http://www.sob-online.net
------------------------------
Date: Fri, 16 Jul 1999 00:55:53 +0100
From: The Main Man <webmaster@accessx.com>
Subject: Perl Programmer Wanted ASAP - Great Rates $$$
Message-Id: <378E73CC.7363A842@accessx.com>
We are in need for a Perl Programmer to work on a variery of exciting
new projects in the adult entertainment biz.
Candidate must have own equipment and be ok to work on his/her own and
to strict deadlines.
Good Fun Company and good rates of pay + bonuses.
Email resume /experience to webmaster@accessx.com
------------------------------
Date: Fri, 16 Jul 1999 00:43:14 GMT
From: fredo67@hotmail.com
Subject: Perl search & replace in html spanning over several lines
Message-Id: <7mlv71$f0$1@nnrp1.deja.com>
Hi,
I'm a newbie to perl, and I have to replace ad code (such as banners)
in a multitude of html pages with other code, including the actual
page's name.
For example, currently I have in my html docs:
<!-- Begin AdsRotation Banners -->
<iframe src="http://www.adsrotation.com/....blah
blah>OSWHC=282:328:468:60:Entertainme .. blah blah
...blah blah...>
<!-- End AdsRotation Banners -->
and I want to replace it with
<--Begin my code -->
<A HREF="http://yada yada ...blah blah/WWW.MYDOMAIN.COM/THISPAGE.HTML>
<IMG SRC="http://yada yada.. blah blah/WWW.MYDOMAIN.COM/THISPAGE.HTML>
<--End new code -->
I was wondering if anyone here knew a good solution to my problem. I
don't know much perl, but I figured that perl would do the trick.
Basically, I know there is a short quick little solution to this, but I
don't know how to start.
Would anyone be able to give some hints?
Thanks,
Please also reply to fwhsu@ucla.edu
fred
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
------------------------------
Date: 15 Jul 1999 23:13:53 GMT
From: ehood@medusa.acs.uci.edu (Earl Hood)
Subject: Re: Perl Wrapper
Message-Id: <7mlpvh$kbt@news.service.uci.edu>
In article <7mlobp$gbp$1@lublin.zrz.tu-berlin.de>,
Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
>Jeff Pitman <jpitman@novell.com> wrote in comp.lang.perl.misc:
>>{Initialize Namespace}
>>$ScriptDir="$ENV{HTTP_HOST}/";
>>
>>require "$in{SCRIPT}";
...
>>But, require doesn't import the current variables into the subsequent file.
>Perl variables you have defined before the require are visible in the
>required script. Variables that are defined in the required script
>are visible after the require.
This is not completely true. my() variables will not be visible.
If you want to achieve the import functionality like the `use' operator,
then do "perldoc -f use".
--ewh
--
Earl Hood | University of California: Irvine
ehood@medusa.acs.uci.edu | Electronic Loiterer
http://www.oac.uci.edu/indiv/ehood/ | Dabbler of SGML/WWW/Perl/MIME
------------------------------
Date: 15 Jul 1999 23:33:22 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Perl Wrapper
Message-Id: <7mlr42$gm6$1@lublin.zrz.tu-berlin.de>
Earl Hood <ehood@medusa.acs.uci.edu> wrote in comp.lang.perl.misc:
>In article <7mlobp$gbp$1@lublin.zrz.tu-berlin.de>,
>Anno Siegel <anno4000@lublin.zrz.tu-berlin.de> wrote:
>>Jeff Pitman <jpitman@novell.com> wrote in comp.lang.perl.misc:
>
>>>{Initialize Namespace}
>>>$ScriptDir="$ENV{HTTP_HOST}/";
>>>
>>>require "$in{SCRIPT}";
>...
>>>But, require doesn't import the current variables into the subsequent file.
>
>>Perl variables you have defined before the require are visible in the
>>required script. Variables that are defined in the required script
>>are visible after the require.
>
>This is not completely true. my() variables will not be visible.
Oh dear, yes. And this in a place where everybody is taught to use
strict. I'm so sorry.
Anno
------------------------------
Date: 15 Jul 1999 23:29:51 -0000
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Q: panic pp_iter with foreach
Message-Id: <7mlqtf$gkm$1@lublin.zrz.tu-berlin.de>
<spertus@mills.edu> wrote in comp.lang.perl.misc:
>I am getting the following error:
>
> panic: pp_iter at treasure.pl line 191, <SOURCE> chunk 1.
Shouldn't happen. Shouldn't happen at all.
>I got the following information from perldiag:
>
> (P) The foreach iterator got called in a non-loop context frame.
>
>Could somebody tell me what this means or what I am doing wrong? I was
>unable to find any further documentation on loop contexts or pp_iter.
You are doing nothing wrong, perl is. In other words, it's a bug.
>Here are the relevant lines from my program:
>
>182: while($bigline = <SOURCE>) {
>183: print STDERR "\nBIGLINE = /$bigline/\n";
>184: if ($bigline) {
>185: @lines = split /\n|\r|\f/, $bigline;
>186: $numlines = @lines;
>187: print STDERR "Number of lines = $numlines\n";
>188: foreach $line (@lines) {
>189: print STDERR "\nLine: $line\n";
>190: }
>191: foreach $line (@lines) {
>192: print STDERR "Current line: /$line/\n";
> # do a bunch of stuff, none of it modifying $line or
> # leaving the loop
> }
> }
> }
>
>I have read the FAQ, searched Usenet, used "-w" and "-d", etc. I am
>using perl5.005_03 built for i386-linux under Redhat 6. I would also be
>grateful for any workarounds.
I'm running the same perl under Redhat 5.2. Your program snippet,
laudably self-contained as it is, (except for $/ = '', I assume)
runs fine here with a random multi-paragraph file for input.
Probably a case for perlbug.
Anno
------------------------------
Date: Thu, 15 Jul 1999 13:22:22 -0400
From: tadmc@metronet.com (Tad McClellan)
Subject: Re: regular expression
Message-Id: <ec5lm7.4km.ln@magna.metronet.com>
h0444vcs@rz.hu-berlin.de wrote:
: I have an array consisting of lines.
: Each line has different fields seperated by ":" (like /etc/passwd ).
: @array = grep { !/$name/ } @array ;
: would remove all entries in the array where $name appears.
: But I want to ensure that only these entries are removed where
: $name appears in a certain field of the line.
@array = grep { (split /:/, $_)[$certain_field] !~ /$name/ } @array ;
--
Tad McClellan SGML Consulting
tadmc@metronet.com Perl programming
Fort Worth, Texas
------------------------------
Date: 15 Jul 1999 19:46:18 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Statistics for comp.lang.perl.misc
Message-Id: <slrn7ot05s.c9j.abigail@alexandra.delanet.com>
Gabriel Russell (grussell@hushmail.com) wrote on MMCXLIV September
MCMXCIII in <URL:news:37902c0a.182995353@news.supernews.com>:
{}
{} Hmm, I can't see a single article by Abigail here on SuperNews.
SuperNews sounds like a service ISP outsource their Usenet management to.
My ISP lacks knowledge, and hence outsources as well, but to a different
service. Other people have complained they can't read my postings as well.
It isn't hard to add 1 and 1 together.
Abigail
--
perl -we 'print split /(?=(.*))/s => "Just another Perl Hacker\n";'
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 15 Jul 1999 19:48:01 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Test if a File Exists?
Message-Id: <slrn7ot091.c9j.abigail@alexandra.delanet.com>
Tom Christiansen (tchrist@mox.perl.com) wrote on MMCXLIV September
MCMXCIII in <URL:news:378dcef8@cs.colorado.edu>:
;;
;; A round? A bloody *round*? What do we need obsequious repetition for?
;; Are not unbridled creativity, innovative intelligence, and multifaceted
;; multiplicities of meaning the hallmarks of the Perl programmer?
;;
;; This clearly indicates that the optimal model for documentation listening
;; should of course be a fugue. It's not clear how the pieces would be
;; woven and stacked so that they have both a vertical parse (chordal) and
;; a horizontal one (melodic), but a seven-part fugue comprising perlref,
;; perldsc, perllol, perltoot, perltootc, perlobj, and perltie would be
;; a wonder to behold.
Do you think you can work something out in time for TPC, and have it
performed by seven major Perl-porters?
Abigail
--
srand 123456;$-=rand$_--=>@[[$-,$_]=@[[$_,$-]for(reverse+1..(@[=split
//=>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\n"
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: 15 Jul 1999 18:52:18 -0700
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Test if a File Exists?
Message-Id: <378e8242@cs.colorado.edu>
In comp.lang.perl.misc, abigail@delanet.com writes:
:Do you think you can work something out in time for TPC, and have it
:performed by seven major Perl-porters?
I don't think we have the necessary breadth pitch ranges. And of course,
folks would actually have to read, which is always a challenge.
--tom
--
People usually get what's coming to them... unless it was mailed.
------------------------------
Date: 15 Jul 1999 19:52:35 -0500
From: abigail@delanet.com (Abigail)
Subject: Re: Tiny error in perlfaq5
Message-Id: <slrn7ot0hm.c9j.abigail@alexandra.delanet.com>
John Borwick (John.Borwick@sas.com) wrote on MMCXLIV September MCMXCIII
in <URL:news:379215b3.18040520@newshost.unx.sas.com>:
\\
\\ rand(1000) will return a number in the range 0..999, so if rand is
\\ truly random then approximately every thousand times the function is
\\ called there will be a division by zero error.
I suggest running:
#!/opt/perl/bin/perl -w
use strict;
KITTY:
my $doggie = rand 1000;
print $doggie, "\n";
goto KITTY if $doggie;
__END__
for a while. After a long session of staring at the screen, enlightment
might come.
Abigail
--
srand 123456;$-=rand$_--=>@[[$-,$_]=@[[$_,$-]for(reverse+1..(@[=split
//=>"IGrACVGQ\x02GJCWVhP\x02PL\x02jNMP"));print+(map{$_^q^"^}@[),"\n"
-----------== Posted via Newsfeeds.Com, Uncensored Usenet News ==----------
http://www.newsfeeds.com The Largest Usenet Servers in the World!
------== Over 73,000 Newsgroups - Including Dedicated Binaries Servers ==-----
------------------------------
Date: Thu, 15 Jul 1999 22:12:25 GMT
From: ced@bcstec.ca.boeing.com (Charles DeRykus)
Subject: Re: Tom Christiansen is a perlscript himself...
Message-Id: <FExn0p.1Lu@news.boeing.com>
In article <1duymym.1fu1wzb16icj0eN@p82.tc2.metro.ma.tiac.com>,
Ronald J Kimball <rjk@linguist.dartmouth.edu> wrote:
>
>I should know; I was one of those obnoxious newbies at the time.
No, it's a special group and well... you just never really
fit in :)
--
Charles DeRykus
------------------------------
Date: 1 Jul 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 1 Jul 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.
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 V9 Issue 159
*************************************