a = arcadi shehter <[EMAIL PROTECTED]>
a>I think this was already discussed once and then it was proposed to
a>attach a property to characters of the string
a>
a> sub peek_at_sky {
a>
a>     my Color  @numbers = peek_with_some_hardware;
a>
a>     my $say_it =  join map { "1" but color($_) } @numbers ;
a>     return $say_it ;
a> }
a>
a>
a>   rule color { (.) { let $0 := $1.color } }
a>
a>   $daylight = &peek_at_sky =~ /<color>+/; # is something in sky

That works and isn't too bad, a quick fix with some interesting
possibilities. Should be an example in the documentation. Still,
the RFC that opened this discussion opens a different way-

http://dev.perl.org/rfc/93.html
http://www.perl.com/pub/a/2002/06/04/apo5.html?page=17#rfc%20093:%20regex:%20support%20for%20incremental%20pattern%20matching

Once a user-defined sub can hand characters to rexen- it could hand
anything over (floats, refs, etcetera).  It's an opportunity ripe
for exploitation.

-y

~~~~~

The Moon is Waxing Crescent (4% of Full)

Reply via email to