in reply to Remove line from file based on numeric column value

Canonical answer from aaron_baugher: Think in terms of writing your original content to a new file with some elements removed.

BUT, re your narrative: Your phrase "the 8th column" should be "the 9th column" because your removal target is column 9. Just so it's clear, column 9 is the 8th element, $dataline[8], of an array (@arr) formed by splitting

XP.sta1    -41.5166    0.0513    0.6842    0.1794    0  CPHI.BHZ   300.2458   -42.2436

on white space because "XP.sta1" is $line[0].

my $dataline = "XP.sta1 -41.5166 0.0513 0.6842 0.1794 0 + CPHI.BHZ 300.2458 -42.2436"; my @arr = split /\s+/, $dataline; say "$arr[0], \t $arr[8]"; =head OUTPUT: XP.sta1, -42.2436 =cut

UPDATE: Your pseudocode (I hope it was intended as pseudocode) is far from actually useful and makes very little sense in terms of your problem statement. Something on this order might serve you better:

use 5.018; use Data::Dumper; my $mFile='DATA1127720.txt'; # OP's sample data open(my $tablec, "<", "$mFile") or die "Can't open the datafile: $!"; my @tablec = <$tablec>; for (@tablec) { my @XPinfo = split /\s+/, $_; chomp @XPinfo; my $delayTime = $XPinfo[8]; if ( $delayTime < -10 ) { say "\t OUT OF BOUNDS!!! \$delayTime: $delayTime"; }else{ say $delayTime; # revision to save desired lines left as an e +xercise } } =head EXECUTION D:\>perl 1127720FIXED.pl OUT OF BOUNDS!!! $delayTime: -42.2436 2.5545 2.6160 2.6006 =cut

Your questions will benefit from careful use of language. Your "code so far" could be read as reflecting the PM admonition 'show us your code' ONLY if it accurately reflected your question ...and were it compilable.