in reply to Re^2: expression which does nothing
in thread expression which does nothing
As gaal said 42 is a noop, just like any other constant in void context. I mean if you have a program where a constant is used as an statement like:
this program surely does nothing. By the way, if you ask for warnings, Perl will tell you so:"me"; 9999; { throw => 'away' };
$ perl -w -e 42 Useless use of a constant in void context at -e line 1.
The one-liner is a noop over the standard input, which in this case comes from the pipe echo test |. So it allows you to do nothing, while consuming the input.
As a side note, there's nothing special about 42 except it is the Answer to The Ultimate Question Of Life, the Universe and Everything in pop culture. Very common in humorous pieces of code.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: expression which does nothing
by ikegami (Patriarch) on Dec 26, 2006 at 15:59 UTC | |
by bart (Canon) on Dec 27, 2006 at 11:27 UTC |