I thought that

require 'lib.pl';

was telling Perl where to find it.

Mr. Shawn H. Corey wrote:
> Amichai Teumim wrote:
>> When I do this, I get :
>>
>> ./script.pl <<EOD
>> 1234
>> 5678
>> 90
>> EOD
>>
>> Undefined subroutine &main::sumIt called at ./script.pl line 7, <STDIN>
>> line 3.
>>
>> #!/usr/bin/perl
>>
>> #require 'script.pl';
>
> require 'lib.pl';
>
>>
>> @userArray = <STDIN>;
>>
>> $sum = sumIt(@userArray);
>>
>> print $sum;
>
> If the sub sumIt() is in the file lib.pl, you have to tell perl where
> to find it.
>
>

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to