[8969] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 2587 Volume: 8

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 13 18:40:27 1998

Date: Wed, 13 May 98 15:00:25 -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, 13 May 1998     Volume: 8 Number: 2587

Today's topics:
    Re: `back ticks` ? <rootbeer@teleport.com>
    Re: Code fragment not working (Help!?!) (Craig Berry)
        DBI::Oracle- Returns wrong number of Rows naren.dasu@divatv.com
    Re: DBI::Oracle- Returns wrong number of Rows (John D Groenveld)
    Re: DBI::Oracle- Returns wrong number of Rows (brian d foy)
    Re: Does Perl have a IDE?I don't like command line. (Greg Bacon)
    Re: Does Perl have a IDE?I don't like command line. <rra@stanford.edu>
    Re: Does Perl have a IDE?I don't like command line. <rra@stanford.edu>
    Re: Does Perl have a IDE?I don't like command line. (Greg Bacon)
    Re: Does Perl have a IDE?I don't like command line. (Tad McClellan)
    Re: Does Perl have a IDE?I don't like command line. <igor.k@usa.net>
    Re: Does Perl have a IDE?I don't like command line. (Michael J Gebis)
    Re: Does Perl have a IDE?I don't like command line. (Michael J Gebis)
    Re: Is if ($a="something") a bad style? (Bart Lateur)
    Re: Perl for Non-programmers (Tad McClellan)
        Please help w/ form mailing <skydive@megsinet.net>
    Re: Question on a variation of a counter cgi script <rootbeer@teleport.com>
        Reg Expr convert one string to another (Chilton)
    Re: Reg Expr convert one string to another (Craig Berry)
    Re: Significant digit? (John Stanley)
    Re: Significant digit? <xuming@xxx.email.unc.edu>
    Re: Significant digit? (Craig Berry)
        Trouble w/CPAN.pm and MD5 - catch22 errors! <jvm@ciena.com>
        Digest Administrivia (Last modified: 8 Mar 97) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Wed, 13 May 1998 21:12:52 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: */chebs <chebs@elfin.org>
Subject: Re: `back ticks` ?
Message-Id: <Pine.GSO.3.96.980513141235.21974w-100000@user2.teleport.com>

On Wed, 13 May 1998, */chebs wrote:

> Is there a way to make the script run the process as my "login"

Yes; see the perlsec manpage. Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



------------------------------

Date: 13 May 1998 20:52:37 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Code fragment not working (Help!?!)
Message-Id: <6jd16l$5g6$3@marina.cinenet.net>

Paul Hounshell (phounsh@ucdavis.edu) wrote:
: OK, I really do not get this.  My If statement does not seem to be
: working.  Line numbers are for reference and the Font used was MS Sans
: Serif (8Pt) in case it doesn't display right.

Any fixed-width font is appropriate for code postings, and it looks like 
you picked one such.

: Script Fragment
: -------------------------
: 
: 1	open(CREDIT_LIST_IN, "Credits.dat");

Always always always ALWAYS check the results of open.  Open can fail in 
an amazing variety of ways.  Checking it will save you many hours of 3am 
hair-tearing.  Trust me on this, I learned the hard way.

Now, in the next part, it looks like what you're really trying to do 
would be better addressed by pulling in lines (or the entire file) and 
doing regex matching to find the sequences you care about.  But, in the 
version you wrote, the problem lines look like

: 		while ($NextChar != ">")
or
: 		if ($NextChar == "G")

(there are many other similar cases.)  != and == are *numeric* comparison 
operators; they'll return nonsensical values when applied to strings.  
You want eq and ne, the string comparison operators.  See perlop or any 
good Perl book for details.

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


------------------------------

Date: Wed, 13 May 1998 20:54:01 GMT
From: naren.dasu@divatv.com
Subject: DBI::Oracle- Returns wrong number of Rows
Message-Id: <6jd199$9kc$1@nnrp1.dejanews.com>

Hi,
       The DBI seems to be returning the wrong value for $DBI::rows

$dbh = $DBI->connect('database', 'user', 'passwd');
my $cur = $dbh->prepare(q{
                             SELECT  EMP_NAME, EMP_NUMBER
                             FROM     EMPLOYEE ;
});

$cur->execute($str);

$num_rows = $DBI::rows ;

If there are 50 records in the Employee table the $num_rows is set to 50
which is right ( great !!)

BUT  if there are more than a 100 records the $num_rows is set to 93.

Is this a DBI bug ? Any help/info would be great.

Thanks in advance

naren















-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading


------------------------------

Date: 13 May 1998 17:17:14 -0400
From: groenvel@cse.psu.edu (John D Groenveld)
Subject: Re: DBI::Oracle- Returns wrong number of Rows
Message-Id: <6jd2kq$rpj$1@tholian.cse.psu.edu>

perldoc DBI seems to indicate that $sth->rows is not to be trusted
for select statements. Count your rows with a counter.
John
groenveld@acm.org


------------------------------

Date: Wed, 13 May 1998 17:36:51 -0400
From: comdog@computerdog.com (brian d foy)
Subject: Re: DBI::Oracle- Returns wrong number of Rows
Message-Id: <comdog-ya02408000R1305981736510001@news.panix.com>
Keywords: from just another new york perl hacker

In article <6jd199$9kc$1@nnrp1.dejanews.com>, naren.dasu@divatv.com posted:

>       The DBI seems to be returning the wrong value for $DBI::rows

>my $cur = $dbh->prepare(q{
>                             SELECT  EMP_NAME, EMP_NUMBER
>                             FROM     EMPLOYEE ;

>If there are 50 records in the Employee table the $num_rows is set to 50
>which is right ( great !!)
>
>BUT  if there are more than a 100 records the $num_rows is set to 93.

from the DBI docs (perldoc DBI):

     rows

           $rv = $sth->rows;

         Returns the number of rows affected by the last database
         altering command, or -1 if not known or not available.
         Generally you can only rely on a row count after a do or
         non-select execute (for some specific operations like
         update and delete) or after fetching all the rows of a
         select statement.

         For select statements it is generally not possible to
         know how many rows will be returned except by fetching
         them all.  Some drivers will return the number of rows
         the application has fetched so far but others may return
         -1 until all rows have been fetched.

if you see the same problem after a non-select statement, then 
something may be wrong.

-- 
brian d foy                                  <comdog@computerdog.com>
CGI Meta FAQ <URL:http://computerdog.com/CGI_MetaFAQ.html>
Comprehensive Perl Archive Network (CPAN) <URL:http://www.perl.com>
Perl Mongers <URL:http://www.pm.org>


------------------------------

Date: 13 May 1998 20:59:49 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jd1k5$go7$3@info.uah.edu>

In article <6jctr4$r7i@mozo.cc.purdue.edu>,
	gebis@albrecht.ecn.purdue.edu (Michael J Gebis) writes:
: It's time to stop trying
: to fight a battle you lost a long time ago.  Instead, it's time to do
: whatever is necessary to spoon-feed the documentation to them so they stop
: wasting time and bandwidth."

I'm surprised you don't munge your posts' From: header too.  I don't
generally take such defeatist attitudes.  If someone were to come along
and piss in my sandbox, I wouldn't encourage them (whether or not they
were into alt.sex.watersports).  I'd probably ask them to stop or find a
new sandbox, perhaps both.  Perhaps comp.lang.perl.moderated's
description should be ``The new sandbox''.

: gbacon@cs.uah.edu (Greg Bacon) writes:
: }I'll say it again: there's nothing in the world stopping the subunix
: }users from writing their own IDE complete with a really spiffy help
: }system and floating yellow boxes and colored syntax and whatever other
: }bloat they want to throw in.  If having such software is so vital and
: }necessary, please go implement it; the world will thank you.
: 
: I think this means you've decided that perhaps IDEs might have value
: and the mere existence of one might not be such a categorically bad
: thing.  To be overly clear about things, I never demanded or even
: asked that you or anybody ever write an IDE; I just thought that the
: concept was dismissed too quickly for an idea that has some merit.

You're putting words in my mouth.  IDEs are crutches.  IDEs are evil
implements for locking users into a specific software line from a
specific vendor.  I don't usually find software that impedes my freedom
useful.

I wonder whether Ken or Larry or Rob or dmr or bwk use IDEs.  I would be
shocked to learn that they do.

: Apparently, you now agree with me.  

I certainly don't.  However, who am I to tell anyone how they should
invest their time and talents?

Greg
-- 
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF


------------------------------

Date: 13 May 1998 13:54:37 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <m33eedq4c2.fsf@windlord.Stanford.EDU>

Greg Bacon <gbacon@cs.uah.edu> writes:

> There's no rule that says you can't teach your students to increment the
> value bound to a variable with code like

>     i = i + 1;

> Certain subsets of C or Perl would make nice teaching languages IMHO.

This is true; there are a few problems with this approach, though.  First
of all, you're not really teaching them C, you're teaching them a subset
of C.  That's fine so long as they're aware of that, but it's been my
experience that students will come out of that class and then claim they
know C, which is just a recipe for disaster down the road.  Using a
different language keeps the division much clearer.

It's worth keeping in mind that students often want to learn a language
they can use in the real world *right now*.  I think it's worthwhile doing
everything one can to *discourage* that mindset, since it leads to people
who don't know how to program programming.  It needs to be clear that
there's a *learning process* that has to happen first.

The second problem, particularly with Perl, is that things that you'd
rather be syntax errors so that the students don't try to do things that
way will be accepted by the language because the language is going to
assume that you know what you're doing.

As a programmer, that's what I want.  Because I *do* know what I'm doing.
As a student, that's *not* what I want, because I *don't* know what I'm
doing.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


------------------------------

Date: 13 May 1998 14:01:51 -0700
From: Russ Allbery <rra@stanford.edu>
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <m3zpglopfk.fsf@windlord.Stanford.EDU>

Greg Bacon <gbacon@cs.uah.edu> writes:

> You're putting words in my mouth.  IDEs are crutches.  IDEs are evil
> implements for locking users into a specific software line from a
> specific vendor.  I don't usually find software that impedes my freedom
> useful.

Huh?

emacs is a perfectly functional IDE for Perl.  It doesn't seem to have
impeded my freedom any.  It can't correctly autoformat or do syntax
highlighting for Randal's JAPHs, but it works great for the code I
actually write.  It has an interface to the Perl debugger, not that I ever
*use* the Perl debugger (throwing a bunch of prints into the script is
invariably faster for me).  It has a built-in interface to the version
control system that I use.

Not sure what you have against that.

-- 
#!/usr/bin/perl -- Russ Allbery, Just Another Perl Hacker
$^=q;@!>~|{>krw>yn{u<$$<[~||<Juukn{=,<S~|}<Jwx}qn{<Yn{u<Qjltn{ > 0gFzD gD,
 00Fz, 0,,( 0hF 0g)F/=, 0> "L$/GEIFewe{,$/ 0C$~> "@=,m,|,(e 0.), 01,pnn,y{
rw} >;,$0=q,$,,($_=$^)=~y,$/ C-~><@=\n\r,-~$:-u/ #y,d,s,(\$.),$1,gee,print


------------------------------

Date: 13 May 1998 21:16:26 GMT
From: gbacon@cs.uah.edu (Greg Bacon)
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jd2ja$go7$4@info.uah.edu>

In article <g4syuqb73.fsf@scrye.com>,
	Tkil <tkil@scrye.com> writes:
: [pause for tom to comment: "if they're not, your installation is
: broken and i don't care about you"]

You're misrepresenting Tom.  If you've read p5p for any amount of time,
you've seen Tom complaining loudly about the fact that Perl docs want to
go in nonstandard places.  I believe Linux's man includes
/usr/lib/perl5/man in its default MANPATH.

: ahem.  depending on the system and the administration policies, they
: could also be in:
: 
:   /usr/local/man
:   /usr/share/man
:   /usr/openwin/man
:   /usr/local/X11/man

Do not cause the teeth of Perl to be set on edge for the sins of your
sysadmin.  If a sysadmin installs manpages somewhere outside MANPATH,
it's his responsibility to change /etc/tcshrc and /etc/profile
appropriately.  You can usually obtain a reasonable guess with

    % perl -V:installman3dir

: and i don't remember where i found them on IRIX; it was quite a chore.

IRIX is a special kind of suck.  It ships without document formatting
tools (troff, nroff, eqn, etc.).  Configure detects the absence of these
tools and doesn't run pod2man.  I believe you can always find the pod in
$installprivlib/pod or under $installsitelib (obtain these values in the
same fashion as installman3dir).

Greg
-- 
open(G,"|gzip -dc");$_=<<EOF;s/[0-9a-f]+/print G pack("h*",$&)/eg
f1b88000b620f22320303fa2d2e21584ccbcf29c84d2258084
d2ac158c84c4ece4d22d1000118a8d5491000000
EOF


------------------------------

Date: Wed, 13 May 1998 16:09:27 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <762dj6.bt6.ln@localhost>

Greg Bacon (gbacon@cs.uah.edu) wrote:
: In article <3558eb24.38542625@news.nask.org.pl>,
: 	cicho@polbox.com (Marek Jedlinski) writes:
: : I'm not sure what you call "standard", and I'll happily allow that the
: : ActiveState win95 port is not, but it so happens that the ActiveState
: : distribution does *not* include perldoc.

: Then the ActiveState ``ports'' are both nonstandard and broken.  If
: you're so cursed as to be forced to use a win32 platform, I highly
: recommend Sarathy's binary distribution (if you can't build the standard
: distribution yourself).

: : Now,
: : seeing as most of the reviled, recurrent FAQs come from win95 users...
: : ahem.

: Perhaps we the readers of clpmisc should send a big whopping bill to
: ActiveState.


Send all Win32 Perl questions (unless you are using a real perl) to:

   root@activestate.com



They'll be glad to hear from you... 

 ... and we'll be glad to not read the docs to you.



Free consulting help *is* possible.

All you have to do is ask. (if you don't get the answer in two days, be
sure to resend the question every other day until they answer it)


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


------------------------------

Date: Wed, 13 May 1998 14:40:04 -0700
From: "Igor Krivokon" <igor.k@usa.net>
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jd3pb$4tl$1@news.ncal.verio.com>

Greg Bacon wrote in message <6jd1k5$go7$3@info.uah.edu>...
>You're putting words in my mouth.  IDEs are crutches.  IDEs are evil
>implements for locking users into a specific software line from a
>specific vendor.  I don't usually find software that impedes my freedom
>useful.


Unix is IDE. 
If you feel that any other IDE impedes your freedom, don't use it.
But it's just *your* personal preference to this particular kind of IDE.

I still remember those "Who needs a GUI when you have a coding sheet, 
a pencil, an eraser, and an hourly key punch operator at your disposal?" ;-)

Igor Krivokon
<igor.k@usa.net>





------------------------------

Date: 13 May 1998 21:35:06 GMT
From: gebis@albrecht.ecn.purdue.edu (Michael J Gebis)
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jd3ma$5d@mozo.cc.purdue.edu>

Tom Christiansen <tchrist@mox.perl.com> writes:

} [courtesy cc of this posting sent to cited author via email]
}In comp.lang.perl.misc, 
}    gebis@albrecht.ecn.purdue.edu (Michael J Gebis) writes:
}:It's time to stop trying
}:to fight a battle you lost a long time ago.  

}Back to the old sit back and accept your violation notion again.
}Don't be silly.  We don't have to enjoy being screwed.

Greg claimed that the very fact that Windows users know about Perl
dumbs-down perl.  I said "They already know about it."

I guess you're proposing to somehow go back in time and revoke the
fact that Windows folks use perl.

(Actually, I really think that you
just enjoy using the "violation notion" argument, and tried to
wedge it into an situation where it didn't really apply.  I'm not
saying "enjoy getting screwed," I'm saying "We are getting screwed.
Don't you want to try to avoid future screwing by any reasonable
method?"  I gleefully await the appearance of the "have you stopped
beating your wife, Mike" argument.)

}:Instead, it's time to do
}:whatever is necessary to spoon-feed the documentation to them so they stop
}:wasting time and bandwidth."

}Nope.   Send the babies to playschool.

Hm, so how's that "curse the darkness" project coming along anyway?

-- 
Mike Gebis  gebis@ecn.purdue.edu  mgebis@eternal.net


------------------------------

Date: 13 May 1998 21:42:12 GMT
From: gebis@albrecht.ecn.purdue.edu (Michael J Gebis)
Subject: Re: Does Perl have a IDE?I don't like command line.
Message-Id: <6jd43k$d3@mozo.cc.purdue.edu>

jdporter@min.net (John Porter) writes:

}On 13 May 1998 19:55:16 GMT,
}in article <6jctr4$r7i@mozo.cc.purdue.edu>,
}gebis@albrecht.ecn.purdue.edu (Michael J Gebis) wrote:
}> ... Instead, it's time to do
}> whatever is necessary to spoon-feed the documentation to them so they stop
}> wasting time and bandwidth."

}Does not compute.
}Spoon-feeding the documentation IS a waste of time and bandwidth.
}By doing it, we're complicit in the misuse of the ng bw, rather
}than resistant to it, as we ought to be.

Aieeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee!

I want to provide the excellent documentation in a way that Win users
would be more likely to use, so that they find it without effort, and
don't even bother to use the newsgroup.  (Actually, I REALLY just wish
that the gurus on this group wouldn't pish-posh such an idea offhand.)

-- 
Mike Gebis  gebis@ecn.purdue.edu  mgebis@eternal.net


------------------------------

Date: Wed, 13 May 1998 22:01:56 GMT
From: bart.mediamind@tornado.be (Bart Lateur)
Subject: Re: Is if ($a="something") a bad style?
Message-Id: <355c1019.3886547@news.tornado.be>

John Moreno wrote:

>That's why I want to know if this is thought of as
>> neat in Perl too.
>
>I understood what you meant - but that's NOT neat in C and it's not neat
>in Perl.  It works (in both) and can occasionally be useful, but
>generally it's just a opportunity for a mistake to happen.
>
>So to answer the subject - yes it's a bod style.

<Huge big grin>. Do you realize that THE Perl idiom is actually a
variation to this theme?

Yes, I'm talking about:

	while(<>){
		...
	}

and friends. Which is an assignment plus a test in one.

	Bart.


------------------------------

Date: Wed, 13 May 1998 16:20:49 -0500
From: tadmc@flash.net (Tad McClellan)
Subject: Re: Perl for Non-programmers
Message-Id: <hr2dj6.bt6.ln@localhost>

Russ Allbery (rra@stanford.edu) wrote:

: Am I the only person who thinks that strong typing is a useful language
: feature for a new programmer?  


No.

But it may be that there are only two of us  ;-)


--
    Tad McClellan                          SGML Consulting
    tadmc@metronet.com                     Perl programming
    Fort Worth, Texas


------------------------------

Date: Wed, 13 May 1998 16:49:20 -0500
From: Jennifer Verk <skydive@megsinet.net>
Subject: Please help w/ form mailing
Message-Id: <355A155F.A6B3AFCA@megsinet.net>

Hi there.  I'm really new to perl.  Through examples and reading I've
come up with a custom script to take the contents of a form and appends
it to a log file.  Now, I need to know how to add to this to have the
logfile emailed.

I think I know how to do it for a Unix machine....but I'm using WinNT
IIS.  Someone please help me.  If it makes a difference, we are also
using FastTrack and LiveWire (which I don't know much about...yet  :o)

Thanks.

=============================
Jennifer
skydive@megsinet.net
=============================



------------------------------

Date: Wed, 13 May 1998 21:17:31 GMT
From: Tom Phoenix <rootbeer@teleport.com>
To: Gary Nielson <gnielson@charlotte.infi.net>
Subject: Re: Question on a variation of a counter cgi script
Message-Id: <Pine.GSO.3.96.980513141455.21974x-100000@user2.teleport.com>

On Wed, 13 May 1998, Gary Nielson wrote:

> This would be made simpler if we were allowed cron jobs, but we aren't
> on our server.

Any workaround which simulates cron will cause the server to do at least
as much work as cron, and probably more. And, for that matter, if you're
not allowed to use cron, why should you be allowed to run something that's
doing cron's job? :-)  Convince that sysadmin to let you use real tools
like cron. Hope this helps!

-- 
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



------------------------------

Date: Wed, 13 May 1998 15:01:19 -0600
From: chilton@trag.com (Chilton)
Subject: Reg Expr convert one string to another
Message-Id: <chilton-1305981501190001@121-cdm-165.tca.net>

This is an easy one.

I want to convert the following string:
$string1 = "051098.txt";

into:
5/10/98

and ultimately into:
5/10

I could use a bunch of loops in perl, but I know there's a regular
expression to do this simple thing.

Thank you,

Chilton Webb
www.ISP-Resource.com


------------------------------

Date: 13 May 1998 21:44:31 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Reg Expr convert one string to another
Message-Id: <6jd47v$5g6$5@marina.cinenet.net>

Chilton (chilton@trag.com) wrote:
: I want to convert the following string:
: $string1 = "051098.txt";
: 
: into:
: 5/10/98
: 
: and ultimately into:
: 5/10

  my ($month, $day, $year) = $string =~ /^(\d\d)(\d\d)(\d\d)/;
  my $format_one = sprintf "%d/%d/%d", $month, $day, $year;
  my $format_two = sprintf "%d/%d", $month, $day;

Do watch your y2k issues with that two-digit year, though.

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


------------------------------

Date: 13 May 1998 21:14:41 GMT
From: stanley@skyking.OCE.ORST.EDU (John Stanley)
Subject: Re: Significant digit?
Message-Id: <6jd2g1$qij$1@news.NERO.NET>

In article <6jct8o$5g6$2@marina.cinenet.net>,
Craig Berry <cberry@cinenet.net> wrote:
>This may be a cultural issue; I come from a science background, but I
>wouldn't be *certain* that 1200. had four sig figs, despite the use of an
>explicit decimal.  I'd guess that was the case, but this convention was
>never made 'official' during my education.  

It was quite official during mine. It would cost points on assignments
if the wrong number of significant digits were reported in an answer.
As a TA, it also made easy picking out the people who knew how to push
the buttons on a calculator, versus those who understood the problem.

>I was always taught that to
>express an explicit precision, one should use exponential notation, or an
>explicit error estimate (1200 +- 50), or preferably (for formal work)
>both. 

Exponential notation is a way of expressing accuracy only. If you want
to express precision, you must include the error as well as the value
itself -- e.g. 1200 +/- 50.



------------------------------

Date: Wed, 13 May 1998 15:47:27 -0400
From: xuming wang <xuming@xxx.email.unc.edu>
Subject: Re: Significant digit?
Message-Id: <3559F8CF.DA80A286@xxx.email.unc.edu>

John Stanley wrote:
> 
> In article <3559B89A.7643D4E8@xxx.email.unc.edu>,
> xuming wang  <xuming@xxx.email.unc.edu> wrote:

> >and AFAIK, 1200 has 4
> >significant digits.  we have to write it in scientific notation if there's only
> >2 significant digits: 1.2e3.
> 
> I am an analytical chemist, the kind that deals with analyzing stuff and
> doing quantitative analysis. You are wrong. 1200 has two significant
> digits.

thank you for correcting me!
 
> >I think the subroutine I posted to cpl.module is pretty simple and works, but I
> >am new to perl so probably there is something I missed.
> 
> Yes, your code returns the wrong answer for 1.2345 to 4 significant
> digits. Your code returns 1.234, the right answer is 1.235  It DOES,
> however, return the right awswer for 1.000 to three.

yes, I mentioned this when I first posted it to cpl.modules.  it makes pretty
complicated if you have to deal with this.  I also wrote a subroutine which uses
string manipulation but it's more than 10 lines long.

> >but I really don't know how should I deal with something like 0.00, how many
> >siginificant digits it has?
> 
> As written, two. You have measured whatever it is you have and found
> that it is zero down to two decimal places.
> 
> >this sub always returns number in scientific notation and it will round.
> 
> Apparently it does not.

right, it also returns 0 for 0.00.

-- 
Xuming Wang
To reply via email, remove xxx from address.


------------------------------

Date: 13 May 1998 21:33:53 GMT
From: cberry@cinenet.net (Craig Berry)
Subject: Re: Significant digit?
Message-Id: <6jd3k1$5g6$4@marina.cinenet.net>

John Stanley (stanley@skyking.OCE.ORST.EDU) wrote:
: In article <6jct8o$5g6$2@marina.cinenet.net>,
: Craig Berry <cberry@cinenet.net> wrote:
: >This may be a cultural issue; I come from a science background, but I
: >wouldn't be *certain* that 1200. had four sig figs, despite the use of an
: >explicit decimal.  I'd guess that was the case, but this convention was
: >never made 'official' during my education.  
: 
: It was quite official during mine. It would cost points on assignments
: if the wrong number of significant digits were reported in an answer.
: As a TA, it also made easy picking out the people who knew how to push
: the buttons on a calculator, versus those who understood the problem.

Oh, you misunderstand; getting sig-figs right was *very very* official, 
and (as in your case) an important part of grading.  I'm just saying 
that I'd not have written '1200.' for a four-sig-fig answer, but rather 
'1.2e3'.

: >I was always taught that to
: >express an explicit precision, one should use exponential notation, or an
: >explicit error estimate (1200 +- 50), or preferably (for formal work)
: >both. 
: 
: Exponential notation is a way of expressing accuracy only. If you want
: to express precision, you must include the error as well as the value
: itself -- e.g. 1200 +/- 50.

Not true.  Accuracy is a measure of how well your value matches 'reality'. 
3.222222e0 is a very precise but rather inaccurate value for pi, for
example. :)

---------------------------------------------------------------------
   |   Craig Berry - cberry@cinenet.net
 --*--    Home Page: http://www.cinenet.net/users/cberry/home.html
   |      Member of The HTML Writers Guild: http://www.hwg.org/   
       "Every man and every woman is a star."


------------------------------

Date: Wed, 13 May 1998 16:44:41 +0000
From: "John V. Martinez" <jvm@ciena.com>
Subject: Trouble w/CPAN.pm and MD5 - catch22 errors!
Message-Id: <3559CDF9.57FB8492@ciena.com>

Hello,

[Sorry about the goofy line-wraps - this newsreader/UI stinks :^( ]

[Reader's Digest version: I installed MD5, it passed all the tests ok,
but some other modules (most recently, Bundle::Tk -> 
GBARR/Mailtools-1.11.tar.gz) do not 'make' properly when I try to
install them from the shell. They complain about being unable to find
'auto/MD5/new.al' anywhere in @INC; I can't find the file anywhere,
although @INC looks right. So why did MD5 self-tests pass? What's
missing?]


I am a casual PERL user, and most of my PERL use is simple
text-processing that requires no special modules support. I have even
written a few CGI back-ends "the hard way," without the benefit of any
of the nifty modules publicly available. A week ago, I set myself to a
larger PERL task than I had attempted before, and so I decided to branch
out and see what tools I could find to make my job easier.

I have only recently (2 days ago?) discovered that CPAN exists, and I
was pretty excited to find it had a number of tools I could use. I
downloaded the CPAN.pm module and started using the CPAN shell to
acquire some of the other modules I wanted to use. The first module I
downloaded and installed seemd to go ok, but I got a warning, something
to the effect of "MD5 is not installed, so checksums will not be
verified." 

Ok, I thought - let me go find this MD5 module and install it. The
download and build seemed to go OK, and all 14 tests passed. Cool. Then
I went on to install the Bundle::libnet package, so that cpan.pm would
quit complaining about having to use raw ftp commands to grab files. I 
quit out of the the shell and re-entered (habit from years of using 
Windows which won't install anything properly until you reboot, I guess
:^) and then typed 'install Bundle::libnet'. This is when I hit the
first wierdness: 

-- I got the same CPAN warning that MD5 was not installed. (Even though
i had *just* installed it!) In spite of this, libnet downloaded, built,
and tested properly.

This was annoying, but since MD5 was not *needed* to achieve my goal, I
put it on the back burner and went on to 'install Bundle::Tk': this
worked partway, but then failed when building Mailtool something or
another (see up top) with the error that it couldn't find
'auto/MD5/new.al'. 

At this point, I'm a bit out of my depth: what, exactly does the
MD5/new.al file do? (I know what it *sounds* like it does, but then
why would all the MD5 modules tests succeed?) Furthermore, if I try to
'install MD5' again, it tells me that MD5 is up to date, but when I try
to install andything else, I am warned that MD5 is not installed, so no
MD5 security checks will be used!

Can anyone help me troubleshoot this? It's extremely frustrating, but it
seems like it's probably just an issue of one file mislabeled or
misconfigured somewhere.

Thanks,

-(-- John
jvm@ciena.com


------------------------------

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 2587
**************************************

home help back first fref pref prev next nref lref last post