#copies 1 file to another
use warnings;
use File::Copy;
copy("FILE1.txt","new_file.txt");
This script works if FILE1.txt is in current directory of windows but when
i try to give a full path to a file like : "C:\Folder1\FILE1.txt" it doesnt
work.
This is the same with rename and unlink funct
use warnings;
$dir = "c:/folder/*";my @files = glob( $dir );
foreach (@files ){
print $_ . "\n";}
i am trying to read windows directory using above code but it gives
errors in recognising tthe directory path. please help.
$num = 1234;
$sum = 0;
while ( $num != 0)
{
$rem = $num % 10;
$sum = ( $sum * 10 ) + $rem;
$num = $num / 10;
}
print $sum;
please tell what is wrong with the reverse number code .
It prints Infinity.