Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > array executes only first

Reply
Thread Tools

array executes only first

 
 
rasdj@frontiernet.net
Guest
Posts: n/a
 
      03-04-2005
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

 
Reply With Quote
 
 
 
 
rasdj@frontiernet.net
Guest
Posts: n/a
 
      03-04-2005
um... ok

system()

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
if statement that, when false, skips first statement in its block, executes second? Jay McGavren Java 11 01-16-2006 05:49 PM
only executes in child window mike Javascript 5 10-14-2005 01:08 AM
page_load executes twice ? erdem ASP .Net 3 07-23-2004 08:28 PM
Posting onto a form after code executes? Rob Meade ASP .Net 5 12-10-2003 04:24 PM
Displaying Progress info to client while ServerSide code executes. Chris Tillotson ASP .Net 2 11-04-2003 09:03 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57