CarlosN has asked for the wisdom of the Perl Monks concerning the following question:
Hello,
This is my first post here.
I am trying to create a simple perl script to delete session files automatically using regex,
but my simple tiny regex won't find the file. The file is located in the same dir where the script
executes.
#!"c:/perl/perl/bin/perl.exe" # Script name = use warnings; use diagnostics; use strict; my $file = qr/carlos\.txt/; if (defined($file) && ($file =~ /carlos\.txt/)){ print "file found"; } else { print "file not found"; }
Any suggestions?
Thanks!
Carlos
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl script to delete files using regex
by hippo (Archbishop) on Nov 04, 2020 at 17:31 UTC | |
|
Re: Perl script to delete files using regex
by LanX (Saint) on Nov 04, 2020 at 18:36 UTC | |
|
Re: Perl script to delete files using regex
by Fletch (Bishop) on Nov 04, 2020 at 17:22 UTC | |
|
Re: Perl script to delete files using regex
by Bod (Parson) on Nov 24, 2020 at 00:24 UTC | |
by GrandFather (Saint) on Nov 24, 2020 at 00:52 UTC | |
by Bod (Parson) on Nov 24, 2020 at 01:01 UTC | |
by GrandFather (Saint) on Nov 24, 2020 at 01:30 UTC |