in reply to Question using system.


one simple solution can be as below...
my $output = undef; $output = qx(getfilesdata file.txt); # which is same as using back ticks $output = `getfilesdata file.txt`;

you will get output in variable, but remember you cannot check return code

Replies are listed 'Best First'.
Re^2: Question using system.
by toolic (Bishop) on Jul 10, 2008 at 16:08 UTC
    but remember you cannot check return code
    From perlvar, $?:
    The status returned by the last pipe close, backtick (`` ) command, successful call to wait() or waitpid(), or from the system() operator.
    use strict; use warnings; my $out; $out = `ls /tmp`; print "tmp status: $?\n"; $out = `ls /foo`; print "foo status: $?\n"; __END__ tmp status: 0 ls: /foo: No such file or directory foo status: 256