Attempt to free unreferenced scalar

2005-05-16 Thread Octavian Rasnita
Hi,

After running a program, I saw the following errors:

Attempt to free unreferenced scalar: SV 0x38bd0a4, Perl interpreter:
0x162445c
 at E:/usr/lib/Errno.pm line 15 (#1)
Attempt to free unreferenced scalar: SV 0x38bd0a4, Perl interpreter:
0x162445c at E:/usr/lib/Errno.pm line 15.

I can't see any other errors.

I have run the program again, but it didn't give me any errors.


Strange...

Teddy



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Attempt to free unreferenced scalar

2005-06-07 Thread Ing. Branislav Gerzo
Hi all,

I get error:
Attempt to free unreferenced scalar: SV 0x1e166a0, Perl interpreter: 0x3417c at
D:/Perl/lib/Errno.pm line 15.
while running this script, could anybody helps me ?

use strict;
use warnings;
use DBI;
use WWW::Mechanize;

my $dbh = DBI->connect("DBI:mysql:database=test;host=localhost;port=3306", 
"2ge", "",
{RaiseError => 1} ) or die "Can't connect: ", $DBI::errstr;

my $mech = WWW::Mechanize->new();
mech->agent_alias('Windows IE 6');

my $sth_get_links = qq{ select id, url from links
where follow = 1
limit 1
};

my $a = $dbh->selectall_hashref($sth_get_links, 'id');
while ( my($link_id, $value) = each(%$a) ) {
print "getting $value->{url}\n";
$mech->get( $value->{url} );
}
$dbh->disconnect;
__END__

for me it seems, that DBI and W::M doesn't like each other.

Thanks for any idea how to fix this

/brano


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: Attempt to free unreferenced scalar

2005-05-16 Thread Dave Gray
> After running a program, I saw the following errors:
> 
> Attempt to free unreferenced scalar: SV 0x38bd0a4, Perl interpreter:
> 0x162445c
>  at E:/usr/lib/Errno.pm line 15 (#1)
> Attempt to free unreferenced scalar: SV 0x38bd0a4, Perl interpreter:
> 0x162445c at E:/usr/lib/Errno.pm line 15.

The only time I've seen errors like that is in threading code that
uses non-threadsafe modules. What does your program do?

If you care enough, you might want to read up[1] and identify
suspicious code, then try to write an example that consistently throws
that error.

[1] 
<http://www.google.com/search?q=%22attempt+to+free+unreferenced+scalar%22+%22Perl+interpreter%22>

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: Attempt to free unreferenced scalar

2005-05-16 Thread Octavian Rasnita
My program just prints a web page and it doesn't use threads. It should run
under mod_perl (but it gives those errors when running it from command
line).

It uses more functional modules that get data from a MySQL database, and an
OOP module that prints the header, initialize the CGI object, the
CGI::Session object, the Template-Toolkit object...

Now I know why the program doesn't give that error when I run it for the
second time. It uses Template-Toolkit, and it creates a temp script which is
used the next time the program is launched, so it doesn't need to parse the
templates anymore.

I would try to make that OOP module to be a functional one, but I cannot use
CGI::Session from a functional module, because CGI::Session it gives an
error if I say something like:

our $session = CGI::Session->new(...);

I need to say:

my $session = CGI::Session->new(...);

so I cannot access CGI::Session from outside the module is used.

I will try to find what could be the problem, because I need to solve it.

Thank you.

Teddy


- Original Message - 
From: "Dave Gray" <[EMAIL PROTECTED]>
To: 
Sent: Monday, May 16, 2005 7:44 PM
Subject: Re: Attempt to free unreferenced scalar


> After running a program, I saw the following errors:
>
> Attempt to free unreferenced scalar: SV 0x38bd0a4, Perl interpreter:
> 0x162445c
>  at E:/usr/lib/Errno.pm line 15 (#1)
> Attempt to free unreferenced scalar: SV 0x38bd0a4, Perl interpreter:
> 0x162445c at E:/usr/lib/Errno.pm line 15.

The only time I've seen errors like that is in threading code that
uses non-threadsafe modules. What does your program do?

If you care enough, you might want to read up[1] and identify
suspicious code, then try to write an example that consistently throws
that error.

[1]
<http://www.google.com/search?q=%22attempt+to+free+unreferenced+scalar%22+%2
2Perl+interpreter%22>

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: Attempt to free unreferenced scalar

2005-06-07 Thread Octavian Rasnita
Hi,

I had the same problem and I don't know why, but I have discovered that if I
don't use $sth->fetchall_hashref('key') but another method, the script
doesn't gives errors anymore.

So I needed to use fetchrow_hashref() for each row instead.

Teddy

- Original Message - 
From: "Ing. Branislav Gerzo" <[EMAIL PROTECTED]>
To: 
Sent: Tuesday, June 07, 2005 12:31 PM
Subject: Attempt to free unreferenced scalar


> Hi all,
>
> I get error:
> Attempt to free unreferenced scalar: SV 0x1e166a0, Perl interpreter:
0x3417c at
> D:/Perl/lib/Errno.pm line 15.
> while running this script, could anybody helps me ?
>
> use strict;
> use warnings;
> use DBI;
> use WWW::Mechanize;
>
> my $dbh = DBI->connect("DBI:mysql:database=test;host=localhost;port=3306",
"2ge", "",
> {RaiseError => 1} ) or die "Can't connect: ", $DBI::errstr;
>
> my $mech = WWW::Mechanize->new();
> mech->agent_alias('Windows IE 6');
>
> my $sth_get_links = qq{ select id, url from links
> where follow = 1
> limit 1
> };
>
> my $a = $dbh->selectall_hashref($sth_get_links, 'id');
> while ( my($link_id, $value) = each(%$a) ) {
> print "getting $value->{url}\n";
> $mech->get( $value->{url} );
> }
> $dbh->disconnect;
> __END__
>
> for me it seems, that DBI and W::M doesn't like each other.
>
> Thanks for any idea how to fix this
>
> /brano
>
>
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Re: Attempt to free unreferenced scalar

2005-06-07 Thread Ing. Branislav Gerzo
Octavian Rasnita [OR], on Tuesday, June 7, 2005 at 13:01 (+0300) wrote
about:

OR> I had the same problem and I don't know why, but I have discovered that if I
OR> don't use $sth->fetchall_hashref('key') but another method, the script
OR> doesn't gives errors anymore.
OR> So I needed to use fetchrow_hashref() for each row instead.

Interesting, but it tends me to the same. Should we report this
strange behaviour to DBI ?

Thanks.

-- 

How do you protect mail on web? I use http://www.2pu.net

[My foolish parents taught me to read and write.]



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




Re: Attempt to free unreferenced scalar

2005-06-07 Thread Octavian Rasnita
Yes, I also think it is a bug in DBI, but I don't know where to report it.

If you could do it, I think it would be helpful for all of us.

Thanks.

Teddy

- Original Message - 
From: "Ing. Branislav Gerzo" <[EMAIL PROTECTED]>
To: 
Sent: Tuesday, June 07, 2005 1:07 PM
Subject: Re: Attempt to free unreferenced scalar


> Octavian Rasnita [OR], on Tuesday, June 7, 2005 at 13:01 (+0300) wrote
> about:
>
> OR> I had the same problem and I don't know why, but I have discovered
that if I
> OR> don't use $sth->fetchall_hashref('key') but another method, the script
> OR> doesn't gives errors anymore.
> OR> So I needed to use fetchrow_hashref() for each row instead.
>
> Interesting, but it tends me to the same. Should we report this
> strange behaviour to DBI ?
>
> Thanks.
>
> -- 
>
> How do you protect mail on web? I use http://www.2pu.net
>
> [My foolish parents taught me to read and write.]
>
>
>
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> <http://learn.perl.org/> <http://learn.perl.org/first-response>
>
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>