![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Hobbyist Programmer
|
I have a few modules in a subdir (./lib) in my dev folder. This code is in main.pl:
use lib '/DNDBot/lib/'; use IO::Socket; use Quote; use Util; use Roll; Where Quote, Util and Roll are all the custom modules I'm using. sarumont@illusion DNDBot $ ls ./lib/ total 10K drwxrwxr-x 2 sarumont wheel 2.0K May 6 06:01 . drwxrwxr-x 22 sarumont wheel 2.0K May 6 06:05 .. -rwxrwxr-x 1 sarumont wheel 528 Apr 7 11:53 Quote.pm -rwxrwxr-x 1 sarumont wheel 1.7K May 6 06:01 Roll.pm -rwxrwxr-x 1 sarumont wheel 261 May 6 06:01 Util.pm sarumont@illusion DNDBot $ When I use anything from Quote and Roll, all is well. But Util doesn't work: Undefined subroutine &Util::getOps called at ./main.pl line 86, <GEN0> line 51. Here is the code in Util.pm: package Util;
@EXPORT = qw( getops );
use strict;
sub getOps
{
my @ops = '';
@names = split( / /, $_[0] );
foreach my $x( @names )
{
chomp( $x );
if( $x =~ /@/ )
{
$x =~ s/@//;
push( $x, @ops );
}
}
return( @ops );
}
1;
__END__Any ideas why this won't work and the other modules (formatted the exact same way) will?
__________________
"Time is an illusion. Lunchtime doubly so." -the late, great Douglas Adams |
|
|
|
|
|
#2 |
|
Hobbyist Programmer
Join Date: Apr 2004
Location: Texas
Posts: 106
Rep Power: 5
![]() |
I noticed that you didn't us my on @names in Util.pm. I'm suprised that you are not getting errors.
__________________
[ [ SykkN alloc ] initWithThePowerTo: destroyYouAll ]; /* Don't make me use it! */ |
|
|
|
|
|
#3 |
|
Hobbyist Programmer
|
Added the my to @names...but that (obviously) didn't help.
I've tried moving the function to another module, but still no joy. ![]()
__________________
"Time is an illusion. Lunchtime doubly so." -the late, great Douglas Adams |
|
|
|
|
|
#4 | |
|
Hobbyist Programmer
|
OMG...I'm a moron...
Quote:
/me goes to hide in a corner. :blink:
__________________
"Time is an illusion. Lunchtime doubly so." -the late, great Douglas Adams |
|
|
|
|
|
|
#5 |
|
PFO Founder
![]() ![]() |
lol thats funny
![]()
__________________
BIG K aka Kyle Programming Forums Kyle K Online Please do not PM or email me programming questions. Post them in the forums instead. |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|