Thanks Rob and Jeff, this works:
##
#!/bin/perl
use warnings;
use strict;
use DBI;
my $dbs = "dbi:ODBC:DRIVER={servername};SERVER={serverip}";
my ($username, $password) = ('username', 'passwd');
my $dbh = DBI->connect($dbs, $username, $password)
or die "Can'
Lauri Nikkinen wrote:
Hi Lauri.
The critical part of your program is this.
> my $outfile = '>temp.txt';
> open(OUTFILE, $outfile) or die "Unable to open $outfile: $!";
I think you're using a Windows platform where a filename like that is invalid.
(If you are on Unix and have called a file'>temp
--- On Fri, 11/7/08, Lauri Nikkinen <[EMAIL PROTECTED]> wrote:
> From: Lauri Nikkinen <[EMAIL PROTECTED]>
> Subject: Re: Retrieve data via DBI and write into a file
> To: [EMAIL PROTECTED]
> Cc: beginners@perl.org
> Date: Friday, November 7, 2008, 9:33 AM
> Thank
Thank you for your reply. Using the code below I get an error message:
Global symbol "$var1" requires explicit package name at myscript.pl
lin 29.
#!/bin/perl
use warnings;
use strict;
use DBI;
my $dbs = "dbi:ODBC:DRIVER={servername};SERVER={serverip}";
my ($username, $password) = ('username', '
--- On Fri, 11/7/08, Lauri Nikkinen <[EMAIL PROTECTED]> wrote:
> From: Lauri Nikkinen <[EMAIL PROTECTED]>
> Subject: Retrieve data via DBI and write into a file
> To: beginners@perl.org
> Date: Friday, November 7, 2008, 8:28 AM
>
> my $outfile = '>temp.txt';
# ">" is not a part of the regula