The reason your code isn't working is that your test has the wrong sense: you are starting at 150 and then looping while the value is less than or equal to 10, which is never
It is also a bad idea to repeatedly add floating point values, as the inaccuracies will mount up and result in an error in the output. In this case you are using 0.25, which just happens to be representable accurately as a binary fraction, but in case you ever want a different increment you should know that it is best to use integers to count and convert them to floating point one by one
Finally, you are asking for no decimal places at all on the integers, but two on the fractional values. This may not be absolutely necessary, but it's best to use an explicit format string to avoid some surprises
Here's how I would write your code
use strict;
use warnings 'all';
my $filename = 'report-4.5-3.txt';
open my $out_fh, '>', $filename
or die qq{Unable to open "$filename" for output: $!};
for ( my $d = 150 * 4; $d >= 10 * 4; --$d ) {
my $fmt = $d % 4 ? '%.2f' : '%.0f';
my $dihed = sprintf $fmt, $d / 4;
print $out_fh "\nYOYO -O -i min_mdin.${dihed} -o min_mdout.${dihed}\n";
}
output
YOYO -O -i min_mdin.150 -o min_mdout.150
YOYO -O -i min_mdin.149.75 -o min_mdout.149.75
YOYO -O -i min_mdin.149.50 -o min_mdout.149.50
YOYO -O -i min_mdin.149.25 -o min_mdout.149.25
YOYO -O -i min_mdin.149 -o min_mdout.149
...
YOYO -O -i min_mdin.11 -o min_mdout.11
YOYO -O -i min_mdin.10.75 -o min_mdout.10.75
YOYO -O -i min_mdin.10.50 -o min_mdout.10.50
YOYO -O -i min_mdin.10.25 -o min_mdout.10.25
YOYO -O -i min_mdin.10 -o min_mdout.10
while ($dihed <= 10.0)is not true with$dihed=150so the loop body is not entered at all.while ($dihed <= 10.0)the loop would never terminate (if it was entered somehow). Did you meanwhile ($dihed >= 10.0)?