Chapter 6
+sub count_char {
+  my ($pkg, $char, $string) = @_;
+  return $string =~ tr/$char/$char/;
+}
+
 1;
 __END__
 # Below is stub documentation for your module. You better edit it!
cvs diff: Diffing t
Index: t/02basic.t
===================================================================
RCS file: /home/sam/cvs/Data Counter/t/02basic.t,v
retrieving revision 1.1.1.1
diff  u  r1.1.1.1 02basic.t
    t/02basic.t       2002/02/04 01:31:54        1.1.1.1
+++ t/02basic.t       2002/02/04 06:24:55
@@  1,3 +1,4 @@
 use Test::More tests => 1;
+use Test::More tests => 2;
 use Data::Counter;
 is(Data::Counter >count( foo ,  bar ), 2);
+is(Data::Counter >count_char( a ,  abababa ), 4);
By specifying the  u option to cvs diff, you can produce the same unified diff for 
mat as the diff  u you met earlier.
Once you're happy with your changes, you can save them to the repository 
with the cvs commit command, which takes a log message using the  m option just 
like cvs import did:
$ cvs commit  m "Added the count_char() method"
cvs commit: Examining .
cvs commit: Examining t
Checking in Counter.pm;
/home/sam/cvsroot/Data Counter/Counter.pm,v  <    Counter.pm
new revision: 1.2; previous revision: 1.1
done
Checking in t/02basic.t;
/home/sam/cvsroot/Data Counter/t/02basic.t,v  <    02basic.t
new revision: 1.2; previous revision: 1.1
done
Now the current version in the CVS repository matches the contents of the 
working copy. In CVS terms the changes have been committed to the repository. 
154






footer




 

 

 

 

 Home | About Us | Network | Services | Support | FAQ | Control Panel | Order Online | Sitemap | Contact

web hosting perl

 

Our partners: PHP: Hypertext Preprocessor Best Web Hosting Java Web Hosting Inexpensive Web Hosting  Jsp Web Hosting

Cheapest Web Hosting Jsp Hosting Cheap Hosting

Visionwebhosting.net Business web hosting division of Web Design Plus. All rights reserved