This shows you the differences between two versions of the page.
— |
kurs:chomp_vs_chop.pl [2014/09/10 21:22] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | <code> | ||
+ | use strict; | ||
+ | use warnings; | ||
+ | my $input = <STDIN>; | ||
+ | |||
+ | printf "input: [%s]\n", $input; | ||
+ | |||
+ | my $return = chomp($input); | ||
+ | printf "return: [%s] input: [%s]\n", $return, $input; | ||
+ | |||
+ | $return = chop($input); | ||
+ | printf "return: [%s] input: [%s]\n", $return, $input; | ||
+ | </code> |