I'm learning Perl and building an application that gets a random line from a file using this code:
open(my $random_name, "<", "out.txt"); my @array = shuffle(<$random_name>); chomp @array; close($random_name) or die "Error when trying to close $random_name: $!"; print shift @array;
But now I want to delete this random name from the file. How I can do this?