Tuesday, September 11, 2012

Perl - [ File Exists ]

#!/usr/bin/perl
use strict;
use warnings;

my $file = $ARGV[0];

die "This File ($file) Exists ! " if (-e "$file");

Result 


$ perl tmp.pl tmp.pl
This File (tmp.pl) Exists !  at tmp.pl line 7.

0 comentários:

Post a Comment