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. Advertisements

  2. Guest

    um... ok

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

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:
    616
    Chris Tillotson
    Nov 4, 2003
  2. Jay McGavren
    Replies:
    11
    Views:
    1,461
    Alan Krueger
    Jan 16, 2006
  3. Replies:
    0
    Views:
    247
  4. Robert Klemme
    Replies:
    35
    Views:
    564
    Robert Klemme
    Dec 31, 2007
  5. Fredrik

    Array#first is not Array#[0]

    Fredrik, Apr 29, 2008, in forum: Ruby
    Replies:
    18
    Views:
    242
    Albert Schlef
    Apr 30, 2008
  6. Chris R.
    Replies:
    3
    Views:
    318
    Adam Prescott
    Jan 28, 2011
  7. Replies:
    12
    Views:
    315
    Dr.Ruud
    Oct 6, 2005
  8. mike

    only executes in child window

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