Help get this topic noticed by sharing it on Twitter, Facebook, or email.
I’m happy

Output of code from Chaper 3, Question 3

Dear sir,

This refers to a question (#3), in chapter three of Learning Perl 4th edition.

For the below piece of code I am getting the below output. Is it correct?

#!perl -wait

@names = ;
@names=sort(@names);
print "@names\n";
chomp(@names);
print "@names\n";

exit;

#D:\HandsOn\Perl\Chap-03>.\Ex-3-3.pl
#fred
#barney
#wilma
#betty
#^Z
#barney
# betty
# wilma
#
#barney betty wilma

#D:\HandsOn\Perl\Chap-03>.\Ex-3-3.pl
#
#fred
#barney
#wilma
#betty
#^Z
#barney
# betty
# fred
# wilma
#
#barney betty fred wilma

Regards,
Abu.
1 person has
this question
+1
Reply