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

symbolic references in perl module help

2004-07-16 Thread Luis Pachas
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."\n" } 1; ## End Module MAIN : !#/bin/perl lib "$E

Re: references in perl...

2002-12-06 Thread Jeff 'japhy' Pinyan
On Dec 6, christopher j bottaro said: >i'm a c/c++ programmer trying to learn perl. there are just some things that >are much more easily done in a language like perl than in c/c++ i've found >out...=) anyways, i'm reading a short tutorial about references. am i wrong >in thinking they are like

Re: references in perl...

2002-12-06 Thread christopher j bottaro
cool thanks. and yes i'm reading perlreftut but not perlref. perlref looks a bit too exhaustive for my purposes now. perhaps in the future when i become more advanced in the ways of perl. and Timothy, yeah i'm sure there are difference of course, but i guess i was asking very generally if it

RE: references in perl...

2002-12-06 Thread wiggins
On Fri, 6 Dec 2002 13:57:33 -0600, christopher j bottaro <[EMAIL PROTECTED]> wrote: > hello, > i'm a c/c++ programmer trying to learn perl. there are just some things that > are much more easily done in a language like perl than in c/c++ i've fou

RE: references in perl...

2002-12-06 Thread Timothy Johnson
sses the key indirectly, and the second one dereferences the $_ variable first. In the second example, we could refer to the hash as %{$_}. -Original Message- From: christopher j bottaro [mailto:[EMAIL PROTECTED]] Sent: Friday, December 06, 2002 11:58 AM To: [EMAIL PROTECTED] Subject: re

references in perl...

2002-12-06 Thread christopher j bottaro
hello, i'm a c/c++ programmer trying to learn perl. there are just some things that are much more easily done in a language like perl than in c/c++ i've found out...=) anyways, i'm reading a short tutorial about references. am i wrong in thinking they are like pointers in c/c++? -- christoph