Quote:
Backticks and system calls are the same thingYou should read more docs.
perlfaq8 - Why can't I get the output of a command with system?
"You're confusing the purpose of system() and backticks (``). system() runs a command and returns exit status information (as a 16 bit value: the low 7 bits are the signal the process died from, if any, and the high 8 bits are the actual exit value). Backticks (``) run a command and return what it sent to STDOUT."
perlfaq8 - What's wrong with using backticks in a void context?
"Backticks are one; they collect the output from the command for use in your program. The system function is another; it doesn't do this."
perlfaq8 - What's wrong with using backticks in a void context?
"And now they think ``Hey, I'll just always use backticks to run programs.'' Bad idea: backticks are for capturing a program's output; the system function is for running programs."
System compatiblity:
ActivePerl-Winfaq5
"* system() or backtick (``) calls to system tools that aren't available on ActivePerl."
Finally about performance issues, if somebody use mod_perl (!):
Spawning a Detachable Sub-Process
"Just like with fork(), using the system call system() defeats the whole idea behind mod_perl. The Perl interpreter and modules would be loaded again for this external program to run if it's a Perl program. Remember that the backticks (`program`) and qx(program) variants of system() behave in the same way."
Efficiency in Perl
"CGI scripts, such as the ones using system() (which also reduces portability) or `backtick` notation are inefficient by their very nature, and very resource-intensive. There are ways to reduce or eliminate all these overheads, but these tend to be operating system- or server-specific (for which the best support seems to be in Apache)."
P.S.: Sorry, my post seems offtopic, it's not related to "displaying Thumbnail" in any way :(
Best regards,
Webmaster33
Paid Support from Webmaster33. Expert in Perl programming & Gossamer Threads applications. (click here for prices)
Webmaster33's products (upd.2004.09.26) | Private message | Contact me | Was my post helpful? Donate my help...