So what if you do this:
my @storedData;
while (my $row = $sth->fetchrow_hashref) {
push(@storedData, $row);
}
$sth->finish;
# blah blah, more stuff
foreach my $storedRow (@storedData) {
print $storedRow->{'supplier_name'};
}
Since it's a perl forum, and not a sed forum. Here is a possible way to do it for other readers coming around.
#!/usr/bin/perl -w
use IO::File;
my $fh = IO::File->new('ips.txt','r');
die 'ips.txt: ' . $! unless($fh && $fh->opened);
while (my $line = $fh->getline) {
chomp($line);
print...
When you want to access a hash reference, you can access it in the following manner: $row->{name}
Accessing your data via $row['name'] isn't really productive here. But, if you want $row{'name'} instead (or $row{name} for those of us lazy people), you can dereference the hash by doing: my %row...
The problem you have is really in your code, not File::Copy; Example:
<quote>
[ryagatich@nemesis ~/code/copy]$ find
.
./src
./src/test1.c
./src/test1.h
./dst
./copy.pl
[ryagatich@nemesis ~/code/copy]$ perl copy.pl
[ryagatich@nemesis ~/code/copy]$ find
.
./src
./src/test1.c
./src/test1.h
./dst...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.