OK, I'm no Perl expert (which will be painfully obvious shortly), I'm a .Net guy. That being said, this simple little bit of code is driving me nuts. I was hoping to figure out if I'm understanding things correctly so I wrote this little snippet:
my $areavpath = "/default/main/Internal/Intranet/TransSafety/WORKAREA/TransSafety";
my @filenames = {
'$areavpath/templatedata/site/about us/data/aboutus',
'$areavpath/templatedata/site/contact us option (by name)/data/contactusbyname',
'$areavpath/images/blackberry.gif'};
print "Filenames:\n";
foreach (@filenames)
{
print $_ . "\n";
}
my @dcrs = grep(/templatedata.site.*.data/,@filenames);
print "\nDCRs:\n";
foreach (@dcrs)
{
print $_ . "\n";
}
The problem is, when I run this I get the following output:
Filenames:
HASH(0x15d25ac)
DCRs:
Why is it printing HASH(0x15d25ac) and nothing for DCRs?