Changes between Version 3 and Version 4 of Perl
- Timestamp:
- 08/09/06 19:42:27 (18 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Perl
v3 v4 170 170 {{{ 171 171 #!perl 172 #!/usr/bin/perl173 174 172 use strict; 175 173 use diagnostics; … … 179 177 180 178 sub new { 181 my $class = shift; 182 bless { "1" => "hogera" }, $class; 179 my $class = shift; 180 bless { "1" => "hogera" }, $class; 181 } 182 183 sub set_1 { 184 my ($self, $val) = @_; 185 $self->{"1"} = $val; 183 186 } 184 187 185 188 sub unko { 186 187 189 my $self = shift; 190 return $self->{"1"}; 188 191 } 189 192 … … 191 194 192 195 __END__ 196 193 197 }}} 194 198 … … 205 209 206 210 my $obj = new object; 211 $obj->set_1("hage"); 207 212 208 213 my $serialized = nfreeze($obj); … … 243 248 {{{ 244 249 #!sh 245 $ ./freeze.pl | ./thaw.pl 246 h ogera247 }}} 250 $ ./freeze.pl | ./thaw.pl 251 hage 252 }}}