F:\dev>perl fabric.pl How many fabrics are you using? 2 How wide is fabric 1? 1 To be safe, we'll use a width of -1 for fabric 1. How many different shapes of fabric 1 is a block made of? 1 What is the width of shape 1? 1 What is the height of shape 1? 2 Shape dimensions: The dimensions of shape 1 are 1x2 You can get 0 piece(s) of shape 1 per 1" strip of fabric 1. You can get 36 1" strips per yard. You can get 0 of shape 1 per yard of -1" of fabric 1. How many of shape 1 do you need per block? 23 You need 23 per block. How many blocks are you making? 2 You are making 2 blocks. You need 46 of shape 1. Illegal division by zero at fabric.pl line 88, line 7. F:\dev> #### #!/usr/bin/perl -w use strict; # How many fabrics are you using? my $number_of_fabrics; print "How many fabrics are you using? \n"; chomp($number_of_fabrics = ); $number_of_fabrics =~ s/\D//; # only allow number input ## $number_of_fabrics ||= 3; # assume default quietly unless($number_of_fabrics and $number_of_fabrics >=3 ) { warn "Ahem!!! You must enter a NUMBER >= 3, but that's ok, default is 3"; $number_of_fabrics = 3; } #... more to come ... ;D