Dr.Ruud wrote: > Mathew Snyder schreef: >>John W. Krahn: > >>>Yes, Perl has five "false" values: undef, (), 0, '' and '0', and two >>>of those are valid input from the readline operator. >>Should running the above from the command line make a difference? I >>ran them both entering 0 each time and I got 0 back. This is what it >>looks like: >> >>[EMAIL PROTECTED]:~> perl -e 'if ($_ = <STDIN>) { print; }' >>0 <---input value >>0 <---returned value > > Normally, $/ is "\n", so there is often a newline character at the end > of the value of $_.
The reason that there is a newline character at the end of the input is because that is the way the terminal software works, not because of the value of $/. John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>