in reply to Capturing shell command error

A) eval isn't supposed to capture those sort of errors.
B) if you read the friendly man pages it mentions that backticks sets the $! error variable, so you should be checking that.
C) Why are you bothering to fork a new process and execute du? What's wrong with the built in perl operators for determing file size? Like -s?

Replies are listed 'Best First'.
Re^2: Capturing shell command error
by kulls (Hermit) on Jan 07, 2006 at 11:24 UTC
    i understand what you're saying.
    my $str=-s "upload.log"; print $str;
    How can i calculate the size for multiple files without looping like,
    i have upload1.log, upload2.log, upload3.log.
    how can i get the sizes without looping ?. How can i use upload* pattern in the -s option ?. I tried but it's not return anything.
    Can you please ?
    - kulls
      @size = map { -s $_ } glob("upload*.log");