My intention is to get only the binary data. Therefore, I am using the range operator (..) to go from "end*of*junk*data" to "*start*of*junk*data" Ofcourse, once I get the binary data I will use unpack() to view the data. Here is what I have so far.$ cat file *start*of*junk*data*this is all junk data 01*end*of*junk*data*binary d +ata binary data binary data *start*of*junk*data*this is all junk data 02*end*of*junk*data*binary d +ata binary data binary data *start*of*junk*data*this is all junk data 03*end*of*junk*data*binary d +ata binary data binary data *start*of*junk*data*this is all junk data 04*end*of*junk*data*binary d +ata binary data binary data
For some reason I am not able to get the "range" operator to only display binary data for me. Any ideas? TIA#!/usr/bin/perl -w use strict; my $file="file"; open FILE, $file or die $!; while (<FILE>) { if (m{"*end*of*junk*data*".*?}i .. m{"*start*of*junk*data*".*?}) { p +rint; } } close (FILE);
In reply to Range question by magawake
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |