chomp

Do we have an autochomp in Perl?

This is what my Perl code looks like for monitoring a Unix folder : #!/usr/bin/perl use strict; use warnings; use File::Spec::Functions; my $date = `date`; chomp $date; my $datef = `date +%Y%m%d%H%M.%S`; chomp $datef; my $pwd = `pwd`; chomp $pwd; my $cache = catfile($pwd, "cache"); my $monitor = catfile($pwd, "monme"); my $...

How can I chomp an array in ruby?

Ok this is not a biggier but in the interest of writing cleaner code? IO.popen("Generate a list of files").readlines.each{|f_nl| f=f_nl.chomp # ... } Namely is there someway to chomp the whole array in one fell swoop? ...