#!/usr/local/bin/perl -w
use strict;
my $date_suffix;
# The directory I am running this script from: "/home/limo/Perl/2000/0827/test_dir";
# my $path = system('pwd'); DOESNT WORK
# my $path "."; DOESNT WORK
# my $path "./"; DOESNT WORK
if ($path =~ /(\d\d\d\d.\d\d\d\d)/) {
$date_suffix = $1;
$date_suffix =~ tr/\//\./;
}
print "$date_suffix\n";
# I want $date_suffix to contain the string: "2000.0827"
# It works when I use "my REAL $path" as stated above
What am I doing wrong here???? In reply to Writing current working directory to $variable by Limo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |