perl read bin file

Discussion in 'Perl Misc' started by hehehe, Feb 9, 2010.

  1. hehehe

    hehehe Guest

    Hello!

    I have binfile and i need to find regular expression "1234test1234" in
    1000 bin files... so ineed to use perl for this but std. function

    open(FILE,"< bin.bin");

    while (<FILE>) {
    print $_;
    }

    not working... sow how to solve my problem?

    regards - MJ
     
    hehehe, Feb 9, 2010
    #1
    1. Advertising

  2. "hehehe" <> wrote:
    > I have binfile and i need to find regular expression "1234test1234" in
    >1000 bin files... so ineed to use perl for this but std. function
    >
    >open(FILE,"< bin.bin");
    >
    >while (<FILE>) {
    >print $_;
    >}
    >
    >not working... sow how to solve my problem?


    Had you asked perl to help then chances are you would know the answer
    already:

    >open(FILE,"< bin.bin");


    open(FILE,'<', 'bin.bin') or die "Cannot open bin.bin because $!\n";

    jue
     
    Jürgen Exner, Feb 9, 2010
    #2
    1. Advertising

  3. hehehe

    hehehe Guest

    Uzytkownik "Jürgen Exner" <> napisal w wiadomosci
    news:...
    > "hehehe" <> wrote:
    >> I have binfile and i need to find regular expression "1234test1234" in
    >>1000 bin files... so ineed to use perl for this but std. function
    >>
    >>open(FILE,"< bin.bin");
    >>
    >>while (<FILE>) {
    >>print $_;
    >>}
    >>
    >>not working... sow how to solve my problem?

    >
    > Had you asked perl to help then chances are you would know the answer
    > already:
    >
    >>open(FILE,"< bin.bin");

    >
    > open(FILE,'<', 'bin.bin') or die "Cannot open bin.bin because $!\n";
    >
    > jue


    not working error :


    readline() on closed filehandle FILE at print_bin.pl line 4.
     
    hehehe, Feb 9, 2010
    #3
  4. hehehe

    hehehe Guest

    Uzytkownik "Jürgen Exner" <> napisal w wiadomosci
    news:...
    > "hehehe" <> wrote:
    >> I have binfile and i need to find regular expression "1234test1234" in
    >>1000 bin files... so ineed to use perl for this but std. function
    >>
    >>open(FILE,"< bin.bin");
    >>
    >>while (<FILE>) {
    >>print $_;
    >>}
    >>
    >>not working... sow how to solve my problem?

    >
    > Had you asked perl to help then chances are you would know the answer
    > already:
    >
    >>open(FILE,"< bin.bin");

    >
    > open(FILE,'<', 'bin.bin') or die "Cannot open bin.bin because $!\n";
    >
    > jue


    my mistake bad path.... :-]
     
    hehehe, Feb 9, 2010
    #4
  5. "hehehe" <> wrote:
    >Uzytkownik "Jürgen Exner" <> napisal w wiadomosci
    >news:...
    >> "hehehe" <> wrote:
    >>> I have binfile and i need to find regular expression "1234test1234" in
    >>>1000 bin files... so ineed to use perl for this but std. function
    >>>
    >>>open(FILE,"< bin.bin");
    >>>
    >>>while (<FILE>) {
    >>>print $_;
    >>>}
    >>>
    >>>not working... sow how to solve my problem?

    >>
    >> open(FILE,'<', 'bin.bin') or die "Cannot open bin.bin because $!\n";
    >>

    >not working error :
    >readline() on closed filehandle FILE at print_bin.pl line 4.


    I find this highly suspicious. The open() was successful (i.e. you
    didn't get an error message there) but the readline failed with "closed
    filehandle"? I have a hard time believing that. Is there something you
    are not telling us?

    jue
     
    Jürgen Exner, Feb 9, 2010
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Mitchell

    Can "bin" be changed to "cgi-bin" for asp.net

    Kevin Mitchell, Oct 19, 2003, in forum: ASP .Net
    Replies:
    3
    Views:
    837
    Wim Hollebrandse
    Oct 19, 2003
  2. John Salerno
    Replies:
    30
    Views:
    1,962
    Stephan Kuhagen
    Aug 10, 2006
  3. sweety
    Replies:
    9
    Views:
    1,026
    Richard Heathfield
    Feb 7, 2006
  4. Yves Dorfsman

    #!/usr/bin/env python vs. #!/usr/bin/python

    Yves Dorfsman, May 2, 2008, in forum: Python
    Replies:
    27
    Views:
    2,003
    Tim Roberts
    May 10, 2008
  5. anne001
    Replies:
    1
    Views:
    465
Loading...

Share This Page