package Better;
sub saveBetter {
my ($sbn, $cost, $ur) = @_;
print "sbn: $sbn\n";
print "cost: $cost\n";
print "url: $url\n";
return;
}
1;
test.pl
#!/usr/bin/perl -w
use strict;
use warnings;
use threads;
use Better;
my $sbn = "123489876";
my $lee = "12.89";
my $abc = "abcde";
my @ParamList = ($sbn, $lee, $abc);
my $thr = threads->create(Better::saveBetter, @ParamList);
$thr->join();
./test.pl
Use of uninitialized value in concatenation (.) or string at Better.pm line 6.
sbn:
Use of uninitialized value in concatenation (.) or string at Better.pm line 7.
cost:
Use of uninitialized value in concatenation (.) or string at Better.pm line 8.
url:
Thread 1 terminated abnormally: Undefined subroutine &main::123489876 called at ./test.pl line 14.
Changed code to
#!/usr/bin/perl -w
use strict;
use warnings;
use threads;
use Better;
my $sbn = "123489876";
my $lee = "12.89";
my $abc = "abcde";
my $thr = threads->create(Better::saveBetter, $sbn, $lee, $abc);
$thr->join();
Still got same error.
Any idea?
Some output of perl -V
perl -V
Summary of my perl5 (revision 5 version 8 subversion 8) configuration:
Platform:
osname=linux, osvers=2.6.18-128.1.10.el5, archname=x86_64-linux-thread-multi
uname='linux ls20-bc2-13.build.redhat.com 2.6.18-128.1.10.el5 #1 smp wed apr 29 13:53:08 edt 2009 x86_64 x86_64 x86_64 gnulinux '
usethreads=define use5005threads=undef useithreads=define usemultiplicity=define
|