Limo has asked for the wisdom of the Perl Monks concerning the following question:
#!/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????
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Writing current working directory to $variable
by ar0n (Priest) on Aug 27, 2000 at 03:23 UTC | |
by merlyn (Sage) on Aug 27, 2000 at 07:23 UTC | |
by Limo (Scribe) on Aug 27, 2000 at 03:27 UTC | |
by Limo (Scribe) on Aug 27, 2000 at 03:33 UTC | |
|
Re: Writing current working directory to $variable
by athomason (Curate) on Aug 27, 2000 at 03:41 UTC | |
by Limo (Scribe) on Aug 27, 2000 at 04:01 UTC |