in reply to print chomp <STDIN>

Hi redkar,

Did you read the documentation for chomp? chomp returns the number of characters removed. Also, you are missing a semicolon from the end of your second line.

Try the following short example:
#!/usr/bin/perl use strict; use warnings; print "Please enter some text: "; my $input = <STDIN>; chomp($input); print "You typed $input\n";
Read Basic Input and Output from the tutorials section of this site, and also the chomp documentation.

Hope this helps

Martin

Replies are listed 'Best First'.
Re^2: print chomp <STDIN>
by parv (Parson) on Jul 24, 2008 at 08:48 UTC
    While picking nit ... the semicolon would be optional on the second statement if it happens to the last statement.