in reply to Saving a Perl session to a file
use IO::Tee; use IO::File; my $tee = new IO::Tee(\*STDOUT, new IO::File(">myLogfile.log")); select $tee; print "\nHow old are you: "; my $age = <STDIN>; print "\nYou entered $age\n"; my $year = 2017 - $age; print "You were born in $year\n"
|
|---|