Vhaerun Posted April 19, 2008 Report Posted April 19, 2008 Programand la o chestie in C , ma gandeam "ce fain ar fi daca as avea ceva gen perl -e" , si am zis "hai sa fac" Asta a iesit :# C command-line interpreter use strict;my $command = shift || die "comanda c\n";my $path_to_compiler = "\"C:\\Program Files\\Wascana\\mingw\\bin\\gcc.exe\"";my $output_file = "test.exe";my $compiler_options = " -o $output_file -g";open(F,">temp.c") || die "nu pot creea fisier temporar\n";print F "#include <stdio.h>\n";print F "int main(int argc,char* argv[]) {\n";print F "$command\n";print F "return 0;\n}\n";close F || die "nu pot inchide fisierul $!\n";my $b_output = `$path_to_compiler temp.c $compiler_options`;if($b_output =~ /error/i) { print "EROARE: $b_output\n";}my $output = ($^O ne "MSWin32") ? `./$output_file` : `$output_file`;print $output,"\n";sub END { if(-e "temp.c") { unlink("temp.c"); } if(-e $output_file) { unlink($output_file); }}Scriptul poate fi rulat astfel :perl script.pl "printf(\"salut\");"perl script.pl "int i=0;while(i<10) { printf(\"%d\",i);i++; }"Optiunile mele sunt pt. IDE-ul Wascana , teoretic ar trebui sa poti configura orice compilator . Teoretic . Quote