#!/usr/bin/perl use strict; use warnings; print "Type number you want factorised: \n"; chomp (my $no = ); print "The factors of $no are: \n"; foreach my $int (1 .. $no / 2) { my $div = $no / $int; my $remainder = $no % $int; if ($remainder == 0) { print "$div\n"; } }