in reply to Simple Pass By Reference
Try this.
Result: Efficient pass-by-reference without the pain of dereferencing.
#! perl -slw use strict; sub modify (\$) { our $data; local *data = $_[ 0 ]; $data =~ s[this][that]g; return; } my $string = 'this & that;' x 10000; modify $string; print substr $string, 0, 24;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Simple Pass By Reference
by cosimo (Hermit) on Jul 26, 2005 at 16:01 UTC | |
by tomazos (Deacon) on Jul 26, 2005 at 17:27 UTC |