LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 03-09-2009, 01:09 PM   #1
skuletm
LQ Newbie
 
Registered: Feb 2009
Posts: 3

Rep: Reputation: 0
Lightbulb "Not a CODE" reference error perl v5.10.0, Deprecated assignment operation.


Perl v5.10. SLES 11. Deprecated assignment.
my( $sym ) = $AEDefines::{$def}; // doing such an assignment will results in a error as the bug will make ,$AEDefines::{$def}; to be interpreted as a scalar , which is deprecated (and causing testing to fail )
$rc = &ck_set( $ck_ref, CK_SERVER | CK_OS, &$sym ); <"Not a CODE reference, error hit here

this was fixed by changing to assignment as in the following:
elsif( $tempos =~ /LINUX/ )
{
# Scan through the list of Linuxes to pick out the
# correct one.
foreach $def ( sort( keys( %AEDefines:: ) ) )
{
if( $def =~ /^OS_(.*)/)
{
if( $tempos =~ /$1/ )
{
$sym = $def;
$rc = &ck_set( $ck_ref, CK_SERVER | CK_OS, &$sym );
}
}
}
}
 
Old 03-10-2009, 10:16 PM   #2
taylor_venable
Member
 
Registered: Jun 2005
Location: Indiana, USA
Distribution: OpenBSD, Ubuntu
Posts: 892

Rep: Reputation: 40
Was there a question here? If so could you please rephrase it and use code blocks around your source next time please.
 
Old 03-11-2009, 01:15 PM   #3
Sergei Steshenko
Senior Member
 
Registered: May 2005
Posts: 4,481

Rep: Reputation: 453Reputation: 453Reputation: 453Reputation: 453Reputation: 453
Quote:
Originally Posted by skuletm View Post
Perl v5.10. SLES 11. Deprecated assignment.
my( $sym ) = $AEDefines::{$def}; // doing such an assignment will results in a error as the bug will make ,$AEDefines::{$def}; to be interpreted as a scalar , which is deprecated (and causing testing to fail )
$rc = &ck_set( $ck_ref, CK_SERVER | CK_OS, &$sym ); <"Not a CODE reference, error hit here

this was fixed by changing to assignment as in the following:
Code:
 elsif( $tempos =~ /LINUX/ )
        {
            # Scan through the list of Linuxes to pick out the
            # correct one.
            foreach $def ( sort( keys( %AEDefines:: ) ) )
            {
                if( $def =~ /^OS_(.*)/)
                {
                   if( $tempos =~ /$1/ )
                    {
                        $sym  = $def;
                        $rc = &ck_set( $ck_ref, CK_SERVER | CK_OS, &$sym );
                    }
                }
            }
        }
For starters, put

use strict;
use warnings;

in the beginning of your program - unless you've already done so.

And get rid of all error messages during compilation, and then get rid of all runtime warnings and errors before the one in question.

Where is the 'ck_set' function defined ?

Publish full code here.
 
Old 03-12-2009, 12:21 AM   #4
skuletm
LQ Newbie
 
Registered: Feb 2009
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks for getting to me on this. I actually got this resolved,
I was hoping "Not a CODE reference" was a perl error with
known list of causes. The ck_set (connection key set) method
was being passed an invalid value when setting
my( $sym ) = $AEDefines::{$def}
I'll keep the post cleaner next time
 
  


Reply

Tags
perl, sles


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
please help me with this perl code getting error "use of uninitialized value" haxpak Programming 10 03-01-2009 10:55 PM
"Failed Dependency error" while installing RPM for "DateTime" perl modules giridhargopal.cj Linux - Newbie 7 11-19-2008 12:05 AM
Logged in as "root"/Fedora 8 but get "Operation not permitted" when using "chmod etc gosunlee Linux - Newbie 7 02-10-2008 05:56 AM
C++ iostream - getting "deprecated header" error jdruin Programming 3 09-28-2004 07:31 AM
LFS 4.1: Stalled at Perl, "missing seperator" error from "make" SparceMatrix Linux From Scratch 1 06-07-2003 03:31 PM


All times are GMT -5. The time now is 01:57 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration