Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 6th, 2004, 5:16 AM   #1
sarumont
Hobbyist Programmer
 
sarumont's Avatar
 
Join Date: Apr 2004
Location: /dev/urandom
Posts: 154
Rep Power: 5 sarumont is on a distinguished road
Send a message via ICQ to sarumont Send a message via AIM to sarumont Send a message via Yahoo to sarumont
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
sarumont is offline   Reply With Quote
Old May 6th, 2004, 11:07 PM   #2
sykkn
Hobbyist Programmer
 
Join Date: Apr 2004
Location: Texas
Posts: 106
Rep Power: 5 sykkn is on a distinguished road
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! */
sykkn is offline   Reply With Quote
Old May 7th, 2004, 4:20 AM   #3
sarumont
Hobbyist Programmer
 
sarumont's Avatar
 
Join Date: Apr 2004
Location: /dev/urandom
Posts: 154
Rep Power: 5 sarumont is on a distinguished road
Send a message via ICQ to sarumont Send a message via AIM to sarumont Send a message via Yahoo to sarumont
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
sarumont is offline   Reply With Quote
Old May 7th, 2004, 4:37 AM   #4
sarumont
Hobbyist Programmer
 
sarumont's Avatar
 
Join Date: Apr 2004
Location: /dev/urandom
Posts: 154
Rep Power: 5 sarumont is on a distinguished road
Send a message via ICQ to sarumont Send a message via AIM to sarumont Send a message via Yahoo to sarumont
OMG...I'm a moron...

Quote:
use lib '/DNDBot/lib/';
BUT...the version that I'm working on is on my USB thumb drive /mnt/usb/DNDBot/lib.

/me goes to hide in a corner.

:blink:
__________________
"Time is an illusion. Lunchtime doubly so."
-the late, great Douglas Adams
sarumont is offline   Reply With Quote
Old May 7th, 2004, 11:12 AM   #5
big_k105
PFO Founder

 
big_k105's Avatar
 
Join Date: Mar 2004
Location: Fargo, ND
Posts: 1,650
Rep Power: 10 big_k105 is on a distinguished road
Send a message via AIM to big_k105 Send a message via MSN to big_k105 Send a message via Yahoo to big_k105
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.
big_k105 is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 5:20 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC