I am already using PerlApp. I have a code that extracts certain type of elements from a text file. These elements have names like QUAD, CBAR, CROD. I have a while loop that reads the files line by line and extracts required info.
while(<FH>){
if($_ =~ C B A R){
do something
}
if($_ =~ Q U A D){
do something
}
if($_ =~ C R O D){
do something
}
if($_ =~ C B E A M){
do something
}
if($_ =~ C E L A S 1){
do something
}
...
}
Now the problem is I have 38 different element types and 20 files with 100 MB info in total abot 2 GB. If I have a fixed code then it takes too long to read these files. My solution was to quickly re constract my code based on user selection and run that code instead of the fixed long one. So the new script will only be looking for selected elements in the while loop. I will open a new file newcode.pl write reconstracted algorithm into that code and close it. and then run it. This will prevent the code looking for unwanted elements and significantly reduce the time spent.
while(<FH>){
if($_ =~ C B A R){ # selected element
do something
}
if($_ =~ Q U A D){ # selected element
do something
}
}
I will have an .exe file doing this (PerlApp) but I can not compile the reconstructed code with PerlApp. Because the users of this program will not have PerlApp on their machines, they will not have perl on their machines either. So how can I run this reconstructed script. |