![]() |
|
No such thing as a small change | |
PerlMonks |
Re^2: Un "tie"ing a "tie"by ikegami (Patriarch) |
on Apr 17, 2006 at 20:16 UTC ( #543908=note: print w/replies, xml ) | Need Help?? |
Better yet, here's a version that looks for prefixes lines as opposed to calls to print.
Note: Prints the time at which the caller started printing the line, not the time at which the caller finished printing the line. Bug: Doesn't support zero length or undefined $/. Bug: Doesn't properly detect the line ending if it's split over multiple prints. Bug: Uses more memory than in should.
Update: Added paren that was accidently deleted after testing. Update: Simplified through the use of regexp. Tested to be safe. Update: Changed $/ to $\. Update: Added error checking, but I'm not sure that I'm returning the right value on error. Update: Re-added support for $len which was accidently removed when I switched to regexps. Unfortunately, a copy is now made of the text to print. Update: Switched from "\n" to $\ for splitting.
In Section
Seekers of Perl Wisdom
|
|