make gen_template.pl work from anywhere with FindBin

git-svn-id: svn://10.0.0.236/trunk@214975 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
sayrer%gmail.com
2006-11-08 19:19:19 +00:00
parent 0f8c8c6c17
commit 764b1c1d9a

View File

@@ -10,17 +10,17 @@
# perl gen_template.pl -b 345876 -type xul
#
# sends a test case template for bug 345876 to stdout
use FindBin;
use Getopt::Long;
GetOptions("b=i"=> \$bug_number,
"type:s"=> \$template_type);
if ($template_type eq "xul") {
$template_type = "static/xul.template.txt";
$template_type = "$FindBin::RealBin/static/xul.template.txt";
} elsif ($template_type eq "xhtml") {
$template_type = "static/xhtml.template.txt";
$template_type = "$FindBin::RealBin/static/xhtml.template.txt";
} else {
$template_type = "static/test.template.txt";
$template_type = "$FindBin::RealBin/static/test.template.txt";
}
open(IN,$template_type) or die("Failed to open myfile for reading.");