I have a perl program which is now reading one of two possibilities:
1- The program reads two variables (ARGV[1] and ARGV[2]) which are dates that a insert as parameters
ex: ./toped.pl 01/05/2002 to 31/05/2002(date in Brazil is different)
2- The seconde option is it reads a variable defined previosly without parameters:
ex:
#@t = localtime();
#$tmon = $t[4] + 1;
#$tmon = "0" . $tmon if ($tmon < 10);
#$tyear = $t[5] + 1900;
#$firstday = join("-", "01", $tmon, $tyear);
my $ini = "'".$firstday."'";
My question is the following:
How can I make an if statement formula such that it reads the parameter if I put any, and if I don't, it reads the formula ($firstday)? Michel, São Paulo, Brazil
1- The program reads two variables (ARGV[1] and ARGV[2]) which are dates that a insert as parameters
ex: ./toped.pl 01/05/2002 to 31/05/2002(date in Brazil is different)
2- The seconde option is it reads a variable defined previosly without parameters:
ex:
#@t = localtime();
#$tmon = $t[4] + 1;
#$tmon = "0" . $tmon if ($tmon < 10);
#$tyear = $t[5] + 1900;
#$firstday = join("-", "01", $tmon, $tyear);
my $ini = "'".$firstday."'";
My question is the following:
How can I make an if statement formula such that it reads the parameter if I put any, and if I don't, it reads the formula ($firstday)? Michel, São Paulo, Brazil