Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Calculated position incorrect when using regex in text file that also contains binary info

by geertvc (Sexton)
on Jun 14, 2020 at 09:02 UTC ( #11118037=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    /CapHeight 667
    >>
    ...
    <<
    /Length 422
    >>
    
  2. or download this
    my $result = $pdf=~qr/^1 0 obj/m;
    say "Finding first item at start position  [$-[0]]" if $result;
    ...
     $result = $pdf=~qr/^4 0 obj/m;
    say "Finding fourth item at start position [$-[0]]" if $result;
    say "Finding fourth item at start position [$+[0]]\n" if $result;
    
  3. or download this
    Finding first item at start position  [26]
    Finding first item at start position  [33]
    ...
    
    Finding fourth item at start position [2035]
    Finding fourth item at start position [2042]
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (1)
As of 2021-10-18 04:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (72 votes). Check out past polls.

    Notices?