1 package C4::Stock; #asummes C4/Stock.pm
6 use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
9 # set the version for version checking
13 @EXPORT = qw(&stockreport);
14 %EXPORT_TAGS = ( ); # eg: TAG => [ qw!name1 name2! ],
16 # your exported package globals go here,
17 # as well as any optionally exported functions
19 @EXPORT_OK = qw($Var1 %Hashit);
22 # non-exported package globals go here
23 use vars qw(@more $stuff);
25 # initalize package globals, first exported ones
31 # then the others (which are still accessible as $Some::Module::stuff)
35 # all file-scoped lexicals must be created before
36 # the functions below that use them.
38 # file-private lexicals go here
42 # here's a file-private function as a closure,
43 # callable as &$priv_func; it cannot be prototyped.
48 # make all your functions, whether exported or not;
53 my $query="Select count(*) from items where homebranch='C'";
54 my $sth=$dbh->prepare($query);
56 my $count=$sth->fetchrow_hashref;
57 $results[0]="$count->{'count'}\t Levin";
59 $query="Select count(*) from items where homebranch='F'";
60 $sth=$dbh->prepare($query);
62 $count=$sth->fetchrow_hashref;
63 $results[1]="$count->{'count'}\t Foxton";
69 END { } # module clean-up code here (global destructor)