What is the difference between chop & chomp functions in perl?

Answer Posted / thangaraju

chop is used remove last character,chomp function removes
only line endings.

Is This Answer Correct ?    80 Yes 15 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which of these is a difference between Perl and C++ ?

570


package MYCALC; use Exporter; our @EXPORT = (); our @ISA = qw(Exporter); our @EXPORT_OK = qw(addition multi); our %EXPORT_TAGS = (DEFAULT => [qw(&addition)],Both => [qw(&addition & +multi)]); sub addition { return $_[0] + $_[1]; } sub multi { return $_[0] * $_[1]; } 1; Program: use strict; use warnings; my @list = qw (2 2); use Module qw(:DEFAULT); print addition(@list),"\n"; Above coding is my module MYCALC and the program which using this module, I have not exported any function using @EXPORT, but I have used the DEFAULT in %EXPORT_TAGS with the function addition, when I call this function from the main it says the error as,

2269


Explain socket programming in perl?

512


Explain a tell function in perl?

541


Which statement has an initialization, condition check and increment expressions in its body? Write a syntax to use that statement.

547






What $! In perl?

527


How we can navigate the xml documents?

535


What does next statement do in perl?

582


What are different data types that perl supports. Elaborate on them.

555


What is Perl?

561


Explain goto name?

525


What is the use of -w, -t and strict in Perl?

565


what is perl language?

514


What is the syntax used in Perl grep function?

591


What is the purpose of redo statement?

529