Save date in a PERT txt

0

I need to save date information with a certain format, what I have done is get it to print the format I need, but do not save it in the text file, just create it.

my $vbbaAnt;
my $hsbcAnt;
my $scotiaAnt;
my $bancomHoy;
my $santanHoy;

Find the time of the machine

my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
my @dias = qw( Dom  Lun Mar Mier Jue Vie Sab );
$year += 1900;
$mon++;

If the month is less than 10, add a zero at the beginning

if ($mon <  10)
{
    $mon = 0 . $mon;
    print $mday;
}

current date

my $hoy;
$hoy = <"$mday . $mon . $year">;

open ("$mday . $mon . $year", '>> viernes.txt');

print "$dias[$wday]\n";

Show the date in "dd mm yyyy" format

print "\n$mday-$mon-$year"; 
    
asked by garypuerca 27.09.2018 в 16:17
source

1 answer

0

You need to open the file with open (), and then make a print () with the identifier you used in the open (). Finally, you make a close () to close the access to the file.

You have an example in link

and in the forums section, hundreds more.

    
answered by 27.09.2018 в 18:22