in reply to regex transforms of object attributes
... you know just don't use the get_set method.$self->{'content'} =~ s/foo/bar/g;
Plankton@Chum_Bucket:~/perl/perlmonks> cat test.pl #!/usr/local/bin/perl -w use strict; package Test; sub new{ my( $class, $value ) = @_; return bless { content => $value }, $class; } 1; package main; my $thing = Test->new( 'empty' ); print $thing->{'content'} . "\n"; $thing->{'content'} = 'the quick brown fox'; print $thing->{'content'} . "\n"; $thing->{'content'} =~ s[\b(.)][\U$1]g; print $thing->{'content'} . "\n"; Plankton@Chum_Bucket:~/perl/perlmonks> ./test.pl empty the quick brown fox The Quick Brown Fox
| Plankton: 1% Evil, 99% Hot Gas. |
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: regex transforms of object attributes
by BrowserUk (Patriarch) on Jun 19, 2004 at 01:01 UTC | |
by Plankton (Vicar) on Jun 19, 2004 at 01:47 UTC | |
|
Re^2: regex transforms of object attributes
by belden (Friar) on Jun 18, 2004 at 23:43 UTC | |
by Plankton (Vicar) on Jun 19, 2004 at 00:02 UTC | |
by Aragorn (Curate) on Jun 19, 2004 at 09:09 UTC | |
by Roy Johnson (Monsignor) on Jun 19, 2004 at 11:24 UTC | |
by herveus (Prior) on Jun 21, 2004 at 22:21 UTC | |
| |
by belden (Friar) on Jun 19, 2004 at 16:21 UTC |