Perl open call failing.
- by benjamin button
I am new to perl coding.
I am facing a problem while executing a small script i have:
open is not able to find the file which i am giving as an argument.Please see below:
File is available:
ls -l DLmissing_months.sql
-rwxr-xr-x 1 tlmwrk61 aimsys 2842 May 16 09:44 DLmissing_months.sql
My perl script:
#!/usr/local/bin/perl
use strict;
use warnings;
my $this_line = "";
my $do_next = 0;
my $file_name = $ARGV[0];
open( my $fh, '<', '$file_name')
or die "Error opening file - $!\n";
close($fh);
executing the perl script :
> new.pl DLmissing_months.sql
Error opening file - No such file or directory
what is the problem with my perl script.