Perl Forum for Beginners

Warning that I am receiving. but not making any sense

Nov 25, 2008 5:19 pm
Wagner, David --- Senior Programmer Analyst --- WGO

I get the following printed out on my terminal:

pl517c.pl: Gen Rpt/Email St : 08:38:48
Attempt to free unreferenced scalar: SV 0x2063c74, Perl interpreter: 0x22424c at
C:\CurrWrka\00COMM~3\pl517c.pl line 1259.
Attempt to free unreferenced scalar: SV 0x206984c, Perl interpreter: 0x22424c at
C:\CurrWrka\00COMM~3\pl517c.pl line 1309.

The code is:

if ( ! $MyDataSw ) {
$MyPrtBuf .= sprintf " *** No Ids were found!! ***\n";
}

The processing completes, but I don't understand what is happening with the error. Running with strict and warnings, nothing appears as a warning, etc. I am running on xp sp 2, AS 5.8.8 build 824.

The code is exactly the same in both places where the warning comes up.

Thoughts? I searched the net and found a number of references, but nothing as mundane as this. I have a large number of scripts and what I am doing here is not much different than in others, yet I am getting this warning.

If you have any questions and/or problems, please let me know.
Thanks.

Wags ;)
David R. Wagner
Senior Programmer Analyst
FedEx Freight
1.408.323.4225x2224 TEL
1.408.323.4449 FAX
http://fedex.com/us

Nov 25, 2008 7:46 pm
Rob Dixon
Re: Warning that I am receiving. but not making any sense

Wagner, David --- Senior Programmer Analyst --- WGO wrote:
> I get the following printed out on my terminal:
>
> pl517c.pl: Gen Rpt/Email St : 08:38:48
> Attempt to free unreferenced scalar: SV 0x2063c74, Perl interpreter: 0x22424c at
> C:\CurrWrka\00COMM~3\pl517c.pl line 1259.
> Attempt to free unreferenced scalar: SV 0x206984c, Perl interpreter: 0x22424c at
> C:\CurrWrka\00COMM~3\pl517c.pl line 1309.
>
> The code is:
>
> if ( ! $MyDataSw ) {
> $MyPrtBuf .= sprintf " *** No Ids were found!! ***\n";
> }
>
> The processing completes, but I don't understand what is happening with the error. Running with strict and warnings, nothing appears as a warning, etc. I am running on xp sp 2, AS 5.8.8 build 824.
>
> The code is exactly the same in both places where the warning comes up.
>
> Thoughts? I searched the net and found a number of references, but nothing as mundane as this. I have a large number of scripts and what I am doing here is not much different than in others, yet I am getting this warning.
>
> If you have any questions and/or problems, please let me know.
> Thanks.

Which line is 1259 and 1309? The if or the assignment?

The error is an internal perl problem, and implies a bug in the XS code of one
of the modules you're using. I can't tell why you got it here that but thre's a
chance that it may help to discard the call to sprintf(), which does nothing
useful here. So:

unless ($MyDataSw) {
$MyPrtBuf .= " *** No Ids were found!! ***\n";
}

HTH,

Rob


Nov 26, 2008 12:44 am
Wagner, David --- Senior Programmer Analyst --- WGO
RE: Warning that I am receiving. but not making any sense

> -----Original Message-----
> From: Rob Dixon [mailto:rob.dixon@gmx.com]
> Sent: Tuesday, November 25, 2008 11:46 AM
> To: Perl Beginners
> Cc: Wagner, David --- Senior Programmer Analyst --- WGO
> Subject: Re: Warning that I am receiving. but not making any sense
>
> Wagner, David --- Senior Programmer Analyst --- WGO wrote:
> > I get the following printed out on my terminal:
> >
> > pl517c.pl: Gen Rpt/Email St : 08:38:48
> > Attempt to free unreferenced scalar: SV 0x2063c74, Perl
> interpreter: 0x22424c at
> > C:\CurrWrka\00COMM~3\pl517c.pl line 1259.
> > Attempt to free unreferenced scalar: SV 0x206984c, Perl
> interpreter: 0x22424c at
> > C:\CurrWrka\00COMM~3\pl517c.pl line 1309.
> >
> > The code is:
> >
> > if ( ! $MyDataSw ) {
It is the if statement in both cases. I changed the sprintf ,
but the error comes back to the if in both cases.
Thoughts?
Wags ;)

> > $MyPrtBuf .= sprintf " *** No Ids were found!! ***\n";
> > }
> >
> > The processing completes, but I don't understand what
> is happening with the error. Running with strict and
> warnings, nothing appears as a warning, etc. I am running on
> xp sp 2, AS 5.8.8 build 824.
> >
> > The code is exactly the same in both places where the
> warning comes up.
> >
> > Thoughts? I searched the net and found a number of
> references, but nothing as mundane as this. I have a large
> number of scripts and what I am doing here is not much
> different than in others, yet I am getting this warning.
> >
> > If you have any questions and/or problems, please
> let me know.
> > Thanks.
>
> Which line is 1259 and 1309? The if or the assignment?
>
> The error is an internal perl problem, and implies a bug in
> the XS code of one
> of the modules you're using. I can't tell why you got it here
> that but thre's a
> chance that it may help to discard the call to sprintf(),
> which does nothing
> useful here. So:
>
> unless ($MyDataSw) {
> $MyPrtBuf .= " *** No Ids were found!! ***\n";
> }
>
> HTH,
>
> Rob
>


Nov 26, 2008 1:03 am
Rob Dixon
Re: Warning that I am receiving. but not making any sense

Wagner, David --- Senior Programmer Analyst --- WGO wrote:
>
> if ( ! $MyDataSw ) {
>
> It is the if statement in both cases. I changed the sprintf, but the error
> comes back to the if in both cases.
>
> Thoughts?

Then either the perl engine is messed up beyond hope, or the scalar variable
$MyDataSw is more than a simple scalar 'my' variable.

How is $MyDataSw defined? I'm guessing it's tied.

Rob






Previous Thread: Ways to get a mapping of values versus keys in a hash where there is one-to-one mapping between the keys and the values !
Next Thread: Creating an HTML with images

Related Forum Topics
IO:Socket - receiving data
This is driving me mental. I don't know if I'm stupid, or the
documentation is really that bad.

After sending a request to a server I do the following, which I accept,
I get some part of the data back that I requested, and then only some
time later, after my code thinks it's got everything,...
Query on Threads, receiving Segment Fault.
--00504502cc03f6da8b047765cdd7
Content-Type: text/plain; charset=ISO-8859-1

Hi All,

I want to run multiple commands on a remote machine simultaneously. What I
did is created a thread for each command, created an ssh object for each
command and passed it to a function which simply runs...
Receiving Output parameters of a sybase stored procedure
--485b397dd777737e4704d3682155
Content-Type: text/plain; charset=ISO-8859-1

Hello All,

I want to call a sybase stored procedure from my perl script & store the
output parameter of script in a variable.
Script takes 5 input parameters & has one int type output prameter.
Below is part of...
Why do I get a warning?
Hi all,
If I run the following small test snippet

<--------------------------------------snip------------>
#! /usr/bin/perl

use strict;
use warnings;

use autodie;



open my $hdl, ">", "fileio1.txt";
print $hdl "a line\n";
close $hdl;

open HDL, ">", "fileio2.txt";
print HDL...
CGI warning/error
I got this example code from the book "CGI Programming with Perl"

#!/usr/bin/perl -wT

use strict;
use CGI;

my $q = new CGI;
print $q->header( "text/plain" );

print "These are the HTTP environment variables I received:\n\n";

foreach ( $q->http ) {
print "$_:\n";
print " ...
Warning: Use of uninitialized value
Hi,

I am trying to split the lines in a file into two halves (at the first
space) each half going into an array. The code I have written is below. The
print command is there to test that things worked correctly, but it only
gives an error for each instance of the print command...

Use...
Is there any method to tell different between warning and errors?
Hi all,
In my script, I have a system call, and redirect the stderr to a file.
#
# open STDERR, ">$workpath\\error_log.txt";
# system "...";
#
but I only want the ERROR messages to be logged in the file. Is there
any method to filter the WARNING messages...
Received ezmlm warning
---1260837014-175314661-1345807749=:10451
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Sending this as a test message, I received a warning saying that messages t=
o me have been bouncing.=0A=0AHopefully, I am still on the mailing list and=
this is...
Getting warning message while running the following code
------=_Part_801_22026830.1217581264790
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Dear list

while I am running the following code I am getting a warning message. the
code is as follows

1 use strict;
2 use warnings;
...
Re: gifts w--) WARNING. MY ACCOUNT WAS HIJACKED!
--0016e6d99cec6691e504969a8883
Content-Type: text/plain; charset=ISO-8859-1

My gmail account was hijacked from China!
DO NOT FOLLOW THE LINK IN THE PREVIOUS EMAIL RECEIVED FROM THIS ADDRESS!!!!

My Apologies.
Google is aware of the problem

--0016e6d99cec6691e504969a8883--