use warnings; #<-- also a good idea, especially if you are just starting perl programming use strict; die "Specify a file path\n" unless @ARGV; open my $fh, shift or die "Cannot open file: $!\n"; while (<$fh>) { if (/(\S+)\s+\S+\s+(\S+)\s+(.*)/){ #testing regex and tags print "$1, $2, $3\n"; #testing printing } } close $fh; print "Done!\n"; #### myperlscript.pl "C:/path/to/file/on_windows_pc/file.txt"