a few more lines in between and in the main program I have the following:use File::Basename; $infile_name = shift(@ARGV); if ( ! -r $infile_name) { print STDERR "1.Cannot read $infile_name\n"; exit 99; }
By including the if-then-else condition I am getting the following error that it "Cannot read graph=********(pathname)my $ver_name = shift @ARGV; my $mon_dir = dirname($infile_name); # Get directory if (! -z $ver_name) { (our $graph_dir = $mon_dir) =~ s?log/.*$?abinitio/run?; #Build dire +ctory as above if not equal to version.(Replace log/* with abinitio/r +un) } else { (our $graph_dir = $mon_dir)=~ s?log/.*$?$ver_name/abinitio/run?; #Build directory as such if equal to verion(Replace log/* with $ver_na +me/abinitio/run) } my $graph = "$graph_dir" . "/" . "$graphname"; # Concatenate graph directory with graphname if ( ! -r $graph) { print STDERR "2. Cannot read graph=$graph\n" exit 99; }
In reply to Re^2: Variable Declaration
by pp
in thread Variable Declaration
by pp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |