in reply to Functions in Perl
#!/usr/bin/perl use strict; use warnings; my $example = Example->new; $example->print( map { chomp $_; $_; } <STDIN> ); $example->print('That\'s all!'); sub Example::new { my ($class, $start_num) = @_; bless \$start_num, $class; } sub Example::print { my $self = shift; print ++$$self, ": $_\n" for @_; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Functions in Perl
by nkuitse (Sexton) on May 23, 2004 at 15:16 UTC | |
by ihb (Deacon) on May 26, 2004 at 04:45 UTC | |
|
Re: Re: Functions in Perl
by ihb (Deacon) on May 24, 2004 at 14:01 UTC |