#! perl use strict; use warnings; my $zmax = 60; # Maximum depth in your model my $dz = 0.05; # Grid spacing in z-direction print +($_ * $dz), "\n" for (0 .. int(($zmax / 0.05) + 0.5));