![]() |
|
Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Yet Another List to Range function.by shotgunefx (Parson) |
on Jun 19, 2002 at 03:33 UTC ( [id://175558]=CUFP: print w/replies, xml ) | Need Help?? |
Yet Another List to Range function. The two I'm aware of on the site didn't work for me. one doesn't handle numbers that begin with zero and the other seems to have a bug. Takes an array and in list context returns an array. In scalar it returns a string.
Ranges are separated by \s-\s so that you can easily split them without worrying about confusing them with negative numbers.
Handles numbers that begin with 0 as well. If not ints, makes a weak effort to handle fractions intervals. If your numbers are fractional and normalized, it should work ie ( 0.5 0.6 0.7) (0.1 0.2 0.3) # Will work (0.1 00.20 0.3) # Won't work update Changed description
Back to
Cool Uses for Perl
|
|