This code is painful, bu let's go line by line:
# Splits the contents of $16 on commas into array @_1
@_1= split "\,",$16;
# If @_1 has only one element force $time to integer
# Does $time already have a value? That's not apparent in
# this snippet.
if($#_1 eq 0){
$time = int ($time);
}
# If @_1 has two elements set $time to the first one
# remove any commas (Although those should have been taken
# care of by the split above)
# And multiply $time by 1000
if($#_1 eq 1){
$time=$_1[0];
$time=~ s/\,//g;
$time*=1000;
}
# If @_1 has 2 or 3 elements simply set $time to 1000
if($#_1 eq 2){ $time=1000;}
if($#_1 eq 3){$time=1000;}
This code seems like it is splitting up a large number with commas in it a la 1,000,000,000 or something. Perhaps Number::Format could be used?
HTH
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.