Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Call for code samples!

by runrig (Abbot)
on Nov 15, 2001 at 23:14 UTC ( [id://125644]=note: print w/replies, xml ) Need Help??


in reply to Call for code samples!

My only offerings for /G and pos are this and this from the Pattern Finding thread (it does use pos() as an lvalue...).

And for /g, a thing to split up a block of text, preserving existing line breaks, but having a max line size:

print $1,"\n" while $text =~ /([^\n]{0,$max_line_size}})\n?/g;
Oh, and a '/g' example from a recent thread (of which you've probably already got something similar).

And this thing which reads from a socket until I have an end-token on a line:

while ($sel->can_read) { sysread($fh, $buffer, 2048, length($buffer)); next unless $buffer =~ /^(EOT|DONE)$/m; ....(process $buffer) }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://125644]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (6)
As of 2024-04-19 08:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found