in my case I'm handling POSTed data, where $length is declared in the data, and $binary just sits between the <file/> tags.
If thats so you *definitely* can't use any approach other than blindly extracting a byte sequence of given length (as in Example 2) because the data *might* at some point contain the sequence \x00€µ</file>³á>>~ which would break your program otherwise (if you'd use the regex like ... =~m{<file>.*?</file>} ...).
Regards
mwa
In reply to Re^5: extracting a substring from a string - multiple variables
by mwah
in thread extracting a substring from a string - multiple variables
by walinsky
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |