![]() |
|
Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
RE: Blessables -- What Can You Make Into Objects?by perlmonkey (Hermit) |
on Apr 21, 2000 at 05:30 UTC ( #8314=note: print w/replies, xml ) | Need Help?? |
This was a cool article. Dont know how useful, but very interesting. I am sure I will find a use for it somewhere. I tried to play with blessing RegEx's and ran into trouble. You mention that you might be able to bless a s{}{}, but I couldn't figure it out. I wanted an object that would do "s/^\s+|\s+$/g" for me. It would not compile if i did somethine like $self = s{^\s+|\s+$}{}; so I ended up using qr{} instead, putting the s/// in the member function: So this works, but I dont know it is the most optimized routine. I did some benchmarks: And got these results: I guess the difference is just the function call, but thought maybe there is a faster way. Any Ideas?
In Section
Tutorials
|
|