I could do something with substr(), but that would be very inefficient since it means copying all the data repeatedlyReally? You may be surprised. Sure, if you remove random data from the string, there will be copying happening, but then you're doing something you won't be able to do with a string pointer. But a Perl string is internally just a C string. With some additional data. Removing things from the front of a string means just a pointer is moved. No copying of data.
I bet you didn't benchmark your bold claim, did you?
In reply to Re: string pointers in perl?
by JavaFan
in thread string pointers in perl?
by halfcountplus
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |