http://www.perlmonks.org?node_id=1077130


in reply to Checking is variable contains literal periods in if statment...

What makes you think your conditional is failing? The following modification of your posted code
#!/usr/bin/perl -w use strict; #my $filename = "quotas.txt"; #open FILE, "$filename" or die "Cannot open $filename for reading: $!\ +n"; #open REPORT, ">report.csv" or die "Cannot open report.csv for writing +: $!\n"; undef $/; my $file = <DATA>; $/ = "\n"; my ($header,@records) = split /directory\s+/, $file; while (@records){ my $line = shift @records; if ($line !~ /\.\.\./) { # my ($path, $usage, $threshold) = $line =~ / (\S+) #grab pat +h # \D+ # (\d\S+) #stop at the first digit for usage # .*? # \[hard-threshold\] #seek out threshold # .*? # \(\s+(.*?)\) #capture threshold inside parens #/sx; # print REPORT "$path,$usage,$threshold\n"; print "NO ELLIPSIS: $line"; } else { print "ELLIPSIS: $line"; } } __DATA__ Type Path Policy Snap +Usage -------------------- ------------------------------ ----------- ----- +-------- directory /ifs/home/admin enforcement no + 32K [hard-threshold] ( 1.0G) [hard-threshold-exceeded] (no) [container] [usage-with-no-overhead] ( 32K) [usage-with-overhead] ( 103K) [usage-inode-count] (4) directory /ifs/home/ftp enforcement no + 31B [hard-threshold] ( 1.0G) [hard-threshold-exceeded] (no) [container] [usage-with-no-overhead] ( 31B) [usage-with-overhead] ( 6.0K) [usage-inode-count] (3) directory /ifs/gpd/data/trufusion/dat... enforcement no + 43G /ifs/gpd/data/trufusion/data0003 [hard-threshold] ( 80G) [hard-threshold-exceeded] (no) [container] [usage-with-no-overhead] ( 43G) [usage-with-overhead] ( 95G) [usage-inode-count] (606)
yields
NO ELLIPSIS: /ifs/home/admin enforcement no 32K + [hard-threshold] ( 1.0G) [hard-threshold-exceeded] (no) [container] [usage-with-no-overhead] ( 32K) [usage-with-overhead] ( 103K) [usage-inode-count] (4) NO ELLIPSIS: /ifs/home/ftp enforcement no 31B + [hard-threshold] ( 1.0G) [hard-threshold-exceeded] (no) [container] [usage-with-no-overhead] ( 31B) [usage-with-overhead] ( 6.0K) [usage-inode-count] (3) ELLIPSIS: /ifs/gpd/data/trufusion/dat... enforcement no 43G /ifs/gpd/data/trufusion/data0003 [hard-threshold] ( 80G) [hard-threshold-exceeded] (no) [container] [usage-with-no-overhead] ( 43G) [usage-with-overhead] ( 95G) [usage-inode-count] (606)
which looks kosher to me.

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.