Perl Interview Questions
Perl Interview Questions
If you chomp an array, all the trailing characters that match $/, from all the elements will be
removed. It returns the total number of characters removed.
In the case of hashes, only the values will be chomped, whereas the keys will remain
unchanged. It returns the total number of characters removed.
http://mpihowto.com/index.php/perl/perl-built-in-functions/perl-scalar-and-stringfunctions/perl-chomp-function
2. How can i display all array element in which each element will display on
next line in Perl ?
@array_declared=('ab','cd','ef','gh');
foreach (@array_declared) { print "$_\n"; }