zentara has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use strict; use warnings; while (my $data = <DATA>) { #chomp $data; print $data; if ($data == 2){print "->got 2\n"} } print "Enter a 2\n"; my $input = <>; if ($input == 2){print "->got 2\n"} __DATA__ 1 2 3 4
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Whatever happened to chomp?
by jsprat (Curate) on Dec 14, 2003 at 14:57 UTC | |
by pg (Canon) on Dec 14, 2003 at 19:53 UTC | |
|
Re: Whatever happened to chomp?
by Limbic~Region (Chancellor) on Dec 14, 2003 at 14:58 UTC | |
by CombatSquirrel (Hermit) on Dec 14, 2003 at 15:24 UTC | |
by diotalevi (Canon) on Dec 14, 2003 at 19:57 UTC | |
by Limbic~Region (Chancellor) on Dec 14, 2003 at 15:46 UTC | |
|
Re: Whatever happened to chomp?
by derby (Abbot) on Dec 14, 2003 at 15:33 UTC | |
|
Re: Whatever happened to chomp?
by ysth (Canon) on Dec 14, 2003 at 17:01 UTC | |
|
Re: Whatever happened to chomp?
by Zaxo (Archbishop) on Dec 14, 2003 at 23:02 UTC |