windows directory path not working in perl

2016-03-02 Thread Arghya Das
#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

reading directories using perl in windows

2016-03-01 Thread Arghya Das
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.

coding help

2016-02-29 Thread Arghya Das
$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.