Ok I have solved part of the problem enough for me to write the program I wanted anway
so here is the solution first
if (int($var)==$var) {
print "$var is an integer.\n";
Ok and this the program I wanted it for
# A quick program in perl to find a numbers divisors
# Author zerodata
$a="1"; #Starting divisor
$b="133745531"; # Number to find divisors of
$c="1"; # Initialiased output variable
do
{
$c=$b/$a;
if (int($c)==$c) # Check if number is an integer
{
print "$b divided by $a equals $c\n"; # print result
$a=$a+1; #continue to check for more divisors
}
else {
$a=$a+1; #if not found continue checking
}
}
while($c>0); #stop when result is not greater than 0
This program can also be used to check if a number is a prime or not..
Be warned on very large numbers this program will take quite a while to run the full sequence the example is very quick but try it with a number like 57683921072 and go make a three course meal while waiting for the full output LMAO.
Not very useful but it solved a problem for me and I had some fun finding out how to do it.
There is a more complicated way that you can find out all data types but I have not figured it all out yet when I do I will post it on this topic in case it is useful for someone