http://www.perlmonks.org?node_id=1006696

selva has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

I have one file contains list of records. Each field in the record are delimited by ^D character.

I am trying to get each field value by using split function with delimiter as ^D, but it is not giving expected result.

$FileLocation="/home/RND/Sample.txt"; open ($FILE, $FileLocation) or die "$!"; my @arr = <$FILE>; my (@LineDetails); foreach $line (@arr) { @LineDetails = split (/chr(4)/,$line); print $_."\n" foreach ( @LineDetails ); }