Ajey Kulkarni wrote: > > How can i rename a file and check the size of file using perl? > Also is there a way to call unix commands/system calls from perl?(Say i > want to fstat() on a file and grab the stat struct results). Is there any > way??
You can grab the size of a file using the -s operator on either a filename or an open filehandle. Check out: perldoc -f -s You can rename using the built-in 'rename' function on a filename. Check out perldoc -f rename You can execute shell commands using either the built-in 'system' call or the qx// operator. Check out: perldoc -f system or perldoc perlop and search for 'qx'. However I would /very strongly/ discourage you from shelling out of Perl unless there's something you can really cannot simply do otherwise. HTH, Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>