Hello,
I am starting with Perl; and I have to make programs previously made in
Visual Basic in Perl... (at least Windows wont hang up, now I am using linux
:-))))
Well, I made a little menu that reads from a config file and update it, may
be some one woult find it useful (or may be not :-( Am an sending it
later...
Well my problem is (first problem) how do I to make a "while" or an if using
more than one condition, for ex. in Visual Basic it would be:
do while a=5 or b=2
loop
In Perl I could only use this (I am learing using some helps I found in the
page... anyway can you people tell me any other good help???)
while ( $op ne "E\n" )
{
bla bla bla
}
Well THANKS YOU ALL FOR OUR HELP, I hope to be able to help you some time...
Sebastian from Argentina, Buenos Aires.
Here is my code...
#!/usr/bin/perl
#use warnings;
use strict;
open FH, "cleanvec.ini" or die "Error: $!";
my @fields;
while (<FH>) {
push @fields, (split /=/, $_);
}
close FH;
my $mininimatch=$fields[1];
my $minfinmatch=$fields[3];
my $maxe=$fields[5];
my $mingapmatch=$fields[7];
my $sufijooutput=$fields[9];
my $op = "";
while ( $op ne "E\n" )
{
print `clear`;
print " Clean Vec (v1.2) BioInfo, GEMA\n";
print " ----- --- ------\n";
print "\n Config. actual\n";
print " ------- ------\n";
print " 1 - MinIniMatch = $mininimatch\n";
print " 2 - MinFinMatch = $minfinmatch\n";
print " 3 - MaxE = $maxe\n";
print " 4 - MinGapMatch = $mingapmatch\n";
print " 5 - SufijoOutput = $sufijooutput\n\n";
print " G - Grabar como default estas opciones.\n";
print " E - Ejecutar.\n";
print "\n\n";
print "(Control + c) - Salir\n";
print "Opcion : ";
$op = <STDIN>;
if ($op eq "1\n")
{
print "Nuevo valor para MinIniMatch : ";
$mininimatch = <STDIN>;
}
elsif ($op eq "2\n")
{
print "Nuevo valor para MinFinMatch : ";
$minfinmatch = <STDIN>;
}
elsif ($op eq "3\n")
{
print "Nuevo valor para Maxe : ";
$maxe = <STDIN>;
}
elsif ($op eq "4\n")
{
print "Nuevo valor para MinGapMatch : ";
$mingapmatch = <STDIN>;
}
elsif ($op eq "5\n")
{
print "Nuevo valor para SufijoOutput : ";
$sufijooutput = <STDIN>;
}
elsif ($op eq "G\n")
{
open FH, "> cleanvec.ini" or die "Error: $!";
print FH "mininimatch=$mininimatch";
print FH "minfinmatch=$minfinmatch";
print FH "maxe=$maxe";
print FH "mingapmatch=$mingapmatch";
print FH "sugijooutput=$sufijooutput";
close FH
}
}
if ($op eq "E\n")
{
print "Es igual a E...";
}