#!/usr/bin/perl use strict; use warnings; chomp(my $is = shift); for (1 .. $is) { print "$_ " if ($is % $_ == 0); } print "\n";