RE: symbolic references in perl module help

2004-07-16 Thread Charles K. Clarkson
Luis Pachas <[EMAIL PROTECTED]> wrote: : I keep getting a function undefined, I used require : and exporter but I kept getting subroutine undefined. : at times in the main:: and in the perl modules. Exporter works fine. Perhaps you could show us what you did? : I went around this by having

Re: symbolic references in perl module help

2004-07-16 Thread James Edward Gray II
On Jul 16, 2004, at 7:54 AM, Luis Pachas wrote: Hi I have a problem, I have a PM i have this A.pm : package A; my %b; $b = { apple => \&foo1, oranges => \&foo2, open => \&foo3 }; sub foo1 { print "apples\n" } sub foo2 { print "oranges\n" } sub foo3 { my ($item) = @_; print $item."\

Re: symbolic references in perl module help

2004-07-16 Thread Gunnar Hjalmarsson
Luis Pachas wrote: Hi I have a problem, I noticed several problems. I have a PM i have this A.pm : package A; my %b; $b = { Must be global. And you need to decide if you want a hash or a hash reference. I'm assuming a hash reference. our $b = { apple => \&foo1, oranges => \&foo2, ope

Re: Symbolic references

2004-05-12 Thread Rob Dixon
Jan Eden wrote: > > Hi all, > > there must be a better way to do this. My task is to create a multiple choice > test in HTML. First, I print the question (frage): > > my $query = "SELECT frage_id, frage_text, antwort_text_1, antwort_text_2, > antwort_text_3, antwort_text_4, ant

Re: symbolic references

2004-02-05 Thread david
David Byrne wrote: > Okay, sorry to be somewhat unclear with my question. > HereÂs some sample input data that may help to clear > things up: > > ### > node_id = 0 > parent_node_id = N/A > child_node_ids = 1, 2 > > node_id = 1 > parent_node_id = 0 > child_node_ids = 3, 4 > >

Re: symbolic references

2004-02-04 Thread James Edward Gray II
On Feb 4, 2004, at 4:19 PM, David Byrne wrote: Okay, sorry to be somewhat unclear with my question. Here’s some sample input data that may help to clear things up: See if this gets you going. It's one possible answer. James #!/usr/bin/perl use strict; use warnings; use Data::Dumper; my $tree

Re: symbolic references

2004-02-04 Thread David Byrne
Okay, sorry to be somewhat unclear with my question. Here’s some sample input data that may help to clear things up: ### node_id = 0 parent_node_id = N/A child_node_ids = 1, 2 node_id = 1 parent_node_id = 0 child_node_ids = 3, 4 node_id = 2 parent_node_id = 0 child_node_

Re: symbolic references

2004-02-04 Thread James Edward Gray II
On Feb 4, 2004, at 1:38 PM, David Byrne wrote: Greetings, Hello. I’m trying to generate a tree of nested hashes [of an arbitrary size]. I'm trying to run the code you posted, so I can see what the heck is going on. That's not going well for me either.My processor usage spikes through the r

Re: symbolic references and hashes

2004-01-07 Thread Gary Stainburn
Hi Rob, On Wednesday 07 January 2004 1:48 pm, Rob Dixon wrote: > "Gary Stainburn" <[EMAIL PROTECTED]> wrote in message [snip] > You're trying to dereference $_BLOCKS as a hash reference. Use > > return sort keys %{"_$key"}; > > and it should work. But note that it won't return the keys from > th

Re: symbolic references and hashes

2004-01-07 Thread Rob Dixon
"Gary Stainburn" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Hi folks, > > I've got the code: > > package Trainset; > > my %_BLOCKS=(); # blocks of track > my %_TRAINS=(); # trains > my %_BOXS=(); # signalboxes > > sub blocks { # Return list of blocks > sort keys %_BLOCKS; >

Re: Symbolic references and methods

2003-06-17 Thread Paul Johnson
Tom Gazzini said: > I can call a method on an object using the following: > > $objref->func() > > However, if I try to call this using a symbolic reference: > > my $func_name = "$objref->func"; > &{$func_name)(); > > then I get the following error: > > "Undefined subroutine &main::$objref->func c