in reply to call another program from perl
Please do us all the courtesy of at least trying to execute your code before you post it, and fixing any errors that may come up.
### No reason to do this, since you could just use the filename in the + "open" call directly. my $executable = "C:/Users/Desktop/file.exe"; ### This won't work - that "-w" is extraneous and a syntax error. Furt +hermore, you have a conceptual problem: ### the way you're doing it here (if it worked) would OVERWRITE your p +rogram instead of ### executing it. open(-w EXECUTABLE,">$executable") or die "Can't open output file $exe +cutable\n"; while(<EXECUTABLE>) { print EXECUTABLE "Something"; } close EXECUTABLE;
Yes, it's possible to do something like what you've described with filehandles (e.g., "Pipe Opens" in perlopentut.) Until you explain what you're trying to do, though, there's not much chance of anyone here being able to help you.
-- Human history becomes more and more a race between education and catastrophe. -- HG Wells
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: call another program from perl
by Fletch (Bishop) on Jul 15, 2008 at 12:46 UTC | |
by oko1 (Deacon) on Jul 18, 2008 at 12:52 UTC | |
|
Re^2: call another program from perl
by lil_v (Sexton) on Jul 15, 2008 at 12:51 UTC | |
by blazar (Canon) on Jul 19, 2008 at 22:39 UTC |