I am trying to find the size of a file using the -s
operator. It looks like this:
my $filesz = -s $filename
I tried lots of various way, but it can not get this size.
However, if I give static content instead of filename, it works fine
For example:
$filesz = -s "/tmp/abc.txt"
This works fine.
I tried adding "
in the filename, it didn't work. I removed \n
from filename using chomp
, but the problem remains the same. What's wrong here?
-s $filename if -e $filename
– Esculent$filename
to see if it's what you think it is? – Claman