in reply to delete FF's from a file

Several issues with this. Here are a few hints:

You should review common "regular expressions" and then searching binary data in particular.

Replies are listed 'Best First'.
Re^2: delete FF's from a file
by james28909 (Deacon) on Feb 11, 2013 at 09:41 UTC
    so i can open with filehandle "infile" without "$"?
    yes, it is a dump from hardware, but i guess you could call it plain text as it can be opened in notepad but has wild characters.
    i tried many different variations of $file =~ and nothing would work out.
    i am fixing to read up on the link that was posted earlier.
    thanks for all the help
      so i can open with filehandle "infile" without "$"?

      You CAN but there are good some very good reasons not to.

      You will notice from the last link above the "Modern Perl", Recommended by Anonymous Monk below, does not use it.

      At the end of the day its a choice that you make but I disagree with igelkott on this.

      To differentiate you could always call it $input_file_handle or similar.

        filehandle "infile" without "$"

        I don't have an evidence to support my claim of "usually" but maybe that's not relevant anyway. Of course it's possible to use and I didn't mean to imply that it was wrong. There were just so many things that looked "odd" to me.

      FWIW, you should binmode if you want to treat your binary files as binary ( no newline translation )

      with open it would be  open my($infile), '<:raw', ... or die ...

      While you're in a learning mood, get a free copy of Modern Perl book, a loose description of how experienced and effective Perl 5 programmers work....You can learn this too.</b.

        yes yes, i did use binmode. thanks for the tips as well :)
      i have def bookmarked this site
      this seems to be the place i can learn alot from
      i will make me a spot in the corner
      you wont even know im here
      ;D
Re^2: delete FF's from a file
by Anonymous Monk on Feb 11, 2013 at 09:38 UTC

    The first arg (file handle) for for open is usually bare (no $)

    It usually isn't, as barewords are global symbols, and lexicals are preferable in almost every situation

    You could make an argument about style (different things should look different), but you did not