Depends on what you want to have in $str. Read chomp to learn about the return value of chomp.
In reply to Re^3: Idiomatic Perl? by Corion in thread Idiomatic Perl? by thenextfart