Apply chomp to all elements of an array : chmod « File « Perl






Apply chomp to all elements of an array

     

#!usr/bin/perl

use warnings;
use strict;

my @array = ( "One\n", "Two\n", "Three", "Four", "Five\n" );

my $newlines = chomp ( @array );  
print "\nWe just removed $newlines newlines from that list!\n";
print "\nThe list is now @array.";

   
    
    
    
    
  








Related examples in the same category

1.The chmod function modifies the read, write, and execute permissions on a file.
2.The chmod Function (UNIX)
3.The chmod Function (Windows)
4.Change a file's permissions?