chomp() ...

blkdog wrote on Tue Oct 31 03:18:58 CET 2006:
Why does the following code produce the output below using EPIC?  Note the
new line in the string ... why does chomp() not remove the \n?

#Code ....

#! /user/bin/perl -w

$| = 1;

$pi = 3.141592654;
chomp($radius = );

sub circumference() {
   return 2 * $pi * $radius;
}

$circumference = circumference();

print "The circumference of $radius is $circumference";

OUTPUT :

5
The circumference of 5
 is 31.41592654

Note: The above is an archived snapshot of a forum thread. Use the original thread at sf.net to post comments.