Changes between Version 3 and Version 4 of Perl


Ignore:
Timestamp:
08/09/06 19:42:27 (18 years ago)
Author:
atzm
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Perl

    v3 v4  
    170170{{{ 
    171171#!perl 
    172 #!/usr/bin/perl 
    173  
    174172use strict; 
    175173use diagnostics; 
     
    179177 
    180178sub new { 
    181         my $class = shift; 
    182         bless { "1" => "hogera" }, $class; 
     179    my $class = shift; 
     180    bless { "1" => "hogera" }, $class; 
     181} 
     182 
     183sub set_1 { 
     184    my ($self, $val) = @_; 
     185    $self->{"1"} = $val; 
    183186} 
    184187 
    185188sub unko { 
    186         my $self = shift; 
    187         return $self->{"1"}; 
     189    my $self = shift; 
     190    return $self->{"1"}; 
    188191} 
    189192 
     
    191194 
    192195__END__ 
     196 
    193197}}} 
    194198 
     
    205209 
    206210my $obj = new object; 
     211$obj->set_1("hage"); 
    207212 
    208213my $serialized = nfreeze($obj); 
     
    243248{{{ 
    244249#!sh 
    245 $ ./freeze.pl | ./thaw.pl  
    246 hogera 
    247 }}} 
     250$ ./freeze.pl | ./thaw.pl 
     251hage 
     252}}}