array executes only first

Discussion in 'Perl' started by rasdj@frontiernet.net, Mar 4, 2005.

  1. Guest

    touch.txt is:

    touch a
    touch b

    The following code produces the file "a" but not "b".

    #!/usr/bin/perl
    $data_file="touch.txt";
    open(cmd, $data_file) || die("Could not open file!");
    @raw_data=<cmd>;
    close(cmd);
    foreach $line (@raw_data)
    {
    exec $line;
    }

    Thank you,

    RasDJ
     
    , Mar 4, 2005
    #1
    1. Advertising

  2. Guest

    um... ok

    system()
     
    , Mar 4, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris Tillotson
    Replies:
    2
    Views:
    445
    Chris Tillotson
    Nov 4, 2003
  2. Rob Meade
    Replies:
    5
    Views:
    348
    Rob Meade
    Dec 10, 2003
  3. erdem

    page_load executes twice ?

    erdem, Jul 23, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    2,881
    erdem
    Jul 23, 2004
  4. Jay McGavren
    Replies:
    11
    Views:
    1,181
    Alan Krueger
    Jan 16, 2006
  5. mike

    only executes in child window

    mike, Oct 12, 2005, in forum: Javascript
    Replies:
    5
    Views:
    88
Loading...

Share This Page