using 'Learning Perl' and I'm trying to figure out a way to remove multiple files. I created a script that would remove 1 file, (like a rm function), but not more than 1. Below is the code
#! /usr/bin/perl use v5.16.3; use strict; use warnings; #### # Program works like rm function for just one file # 11/20/19 # #### print "Please enter the files to be removed: \n"; chomp(my @removed_files = <STDIN>); foreach (@ARGV) { unlink $_ or warn "Cant unlink '$_': $!, continuing ... \n"; }
TIA the catfish
In reply to remove files by catfish1116
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |