in reply to Re: How to eliminate text portion of a binary file?
in thread How to eliminate text portion of a binary file?

The header will always end with the line:

#### end_ascii_header

Thanks,

-fiddler42

  • Comment on Re: Re: How to eliminate text portion of a binary file?

Replies are listed 'Best First'.
Re: Re: Re: How to eliminate text portion of a binary file?
by thor (Priest) on May 14, 2004 at 20:56 UTC
    Try this, then:
    use strict; use warnings; open(my $fh, "/path/to/file") or die $!; while(<$fh>) { last if $_ eq "#### end_ascii_header\n"; } #$fh is now positioned at the beginning of the binary data; do what yo +u will

    thor

    Update:Fixed a typo in the code (missing 'if')