Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Using regular expression substitution on binary data

by jeremyh (Beadle)
on Mar 03, 2006 at 18:04 UTC ( #534314=perlquestion: print w/ replies, xml ) Need Help??
jeremyh has asked for the wisdom of the Perl Monks concerning the following question:

The quote below from www.perl.com makes me think this is okay.

"Although optimized for scanning text, Perl can also deal with binary data..."

I am filtering the output of an app that generates text followed by PDF by using a regular expression substition that gets rid of the text. (The "app" is actually several components piped together - it is convenient to just let the text output stay as long as I can remove it at the end). This seems to work, but wondered if there might problems that I just haven't run into yet. <update> I should give a little more detail:

I am capturing all the output in a scalar and then doing several multi-line RE substitutions on it using the "s" flag.

Comment on Using regular expression substitution on binary data
Re: Using regular expression substitution on binary data
by Aristotle (Chancellor) on Mar 03, 2006 at 18:23 UTC

    Your question is too vague to give a sensical answer. But if you all you’re wondering about is whether using regular expressions on binary data may cause problems, then no, it won’t. You might want to say use bytes and use the associated functions, possibly, but there’s nothing inherently problematic about it.

    Makeshifts last the longest.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://534314]
Approved by BMaximus
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (6)
As of 2014-08-21 11:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (134 votes), past polls