#!/usr/bin/perl use strict; use warnings; $ENV{HOME} = 'C:\Documents and Settings\kompeS\Desktop\PERL SCRIPTS'; my $file = "$ENV{HOME}/partno_C7_5.03.4_prod"; open(my $fh, '<', $file) or die("Unable to open input file \"$file\": $!\n"); while (<$fh>) { my ($map_dir,$dir,$part_no,$chg_lvl,$int_lock,$t_spec) = split /\s+/; print " $map_dir,$dir,$part_no,$chg_lvl,$int_lock,$t_spec"; }