Ken Slater <kl...@psu.edu> wrote:
> You could just store the names in an array, but I'm assuming you need to
> access a specific file at some point.
I just wanted to follow up and perhaps clarify that. What I read is
> What I want to do is stick the
> same drive letter/directory path on the front of several filenames.
but what I'm hearing is that you want to prepend text to several
variables, not just the filenames.
One way to do that is via eval, e.g.
my $foo = 'hello foo';
my $bar = 'hello bar';
my $baz = 'hello baz';
my @vars = qw( foo bar baz);
foreach my $var (@vars) {
my $x = "\$$var = 'why, ' . \$$var . \"\\n\";";
eval $x;
}
print $foo, $bar, $baz;
This prepends 'why, ' and postpends a crlf to each of the variables foo,
bar, and baz. eval allows you to break the fourth wall.
--woody
--
Dr. Robert "Woody" Weaver
Security, Privacy, Wireless, and Information Assurance
IT Security Architect
Cell: 301-524-8138
--
Q: How many Martians does it take to screw in a light bulb?
A: One and a half.
_______________________________________________
Perl-Win32-Users mailing list
Perl-Win32-Users@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs