Welcome to the Monastery | |
PerlMonks |
Re^2: sysread and null charactersby ggg (Scribe) |
on Mar 24, 2005 at 15:58 UTC ( [id://442090]=note: print w/replies, xml ) | Need Help?? |
Your example #4 is what I had tried first, but without the ".*" parts. I'm still not sure why they're needed. What I thought I was asking for was a match with any digit no matter where it was in the string. My bad.
At this point, after adding the ".*", it's doing just what I expected. Hurray! As to the need for ++$i; don't I need to change the offset each time I read the file in order to step further into the file to get the next digit? You seem to be implying that that's unneeded. Does sysread auto-increment it's own offset when it's used in a loop? If I just remove the ++, I get a runaway loop, so I guess not. What did you have in mind, please? I could leave it just the way it is, but I'd rather understand sysread a little better.
ggg
In Section
Seekers of Perl Wisdom
|
|