Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Working out frequency statistics with perl

by pc88mxer (Vicar)
on Jul 15, 2008 at 14:24 UTC ( [id://697724]=note: print w/replies, xml ) Need Help??


in reply to Working out frequency statistics with perl

In this code, I would not blindly assume the last character is a period:
chop $fields[9]; # Remove the period after the last digit
It's better to use a regex to remove it:
$fields[9] =~ s{\.$}{}; # Remove any trailing period
Then again, this shouldn't be necessary since you are using $fields[9] as a number. For instance, the strings "3.14" and "3.14." will evaluate to the same number.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2024-04-19 20:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found