McMahon has asked for the wisdom of the Perl Monks concerning the following question:
print "Type the name of the CSV file:\n"; my $CSVfile =<STDIN>; chomp $CSVfile; my $dbh = DBI->connect(qq{DBI:CSV:csv_sep_char=\\\t}); $dbh->{'csv_tables'}->{'tabdelimited'} = { 'file' => '$CSVfile'};
Is there syntax to connect to a file specified by a variable?Execution ERROR: Cannot open .\$CSVfile: No such file or directory at + C:/Perl/site/lib/DBD/File.pm line 496, <STDIN> line 1.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBD:CSV doesn't interpret variable in "$dbh->" open command?
by Aristotle (Chancellor) on Aug 10, 2004 at 18:24 UTC | |
by McMahon (Chaplain) on Aug 10, 2004 at 18:42 UTC | |
by dragonchild (Archbishop) on Aug 10, 2004 at 18:57 UTC | |
by ysth (Canon) on Aug 10, 2004 at 19:00 UTC | |
|
Re: DBD:CSV doesn't interpret variable in "$dbh->" open command?
by jZed (Prior) on Aug 15, 2004 at 18:21 UTC |