Help for this page

Select Code to Download


  1. or download this
    my $foo = Foo->new1;
    print $foo->{bar};
    ...
    
    sub new1 { bless { bar => 'baz' }, $_[0] }
    sub new2 { bless { bar => 'baz' }, ref($_[0]) || $_[0] }
    
  2. or download this
    my $fh = foo('foo.pl','r');
    print while <$fh>;
    
    sub foo { IO::File->new(@_) }