I wrote this simple perl program to read java source code files. But to my surprise the program is behaving very stangely.
open FILE, "Sample.java"; my @lines = <FILE>; close FILE; foreach my $str (@lines){print $str};
the source fille which I am reading is
package com.test.pack.app.visual.command; import java.math.BigDecimal; import java.text.ParseException; import javax.servlet.http.HttpServletRequest; import com.test.util.validation.MoneyValidator; import com.test.util.validation.StringValidator; import com.test.util.typeconverter.ExternalTextConverter;
The output of my program is
"import com.test.util.typeconverter.ExternalTextConverter;"
Where did all the other lines go?? why didn't the program print all the lines?
regards,PS: Is it just me?? every time I write a program it behaves is a most funny way in the begining!!
In reply to Strange File read problem by abhishes
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |