arvindmarlabs has asked for the wisdom of the Perl Monks concerning the following question:
In this script i am trying to get the value in "$file" but the if condition fails like "files not exists" filename like : sample.tar.gz Also how to ignore the . and .. files in directory#!/usr/bin/perl use Net::FTP; use Net::FTP::File; my $directory = '/tmp/bkp'; opendir (DIR, $directory) or die $!; while (my $file = readdir(DIR)) { next unless ($file =~ m/\.gz$/); print $file; if( -e $file)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Need Urgent help in perl
by choroba (Cardinal) on Jul 15, 2015 at 12:45 UTC | |
|
Re: Need Urgent help in perl (glob)
by tye (Sage) on Jul 15, 2015 at 13:43 UTC | |
|
Re: Need Urgent help in perl
by zwon (Abbot) on Jul 15, 2015 at 20:27 UTC |