perl script to java code.
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   venkat_venkatesh
Posted On:   Tuesday, October 14, 2003 11:43 PM

I am having block of perl script code. i need to get a eqv. java code for that. can u plz give a eqv. java code? the perl code is .. $modelControlFile = $instr_file . "." . $model; if (! -f $modelControlFile) { my_print ("File $modelControlFile does not exist! "); } else { open (F, $modelControlFile); @lines = ; close ; foreach $l (@lines) { if ($l =~ /^:([^=]*)=(.*)$/) { ($key, $value) = ($1, $2); if ($key eq "InsitePrompt") { $insitePrompt = $value; } if ($key eq "Ro   More>>

I am having block of perl script code.
i need to get a eqv. java code for that.
can u plz give a eqv. java code?







the perl code is ..



$modelControlFile = $instr_file . "." . $model;


if (! -f $modelControlFile) {
my_print ("File $modelControlFile does not exist!
");
}


else {

open (F, $modelControlFile);

@lines = ;

close ;

foreach $l (@lines) {

if ($l =~ /^:([^=]*)=(.*)$/) {

($key, $value) = ($1, $2);

if ($key eq "InsitePrompt")
{ $insitePrompt = $value; }

if ($key eq "RootPrompt")
{ $rootPrompt = $value; }
if ($key eq "LoginUserPrompt")
{ $loginUserPrompt = $value; }
if ($key eq "LoginPasswordPrompt")
{ $loginPasswordPrompt = $value; }
if ($key eq "suCommand")
{ $suCommand = $value; }
if ($key eq "OSType")
{ $os = $value; }
}

}

if (!$insitePrompt || !$rootPrompt || !$loginUserPrompt
|| !$loginPasswordPrompt || !$suCommand || !$os) {

my_print ("Control file for model type ($model) is incomplete.
");

exit (1);

}

if ($debug) {

my_print ("
From $modelControlFile --
");

my_print (" InsitePrompt: $insitePrompt
");

my_print (" RootPrompt: $rootPrompt
");

my_print (" LoginUserPrompt: $loginUserPrompt
");

my_print (" LoginPasswordPrompt: $loginPasswordPrompt
");

my_print (" suCommand: $suCommand
");

my_print (" OSType: $os
");
}

}

   <<Less
About | Sitemap | Contact