[Koha-cvs] CVS: koha/C4 Input.pm,1.1.1.1,1.2

Steve Tonnesen tonnesen at users.sourceforge.net
Thu Jun 20 22:41:23 CEST 2002


Update of /cvsroot/koha/koha/C4
In directory usw-pr-cvs1:/tmp/cvs-serv4198

Modified Files:
	Input.pm 
Log Message:
Merged changes from rel-1-2


Index: Input.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Input.pm,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** Input.pm	19 Dec 2000 23:45:54 -0000	1.1.1.1
--- Input.pm	20 Jun 2002 20:41:21 -0000	1.2
***************
*** 1,10 ****
! package C4::Input; #asummes C4/Input
! 
! #package to deal with marking up output
  
  use strict;
  require Exporter;
  
! use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS);
  
  # set the version for version checking
--- 1,8 ----
! package C4::Input; #assumes C4/Input
  
  use strict;
  require Exporter;
  
! use vars qw($VERSION @ISA @EXPORT);
  
  # set the version for version checking
***************
*** 12,51 ****
  
  @ISA = qw(Exporter);
! @EXPORT = qw(&checkflds &checkdigit);
! %EXPORT_TAGS = ( );     # eg: TAG => [ qw!name1 name2! ],
! 
! # your exported package globals go here,
! # as well as any optionally exported functions
! 
! @EXPORT_OK   = qw($Var1 %Hashit);
! 
! 
! # non-exported package globals go here
! use vars qw(@more $stuff);
! 
! # initalize package globals, first exported ones
! 
! my $Var1   = '';
! my %Hashit = ();
! 
! 
! # then the others (which are still accessible as $Some::Module::stuff)
! my $stuff  = '';
! my @more   = ();
! 
! # all file-scoped lexicals must be created before
! # the functions below that use them.
! 
! # file-private lexicals go here
! my $priv_var    = '';
! my %secret_hash = ();
! 
! # here's a file-private function as a closure,
! # callable as &$priv_func;  it cannot be prototyped.
! my $priv_func = sub {
! # stuff goes here.
!   };
!    
! # make all your functions, whether exported or not;
   
  sub checkflds {
--- 10,16 ----
  
  @ISA = qw(Exporter);
! @EXPORT = qw(
! 	&checkflds &checkdigit &checkvalidisbn
! );
   
  sub checkflds {
***************
*** 87,92 ****
    }
    return $valid;
! }
   
  END { }       # module clean-up code here (global destructor)
-     
--- 52,93 ----
    }
    return $valid;
! } # sub checkdigit
! 
! #--------------------------------------
! # Determine if a number is a valid ISBN number, according to length
! #   of 10 digits and valid checksum
! sub checkvalidisbn {
!         use strict; 
!         my ($q)=@_ ;	# Input: ISBN number
! 
!         my $isbngood = 0; # Return: true or false
! 
!         $q=~s/x$/X/g;           # upshift lower case X
!         $q=~s/[^X\d]//g;
!         $q=~s/X.//g;
!         if (length($q)==10) {
!             my $checksum=substr($q,9,1);
!             my $isbn=substr($q,0,9);
!             my $i;  
!             my $c=0;
!             for ($i=0; $i<9; $i++) { 
!                 my $digit=substr($q,$i,1);
!                 $c+=$digit*(10-$i);
!             }
!             $c=int(11-($c/11-int($c/11))*11+.1);
!             ($c==10) && ($c='X');
!             if ($c eq $checksum) {
!                 $isbngood=1;
!             } else {
!                 $isbngood=0;
!             }
!         } else {
!             $isbngood=0;
!         } # if length good
! 
!         return $isbngood;
! 
! } # sub checkvalidisbn
! 
   
  END { }       # module clean-up code here (global destructor)





More information about the Koha-cvs mailing list