Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > perl read bin file

Reply
Thread Tools

perl read bin file

 
 
hehehe
Guest
Posts: n/a
 
      02-09-2010
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

 
Reply With Quote
 
 
 
 
Jürgen Exner
Guest
Posts: n/a
 
      02-09-2010
"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
 
Reply With Quote
 
 
 
 
hehehe
Guest
Posts: n/a
 
      02-09-2010

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.




 
Reply With Quote
 
hehehe
Guest
Posts: n/a
 
      02-09-2010

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.... :-]

 
Reply With Quote
 
Jürgen Exner
Guest
Posts: n/a
 
      02-09-2010
"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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
#!/usr/bin/python or #!/usr/bin/env python? John Salerno Python 30 08-10-2006 05:20 AM
#!/usr/bin/ruby , #!/usr/bin/ruby -w , #!/usr/bin/ruby -T?, #!/usr/bin/ruby -T1... anne001 Ruby 1 04-23-2006 03:02 PM
how to encrypt a C data and write a bin file and read a bin at run time and decrypt C data sweety C Programming 9 02-07-2006 05:28 PM
Where do i find the recycle bin? XP PRO with norton protected bin Quiz Time Computer Support 6 06-27-2004 11:13 AM
Can "bin" be changed to "cgi-bin" for asp.net Kevin Mitchell ASP .Net 3 10-19-2003 10:39 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57