> $sth = $dbh->prepare("select ID from maintenance");
>this should read:
>my($sth) = $dbh->prepare("select ID from maintenance");


That didn't seem to work for me for some reason.

Another question - how do I apply strict to the lines below. And how do I just avoid 
the private or my declaration by specifically declaring a variable as a global 
variable (using vars?).
 foreach $var (@email){
$var =~ /(^.*)\\@.*/;
@names = (@names, "$1 ");}
@names = map (uc($_), @names);

  Todd Wade <[EMAIL PROTECTED]> wrote: 
"Rob Roudebush" wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> I've seemed to have narrowed down the problem to $sth variable, I guess I
can't declare this as a private variable because it "prepares" it and needs
to have it at least local or global to access it?
> Rob Roudebush wrote:
> I think pulling the ID field may be causing the problem with use strict; ?
>
> $dbh = DBI->connect( "DBI:mysql:turnover", "root", "", {RaiseError => 1,
AutoCommit => 0});
> $sth = $dbh->do( "insert into maintenance (owner, email, maintype, title,
requested, engineer, ticket, impact, comm
> .....

the do() method dosent return a statement handle. The transaction is
complete after do() executes sucessfully.
remove: ``$sth = '' from above, and then wrap $sth in my() in the line
below, as in:

> $sth = $dbh->prepare("select ID from maintenance");

this should read:

my($sth) = $dbh->prepare("select ID from maintenance");

> $sth->execute();
> while ($ref = $sth->fetchrow_hashref()){
> $ID = $ref->{'ID'};}
> $dbh->disconnect;
>
> Mark Bergeron wrote: Rob,
> use strict; shouldn't really affect the syntax of any DBI handle or
statement. ...

When strict is giving you problems, its because you are doing something
wrong, even though you swear you arent. Ive learned to trust perl before I
trust my own code, its a good policy.

Todd W.
[EMAIL PROTECTED]




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience

Reply via email to