Results 1 to 2 of 2

Thread: system in Perl

  1. #1
    Join Date
    Mar 2003
    Posts
    5

    Unanswered: system in Perl

    Hi,

    I would like to assign the value of "system" command in Perl to some
    variable. For example:

    system("find . -name "test.c");
    I would like to get this path in some my_location variable.

    As I know system is returning not the actual value but the status
    of the command itself....

    Please advise.

    Thanks.

  2. #2
    Join Date
    Oct 2003
    Posts
    18
    Backticks?

    @files = `find ./ -name "*test"`;

    Remember, @files will contain the newline characters that "find" prints. Use chomp to strip them off.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •