#!/usr/local/bin/perl use strict; use warnings; open (my $wordfile, '<', 'test1234.txt')|| die "Could not open test1234.txt, $!"; while (<$wordfile>){ print join ',', split(/\t/, $_); exit; }