perl read bin file

H

hehehe

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
 
J

Jürgen Exner

hehehe said:
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
 
H

hehehe

Uzytkownik "Jürgen Exner said:
Had you asked perl to help then chances are you would know the answer
already:


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.
 
H

hehehe

Uzytkownik "Jürgen Exner said:
Had you asked perl to help then chances are you would know the answer
already:


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

jue

my mistake bad path.... :-]
 
J

Jürgen Exner

hehehe said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top