Try this
$filename1="file.txt"; open (DAT, "<$filename1")|| die("Cannot Open File"); @MYFILE = <DAT>; close (DAT); foreach $t (@MYFILE) { $char = substr($t, 0, 2); if (length $t>1) {print "\n $char";} }
In reply to Re: how read data from file
by PetreAdi
in thread how read data from file
by rammohan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |