The Perl and Raku Conference 2025: Greenville, South Carolina - June 27-29 Learn more

#!/usr/bin/ruby
#
#
var pipe = %p(ls); # same as: Pipe.new('ls');
var pipe_h = pipe.open_r; # open the pipe for reading
var lines = []; # will store the lines of the output
pipe_h.each { |line| lines.append(line.chomp) };
say lines.len;