CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2006
    Posts
    50

    [RESOLVED] Perl: system call not work

    I have a script to call the other script.

    hello.pl
    Code:
    #!/usr/local/bin/perl
    
    print("Hello " . $ARGV[0] . "\n\n");

    test_hello.pl
    Code:
    #!/usr/local/bin/perl
    
    $script='hello.pl';
    system("$script Dave");
    How can I make this possible to work for both in UNIX & Windows?

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    Re: Perl: system call not work

    Quote Originally Posted by vietboy505
    How can I make this possible to work for both in UNIX & Windows?
    Are you getting an error from one OS?
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  3. #3

    Re: Perl: system call not work

    The problem is it can't find the hello.pl script. Your current code will work on windows. To make it work on Linux - etc, change it to

    Code:
    $script = './hello.pl';

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured