#! /usr/bin/perl use strict; use warnings; # entweder my $lines = qx{ wc -l test.txt }; # oder alles in Perl my $lines = 0; open my $fh, '<', 'test.txt' or die "test.txt: open failed: $!\n"; $lines++ while ( <$fh> ); close $fh;