#! perl -slw use strict; my $s = 'the quick brown fox jumps over the lazy dog'; my @wordRefs; print do{ my $ref = \substr( $s, $-[ 0 ], $+[ 1 ] - $-[ 0 ] ); push @wordRefs, $ref; "$ref : $$ref"; } while $s =~ m[(\S+\s*)]g; print $/, '---', $/; print "$_ : $$_" for @wordRefs; __END__ P:\test>subrefs LVALUE(0x182caf8) : the LVALUE(0x1831624) : quick LVALUE(0x18315d0) : brown LVALUE(0x1824334) : fox LVALUE(0x18243f4) : jumps LVALUE(0x1831660) : over LVALUE(0x1831678) : the LVALUE(0x1831690) : lazy LVALUE(0x18316a8) : dog --- LVALUE(0x182caf8) : dog LVALUE(0x1831624) : quick LVALUE(0x18315d0) : brown LVALUE(0x1824334) : fox LVALUE(0x18243f4) : jumps LVALUE(0x1831660) : over LVALUE(0x1831678) : the LVALUE(0x1831690) : lazy LVALUE(0x18316a8) : dog