[6569] in Perl-Users-Digest
Perl-Users Digest, Issue: 194 Volume: 8
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Mar 28 05:08:04 1997
Date: Fri, 28 Mar 97 02:00:30 -0800
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Fri, 28 Mar 1997 Volume: 8 Number: 194
Today's topics:
Adding to @INC for module installation? (Jack Siler)
Re: Banner Rotator?? (Nathan V. Patwardhan)
Re: Does perl have constants? <tchrist@mox.perl.com>
Re: Does perl have constants? <rra@stanford.edu>
Establishing Distances??? <none@nowhere.new>
Re: File Locking <rootbeer@teleport.com>
Re: File Locking <tchrist@mox.perl.com>
Re: finding out which user added modules are installed (Nathan V. Patwardhan)
Re: finding out which user added modules are installed <eric@nettown.com>
Re: getting year from localtime (I R A Aggie)
glob function <sstyerwa@cisco.com>
Re: How to sort an arrary? <eric@nettown.com>
LWP support proxy_authentication yet? <jim.oconnor@amp.com>
NewbieQ: pass file handle to sub (SUN TONG)
Opening file for reading and writing simultaneously und markus@gsmag.com
perl5.003_94 w/sfio97 problem on alpha-dec_osf 3.2 <nath@math.earlham.edu>
POD: Style Guide or Module Template Available? <billc@tibinc.com>
Re: Question about the SYSTEM functionIn a Perl program <eric@nettown.com>
Sockets and STDOUT Buffers <curt@van.hookup.net>
Re: Sockets and STDOUT Buffers <rra@stanford.edu>
Trying to process empty file (Geoffrey Hebert)
Re: Trying to process empty file <eric@nettown.com>
Re: Unix and ease of use (WAS: Who makes more ...) <jasonw@sequent.com>
Re: Unix and ease of use (WAS: Who makes more ...) <csweber@flash.net>
use and if test <langlois@csn.net>
Re: What's wrong with "an email" <colin@kindness.demon.co.uk>
Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: 27 Mar 1997 23:53:17 GMT
From: siler@compstat.wharton.upenn.edu (Jack Siler)
Subject: Adding to @INC for module installation?
Message-Id: <5hf19d$iqb@netnews.upenn.edu>
A box on which I use perl has 5.003 installed but not the CPAN
modules. I'm trying to install some of them in MYHOME/CPAN. libwww,
IO and CGI go in ok but libnet looks for IO socket in @INC during the
perl Makefile.PL step and can't find it. It ain't there, it's
in CPAN. I know one can use PREFIX= to specify an alternate place to
install modules, I wonder if there's a similar parameter for
Makefile.PL to add additional places to look for pre-requisite
modules. I remember (installing on a different machine) using such
a parameter to point to the perl libs when they were in my home
directory.
Close to the above subject: Is there a doc/faq that explains the
module library structure; I can't figure out what goes where- lib/ or
/lib/site_perl or ...
Thanks very much.
Jack
siler@wharton.upenn.edu
------------------------------
Date: 28 Mar 1997 03:09:20 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: Banner Rotator??
Message-Id: <5hfcp0$m3j@fridge-nf0.shore.net>
Michael Burdick (Bman99970@mindspring.com) wrote:
: If anyone has a banner rotator or knows where to get one please e-mail
: me! Thanks!!
Are you sure you REALLY want a banner rotator? I hear that their union
representatives are impossible, and they'll only rotate a banner once an
hour if you're lucky. You might try the TIME-LIFE series on banner rotation,
and do it yourself. :-)
Seriously, if you're looking for something dealing with images, CGI, HTML,
WWW, please post appropriately to comp.infosystems.www.authoring.cgi!
Good luck!
--
Nathan V. Patwardhan
nvp@shore.net
------------------------------
Date: 28 Mar 1997 03:34:10 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: Does perl have constants?
Message-Id: <5hfe7i$rn1$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc,
rshecter@faculty.ed.umuc.edu (Robb Shecter) writes:
:Hi,
:
:For the life of me, I can't find out how to declare (and use) constants in
:perl. (I happen to be working in Perl4, but haven't seen anything in
:Perl5, either.) Does perl support the standard, run-of-the-mill constant?
:
:I'm suprised that there's no mention of this in books like "Programming perl",
:for example.
It's in there.
*PI = \3.14159.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
"Help save the world!" --Larry Wall in README
------------------------------
Date: 27 Mar 1997 16:40:51 -0800
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Does perl have constants?
Message-Id: <qumiv2c6e7g.fsf@cyclone.stanford.edu>
Robb Shecter <rshecter@faculty.ed.umuc.edu> writes:
> For the life of me, I can't find out how to declare (and use) constants
> in perl. (I happen to be working in Perl4, but haven't seen anything in
> Perl5, either.) Does perl support the standard, run-of-the-mill
> constant?
The standard way to do constants in Perl is with a sub that returns the
value of the constant. Perl is capable of internally optimizing these
subs away.
For example:
sub pi { 3.14159265358979323846 }
--
Russ Allbery (rra@stanford.edu) <URL:http://www.eyrie.org/~eagle/>
------------------------------
Date: 28 Mar 1997 03:00:14 GMT
From: "Jonathan S Hardiman" <none@nowhere.new>
Subject: Establishing Distances???
Message-Id: <01bc3b24$7c1147e0$4910f5cf@dixxonn.on.ca>
Whoever can help.
I am trying to find out whether it is possible to determine (Preferrably in
CGI) the distance between a persons address and the nearest office, without
use of an extremely lengthy subroutine.
I have written a script which processes a purchase order. It's main
function is to tell the user how far from the nearest office he/she is, and
thus how much the shipping costs would be. Can this be done without the 92
page subroutine I have at the moment.
Suggestions AND examples are always extremely welcomed.
The Emperor.
emperor@pathcom.com
------------------------------
Date: Thu, 27 Mar 1997 19:19:06 -0800
From: Tom Phoenix <rootbeer@teleport.com>
To: Rich Schramm <rdschramm@scripps.com>
Subject: Re: File Locking
Message-Id: <Pine.GSO.3.96.970327191350.15008O-100000@kelly.teleport.com>
On 27 Mar 1997, Rich Schramm wrote:
> Newsgroups: comp.lang.perl, comp.lang.perl.misc
Thar ain't no comp.lang.perl. Tell your newsadmin to see the posting about
Bogus newsgroup names in news.announce.newgroups.
> I am concerned about blocked processes attempting to write to my file
> after I unlock it but before I close it.
Don't unlock it. Just close it, and the buffers will be flushed, the file
closed, and the locks released, all in the proper order. You'll be happy.
Your data will be safe. Peace and tranquility will once again reign among
the heavens and on Earth, and a new world order of -- well, now I've said
too much. Just take my word for it: It'll do what you need.
I think you might want to see the methods in Randal's fourth Web
Techniques column, which explains all you need about how to use flock().
Hope this helps!
http://www.stonehenge.com/merlyn/WebTechniques/
-- Tom Phoenix http://www.teleport.com/~rootbeer/
rootbeer@teleport.com PGP Skribu al mi per Esperanto!
Randal Schwartz Case: http://www.lightlink.com/fors/
------------------------------
Date: 28 Mar 1997 00:39:41 GMT
From: Tom Christiansen <tchrist@mox.perl.com>
Subject: Re: File Locking
Message-Id: <5hf40d$jmk$1@csnews.cs.colorado.edu>
[courtesy cc of this posting sent to cited author via email]
In comp.lang.perl.misc, "Rich Schramm" <rdschramm@scripps.com> writes
about locking.
Could you please see what the FAQ has to say about this? It's at
http://www.perl.com/perl/faq/index.html . Then feel free to come back
and ask whatever questions you have left.
BTW, don't bother postings to comp.lang.perl; it's dead.
--tom
--
Tom Christiansen tchrist@jhereg.perl.com
echo $package has manual pages available in source form.
echo "However, you don't have nroff, so they're probably useless to you."
--Larry Wall in Configure from the perl distribution
------------------------------
Date: 28 Mar 1997 03:00:41 GMT
From: nvp@shore.net (Nathan V. Patwardhan)
Subject: Re: finding out which user added modules are installed
Message-Id: <5hfc8p$m3j@fridge-nf0.shore.net>
David Ishee (dmi1@ra.msstate.edu) wrote:
: Is there an easy way to determine what modules you have added to your
: perl setup? When I download a new cool module to install, the README
: may give a list of other modules which are required. I can see that
[snip]
Yes. If you're root, install CPAN.pm, or have your administrator do it.
You might also have a look at perllocal.pod, which is possibly located in;
/usr/local/lib/perl5/site_perl/<your os_name>/5.00?/perllocal.pod . You'll
find what packages are installed (and where), as well how these packages
are linked, the versions of the packages, and when the packages were added.
As for *who* installed the mods, I dunno, I'm always root when I do it,
so I can't tell you differently. :-)
: I looked at perllocal.pod on my machine but it doesn't contain info on
: the module name: only version, install directory, etc.
??? My perllocal.pod has entries like the following, which seem to show
the module name: Would it be possible that pod2text/html/whatever is
having problems with =head3 (I ask this, because mine does)?
--- BEGIN
=head3 Tue Mar 25 23:06:08 1997: C<Module Data::Dumper>
=over 4
=item *
C<installed into: /usr/local/lib/perl5/site_perl>
=item *
C<LINKTYPE: dynamic>
=item *
C<VERSION: 2.07>
=item *
C<EXE_FILES: >
=back
---END
Hope this helped!
--
Nathan V. Patwardhan
nvp@shore.net
------------------------------
Date: Thu, 27 Mar 1997 21:50:31 +0000
From: Eric Poindexter <eric@nettown.com>
Subject: Re: finding out which user added modules are installed
Message-Id: <333AEBA7.73FB8BE@nettown.com>
Web page addresses for below.
http://nettown.com/perl/Search.cgi?s=CPAN
http://nettown.com/perl/Search.cgi?s=perllocal
Nathan V. Patwardhan wrote:
>
> David Ishee (dmi1@ra.msstate.edu) wrote:
> : Is there an easy way to determine what modules you have added to your
> : perl setup? When I download a new cool module to install, the README
> : may give a list of other modules which are required. I can see that
> [snip]
>
> Yes. If you're root, install CPAN.pm, or have your administrator do it.
>
> You might also have a look at perllocal.pod, which is possibly located in;
> /usr/local/lib/perl5/site_perl/<your os_name>/5.00?/perllocal.pod . You'll
> find what packages are installed (and where), as well how these packages
> are linked, the versions of the packages, and when the packages were added.
>
> As for *who* installed the mods, I dunno, I'm always root when I do it,
> so I can't tell you differently. :-)
>
> : I looked at perllocal.pod on my machine but it doesn't contain info on
> : the module name: only version, install directory, etc.
>
> ??? My perllocal.pod has entries like the following, which seem to show
> the module name: Would it be possible that pod2text/html/whatever is
> having problems with =head3 (I ask this, because mine does)?
>
> --- BEGIN
>
> =head3 Tue Mar 25 23:06:08 1997: C<Module Data::Dumper>
>
> =over 4
>
> =item *
>
> C<installed into: /usr/local/lib/perl5/site_perl>
>
> =item *
>
> C<LINKTYPE: dynamic>
>
> =item *
>
> C<VERSION: 2.07>
>
> =item *
>
> C<EXE_FILES: >
>
> =back
>
> ---END
>
> Hope this helped!
>
> --
> Nathan V. Patwardhan
> nvp@shore.net
--
Eric
<mailto:eric@nettown.com>
[http://nettown.com/perl/]
have a good day! (yes, Poindexter is Really my name :-)
------------------------------
Date: Wed, 26 Mar 1997 12:21:19 -0500
From: fl_aggie@hotmail.com (I R A Aggie)
Subject: Re: getting year from localtime
Message-Id: <fl_aggie-ya02408000R2603971221190001@news.fsu.edu>
In article <Pine.SUN.3.95.970326102713.10017A-100000@ernie.eecs.uic.edu>,
Alex Mak <amak@ernie.eecs.uic.edu> wrote:
+ I am interested in getting the year in localtime.
No problem. Consult the Camel.
+ I know I can get the weekday.
+ $thisday =(Sun,Mon,Tue, Wed, Thu, fri, Sat)[(localtime)[6]];
+ print $thisday;
+ from the camel book, p.185
I see...you HAVE consulted the Camel. Go back and look at the
reference to localtime. Looking at the localtime man page may
also provide some insight.
+ I want to be get the year number from the current datetime.
+ Any ideas?
Yeah, consult the Camel. You see where it sez (emphasis mine):
"This function converts the value returned by time to a _nine-element_
list with the time corrected for the local time zone. It's typically used
as follows:
[N= 0 1 2 3 4 5 6 7 8]
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
localtime(time);
'
So, $year=(localtime)[N]; where N is the location in the return list
of the year. Start at N=0, and increment N until you get to year.
James - in this case, N=5
--
Consulting Minster for Consultants, DNRC
To cure your perl CGI problems, please look at:
<url:http://www.perl.com/perl/faq/idiots-guide.html>
------------------------------
Date: 27 Mar 1997 23:17:44 GMT
From: "Steve Styerwalt" <sstyerwa@cisco.com>
Subject: glob function
Message-Id: <01bc3b04$fb3fed70$a5f944ab@sstyerwa-nt4>
Greetings,
I have a perl script which works great on my win95 machine, but under NT4
it fails on the glob function. Does anybody know why the glob function is
not working on my NT4 machine?
Thanks,
Steve
Cisco Systems
------------------------------
Date: Thu, 27 Mar 1997 22:49:56 +0000
From: Eric Poindexter <eric@nettown.com>
To: Tony Reeves <tony@vegas.es.hac.com>
Subject: Re: How to sort an arrary?
Message-Id: <333AF994.581E610E@nettown.com>
Tony Reeves wrote:
>
> Is there an easy way to sort a standard array?
>
> I have an array that contains:
> lastname, firstname, date, phone, location, manager
>
> I'd like to sort the array by the first value, that is lastname..
>
> is there an easy way to do this?
>
> I read that sort can work with assocate arrays.. but this is a standard
> one..
I'm assuming you mean an array of arrays, if so...
#!/usr/bin/perl
@unsorted = (
[qw(lastname2, firstname, date, phone, location, manager)],
[qw(lastname1, firstname, date, phone, location, manager)],
);
@sorted = sort arraySort @unsorted;
sub arraySort {
$a->[0] cmp $b->[0];
}
print "$sorted[0]->[0]\n";
--
Eric
<mailto:eric@nettown.com>
[http://nettown.com/perl/]
have a good day!
------------------------------
Date: Thu, 27 Mar 1997 21:21:34 -0500
From: Jim O'Connor <jim.oconnor@amp.com>
Subject: LWP support proxy_authentication yet?
Message-Id: <333B2B2E.1A7@amp.com>
Does anyone know if libwww supports proxy_authentication yet?
------------------------------
Date: Thu, 27 Mar 1997 21:54:45 -0600
From: ST@FS.com (SUN TONG)
Subject: NewbieQ: pass file handle to sub
Message-Id: <cUSapFSFTlInternetMail-970328034852Z-510@email.fs.com>
Hi,
I've searched through "Perl Programmers Reference Guide" but still got
confused how to pass a file handle to a sub.
Different than C, file handle in perl seems to me have two meaning: 1.
normal scalar (right?) and 2. a kind of "object methods" (?)
So, how do pass and receive file handle in sub?
* &ReadTilFrom(INPUT) ; ?
* &ReadTilFrom(*INPUT) ; ?
* &ReadTilFrom(\*INPUT) ; ?
I quote my code snip bellow. Could someone help me? Further more, I add
the errors bellow that comes out when I "use strict;". How do I overcome
it. Will a bounch of "my" listed at the beginning of program help?
34:open(INPUT,"<$infile") ||
35: die "Can't input $infile $!";
!Variable "$infile" is not imported at pw32.pl line 34.
!Global symbol "infile" requires explicit package name at pw32.pl line
34.
<...snip...>
85:while (<INPUT>) {
86: if (/^\.{37}$/) {
87: &ReadTilFrom(INPUT) ;
!Bareword "INPUT" not allowed while "strict subs" in use at pw32.pl line
87.
<...snip...>
108:sub ReadTilFrom(FILE_HANDEL){
109: $INPUT=shift;
110: while (<$INPUT>) {
!Variable "$INPUT" is not imported at pw32.pl line 109.
!...
Sun Tong
-- tsun@fs.com
Test email: st@fs.com (direct connection to internet, respond fast)
------------------------------
Date: Fri, 28 Mar 1997 02:26:11 GMT
From: markus@gsmag.com
Subject: Opening file for reading and writing simultaneously under perl?
Message-Id: <333b20ee.11168284@news-s01.ny.us.ibm.net>
Hello everyone,
AFAIK the open() function under perl only permits me to read XOR write
to a file. My question is whether there is a possibility to open a
file for readwrite simultaneously.
Many thanks
Markus Schlegel
------------------------------
Date: Thu, 27 Mar 1997 21:29:58 -0500
From: Nat Holder <nath@math.earlham.edu>
Subject: perl5.003_94 w/sfio97 problem on alpha-dec_osf 3.2
Message-Id: <Pine.NXT.3.95.970327193940.21052A-100000@litoria>
Hello,
I'm compiling perl 5.003 on a dec alpha runing digital unix 3.2. The
compilation goes without fault, but make test hangs on the lib/io_sel
test. When it gets to this test, make test waits (i suppose) forever on
the test. I tried running the individual test and it gave the following
output:
/usr/SRC-TMP/perl5.003_94/t># ../perl lib/io_sel.t
1..21
ok 1
ok 2
ok 3
ok 4
ok 5
ok 6
ok 7
ok 8
ok 9
ok 10
It then hung infinitely. The test code which it is hanging on is:
--------------------------------------
@a = $sel->can_read(); # should return imediately
print "not " unless @a == 0;
print "ok 10\n";
#we assume that we can write to STDOUT :-)
$sel->add([\*STDOUT, "ok 12\n"]);
@a = $sel->can_write;
print "not " unless @a == 1;
print "ok 11\n";
-------------------------------------
I installed sfio by making it and then moving the include and lib
directories to
/usr/local/include/sfio and /usr/local/lib/sfio and then giving these
directories to perl's Configure in the right places (I think).
Can someone tell me whether this lib/io_sel test failure is a real
problem, and how to fix it? My perl5.002 (no sfio) binary successfully ran
all 21 tests in lib/io_sel.t, so it seems as though it's an sfio problem.
Thank you,
-Nat Holder
----
Nathaniel Holder, Earlham College, Drawer 982, Richmond IN 47374-4095
Email: nath@math.earlham.edu Tel: (317) 973-2711 Fax: (317) 983-1304
PGP public key: finger nath@bufo.math.earlham.edu
************************************************************
Interested in an International Youth Conference this summer?
http://www.cs.earlham.edu/~nath/conference/
************************************************************
------------------------------
Date: Thu, 27 Mar 1997 18:50:49 -0500
From: Bill Cowan <billc@tibinc.com>
Subject: POD: Style Guide or Module Template Available?
Message-Id: <333B07D9.97A@tibinc.com>
I have read man pages for perlpod and perlsyn regarding POD directives
(=head1, =item, etc.). Also checked dejanews for "POD template" and
"POD style" without luck. For a new project, I want to have standard or
guidelines for POD embedded in the Perl program.
Does anyone have any suggestions or pointers?
What to do and not to do?
Standard template or skeleton of doc sections?
Thanks, Bill
-----------------------------------------------------------------------
Bill Cowan <billc@tibinc.com> Voice:919-490-0034 Fax:919-490-0143
Tiburon, Inc./3333 Durham-Chapel Hill Blvd Suite E-100/Durham, NC 27707
------------------------------
Date: Thu, 27 Mar 1997 19:53:28 +0000
From: Eric Poindexter <eric@nettown.com>
To: Efigenio Vieira de Ataide <ataide@planetarium.com.br>
Subject: Re: Question about the SYSTEM functionIn a Perl program I am trying to do the following:
Message-Id: <333AD038.2BF89275@nettown.com>
Efigenio Vieira de Ataide wrote:
>
> In a Perl program I am trying to do the following:
>
> system("/sbin/diplogin", $user) == 0 || die "calling diplogin: $?\n";
> &mysub;
> .
> .
>
> When the user closes the connection the program
> 'diplogin' ends (abnormaly?), and the subroutine mysub isn't called.
> Is there a way to have this subroutine called after the program
> diplogin?
>
> Thanks in advance for any help.
> Efigenio Ataide
> ataide@planetarium.com.br
You need to check the return from system. It will not be 0 if diplogin
ends abnormally. For example, on my machine, system returns 2 if I
control ^C the proccess run by system.
$error = system "/sbin/diplogin", $user;
print $error;
$error is 0 if everything is ok. .
Specifically, "the lower 8 bits [returned by system] are set if the
proccess died from a signal" --Programming Perl 2ed. Those bits above
the 8th contain the exit status of the process.
See "system" in http://nettown.com/src/pod/perlfunc.html
--
Eric
<mailto:eric@nettown.com>
[http://nettown.com/perl/]
have a good day! (yes, Poindexter is Really my name :-)
------------------------------
Date: Thu, 27 Mar 1997 17:28:19 -0800
From: Curt Cranfield <curt@van.hookup.net>
Subject: Sockets and STDOUT Buffers
Message-Id: <333B1EB3.51F2@van.hookup.net>
Hi All,
I am writting my first socket program and have run into a bit of a
problem with buffering my STDOUT. I am writing this program on a BSDI
machine.
What I am finding is that when the server side starts to write to STDOUT
that all the data is buffered. I know in C there is a function called
fflush which flushes a file handle which would work the same for writing
to STDOUT but perl has nothing like this (that I am aware of).
What I find is that I have no problems when I run the program from the
console, ie. STDIN and STDOUT are fine ... its only when I do it through
a socket that the problem arises.
I have looked throught the OREILLY books and haven't found anthing too
usefull other than the section (pg474(PERL5)) which explains getting
unbuffered, single-character input on a POSIX system - it looks messy.
Any information/ideas would be greatly appreciated.
Cheers,
Curt Cranfield
curt@van.hookup.net
------------------------------
Date: 27 Mar 1997 21:09:51 -0800
From: Russ Allbery <rra@stanford.edu>
To: curt@van.hookup.net
Subject: Re: Sockets and STDOUT Buffers
Message-Id: <qum20904n6o.fsf@cyclone.stanford.edu>
[ Posted and mailed. ]
Curt Cranfield <curt@van.hookup.net> writes:
> What I am finding is that when the server side starts to write to STDOUT
> that all the data is buffered. I know in C there is a function called
> fflush which flushes a file handle which would work the same for writing
> to STDOUT but perl has nothing like this (that I am aware of).
Set $| to 1 in your program to unbuffer STDOUT. See man perlvar for more
details.
--
Russ Allbery (rra@stanford.edu) <URL:http://www.eyrie.org/~eagle/>
------------------------------
Date: Fri, 28 Mar 1997 04:11:16 GMT
From: soccer@microserve.net (Geoffrey Hebert)
Subject: Trying to process empty file
Message-Id: <5hfff1$asq$1@news3.microserve.net>
I want to determine that I have no data.
I must be doing something dumb. I thought the code withing the while
would not execute at all, but it does. Then I check for some length
when there is none, but there is.
Here is my latest attempt:
$n=0;
READ_I: while (<INDEXFILE>)
{
chomp;
($dir_subject, $dir_piece) = split(/:/,$_,2);
if (length($dir_subject)>0) {$n=++$n}
## I should not get here
## $dir_subject was not previously defined
. . . other code deleted
}
print" <br>n is $n
## how does $n get to be 1?
Here is the directory showing no characters
reality% ls -acl d*
-rw-rw-rw- 1 webserv web 0 Mar 27 22:50 d000
------------------------------
Date: Thu, 27 Mar 1997 22:37:14 +0000
From: Eric Poindexter <eric@nettown.com>
To: Geoffrey Hebert <soccer@microserve.net>
Subject: Re: Trying to process empty file
Message-Id: <333AF69A.73510435@nettown.com>
Geoffrey Hebert wrote:
>
> I want to determine that I have no data.
> I must be doing something dumb. I thought the code withing the while
> would not execute at all, but it does. Then I check for some length
> when there is none, but there is.
>
> Here is my latest attempt:
> $n=0;
> READ_I: while (<INDEXFILE>)
> {
> chomp;
> ($dir_subject, $dir_piece) = split(/:/,$_,2);
> if (length($dir_subject)>0) {$n=++$n}
> ## I should not get here
> ## $dir_subject was not previously defined
> . . . other code deleted
>
> }
> print" <br>n is $n
>
> ## how does $n get to be 1?
>
> Here is the directory showing no characters
> reality% ls -acl d*
> -rw-rw-rw- 1 webserv web 0 Mar 27 22:50 d000
>
Do this at various places in your code
print "size = ", -s INDEXFILE, "\n";
--
Eric
<mailto:eric@nettown.com>
[http://nettown.com/perl/]
have a good day! (yes, Poindexter is Really my name :-)
------------------------------
Date: Thu, 27 Mar 1997 16:56:31 -0800
From: Jason Wells <jasonw@sequent.com>
Subject: Re: Unix and ease of use (WAS: Who makes more ...)
Message-Id: <333B173E.237D@sequent.com>
Mats Forssblad wrote:
rw26@acf2.nyu.edu (Randy Wright) wrote:
>much more like the model of Microsoft. Linux is not controlled.
>It cannot be made unprofitable. It is built BY its market and
>it becomes whatever that market wants it to be as the market
>decides what it wants.
Sure. Wait for MsLinux :-)
Yikes. Now there's an idea whose time should never come. 8^)
Jason
------------------------------
Date: Thu, 27 Mar 1997 19:48:31 -0600
From: "Spaceman Spiff!" <csweber@flash.net>
Subject: Re: Unix and ease of use (WAS: Who makes more ...)
Message-Id: <333B236F.78D7@flash.net>
_Save-It wrote:
>
> Douglas Seay wrote:
> > Isn't that the same way the Microsoft works? ;-)
>
> No, not at all. MS releases buggy code and thousands
> of people find work arounds or do without.
You forgot a step.
MS then charges for the fixes. Look at the MSVC4.0 scam
they set up.
I think my employer is starting to cave in and
realize that Linux is NOT an expensive solution
like the "UNIX" counterparts. Now that you've got
a choice for that mass-produced, cheap, PC hardware,
the industry can only be helped.
------------------------------
Date: Thu, 27 Mar 1997 21:30:00 -0700
From: bruce langlois <langlois@csn.net>
Subject: use and if test
Message-Id: <333B4948.EBF4A51@csn.net>
I can't seem to figure out why this construct won't work:
use English;
use strict if $PERL_VERSION >= 5.003;
All I get is a syntax error. If I put it in a block:
if( $PERL_VERSION >= 5.003 ){use strict;}
It works O.K.
Just wondering...
--
Everything goes better with a delayed blast fireball =8)
lothar@acsp.com
langlois@csn.net
------------------------------
Date: Thu, 27 Mar 1997 21:15:12 +0000
From: Colin Fine <colin@kindness.demon.co.uk>
Subject: Re: What's wrong with "an email"
Message-Id: <Aq+nYkAgNuOzEwHP@kindness.demon.co.uk>
In article <5gn20p$r5r@janus.la.platsol.com>, "Bruce M. Binder"
<bruceb@janus.la.platsol.com> writes
[snip]
>
>I disagree. Certainly the language changes. But many changes
>started out as an error that came to be accepted. Far more
>errors are not accepted and never cause a change in the
>language. I think were still at the stage where this is not
>"just a different way to use the term". It's an error. Why
>should this particular error be accepted merely because lazy
>users hide behind the "evolution of the language" argument?
I am a careful and often pedantic writer and (usually) speaker. Except
on a.u.e. I rarely seek to 'correct' another's English. I do however get
hot under the collar when others seek to impose their prejudices on me,
and castigate as wrong my careful usage.
I am not a lazy user: I merely happen to find 'an e-mail' to be a
convenient, clear, and natural expression in my English. I have no
objection to your avoiding the expression Bruce; but kindly refrain from
accusing me of either laziness or error.
--
-----------------------------------------------------------------------
| Colin Fine 66 High Ash, Shipley, W Yorks. BD18 1NE, UK |
| Tel: 01274 592696/0976 436109 e-mail: colin@kindness.demon.co.uk |
| "Creative people love acknowledgement. |
| But they seldom manage to accept it." -K.B.Brown |
-----------------------------------------------------------------------
------------------------------
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 194
*************************************