#!/usr/bin/perl use strict; use warnings; use File::Basename; use Text::ParseWords; if ($#ARGV == 0) { open my $file, "<", $ARGV[0] or die "Couldn't open file '$ARGV[0]': $! \nDid you specify a valid file?"; my ($SYMBOL); while (<$file>) { $SYMBOL = s%.*%%s;s%.*%%s; ## this is'nt obviously working ...### but this is what I want to achieve print "NEWCOLUMN:\"$SYMBOL\"\n"; } } } else { print "You need to specify an input file \n"; print "\n"; print "They are usually located here : \n"; print "/PATH/* \n"; print "\n"; print "Usage : ".basename($0)." difffile.txt \n"; print "\n"; exit; }