Posted By

yoblob on 02/17/11


Tagged


Versions (?)

create object


 / Published in: Perl
 

create a new game object

  1. package Game;
  2. sub new
  3. {
  4. my $class = shift;
  5. my $self =
  6. {
  7. _gameId => shift,
  8. _gameCategory => shift,
  9. _gameKeyword => shift,
  10. };
  11.  
  12. print "gameid is $self->{_gameId}\n";
  13. print "gameCat is $self->{_gameCategory}\n";
  14. print "gameKeyword is $self->{_gameKeyword}\n";
  15. }
  16.  
  17. $object = new Game( "someGameid", "someCat", "someKeyword");

Report this snippet  

You need to login to post a comment.