my @radsigma; for ( my $i=1; $i<=100; $i+=2 ) { my $sig; if ( $r <2 e-5 ) { $sig = sigmalow($r); }else{ $sig = sigmahigh($r); } push @radsigma, [ $r, $sig ]; } #### use strict; use warnings; use constant PI => 3.1416; #### sub sigmalow { my $rad = shift; # shift it off the front of @_ my $rad = $_[0]; # or explicitly assign the value #### for my $i (1..100){ next unless $r % 2; for (0..49){ my $i = $_ * 2 + 1; for my $i ( grep {$_ %2} (0..99 ) ){