This simple script works for me:
#!/usr/bin/env perl use strict; use warnings; my $cmd = "ls"; my @output = `$cmd`; chomp @output; foreach my $line (@output) { print "<<$line>>\n"; }
He made a conclusion (with the exception of triple points):
$ perl xx.pl <<args>> <<args.c>> <<args.dSYM>> <<atob.c>> <<bp.pl>> ... <<schwartz.pl>> <<timer.c>> <<timer.h>> <<utf8reader.c>> <<xx.pl>> $
The output of the command is divided into line boundaries (by default in the context of the list). chomp removes newlines in array elements.
Jonathan leffler
source share