How to find size of a file in perl?

Hai guys,

I am kiran. I created GUI by using Gtk2-Perl. In that GUI I was running 3 shell scripts by using system command and also passing arguments to the shell scripts from GUI script.

In that arguments I can get the path like /home/kiran/pdk/sample/calibre (this is the output of shell script1) but in calibre folder have the files like .results and .summary.

I have the path upto calibre only but after exection inside this calibre getting path like calibre/memory/metal/cell/cell.results and cell.summary

Here what my doubt is how to read remaining path after calibre. Because I have to find size of a files like .results and .summary
Then only I can get script has been completed r not.
after that I can do

       If (&filename size > 0) {
                print("script1 is successful";
        else
                print("error");
        }

This should be do in Gtk2-Perl script itself.
So please tel me the way or code

Thanks&Regards
kiran

I am afraid you will not get very mush posts for we know almost nothing...
We dont have the slightest idea of your OS (Yes its important! ) and the shell you use, further more:

We can just believe you, again we dont know these scripts are nor the commands you used...

What generates those files?
They can very well be written first in buffer and saved only at exit...

Without more information it will be very difficult to assist you...

In theory the stat() system call tells about the file size.
The man page

man perlfunc

tells this about stat in perl:

                 ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
                    $atime,$mtime,$ctime,$blksize,$blocks)
                        = stat($filename);