Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

A little problem

by yabba (Initiate)
on Apr 08, 2001 at 18:49 UTC ( [id://70837]=perlquestion: print w/replies, xml ) Need Help??

yabba has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
(jptxs) Re: A little problem
by jptxs (Curate) on Apr 08, 2001 at 18:59 UTC
    I voted this down, which I hardly ever do. I did it b/c even after being chided for it so many times on your last post you still used such a generic and meaningless title on this one. titles like this just pollute the waters for people who are searching or trying to find something specific in the monastery. that's why people have asked you use titles closer to the meaning of your question. it's not just some random preference some people have - in case you think you're being persecuted by a silly idea. it's just trying to keep the monastery orderly and clean.

    UPDATE: wow. I only just noticed:

    Please, when naming your nodes, think of the content and title them according to that. like:
    • problem getting 3rd line of file
    • $_ not set correctly in for loop
    • use my or local in sub?
    you get the idea. it will really help out if you do.
    "A man's maturity -- consists in having found again the seriousness one had as a child, at play." --Nietzsche
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: A little problem
by Beatnik (Parson) on Apr 08, 2001 at 19:02 UTC
    $avg /= @data; basically means same as $avg = $avg / @data. You're dividing $avg by the number of elements in @data and storing the result back in $avg. The tricky part is that computers have this nasty habbit of freaking out on divisions by zero (because technically you can't divide by zero).

    A fix would include something like :

    $avg = scalar(@data) ? $avg /= @data : 0;

    Beatnik
    ... Quidquid perl dictum sit, altum viditur.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://70837]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-12-09 04:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which IDE have you been most impressed by?













    Results (53 votes). Check out past polls.