in reply to how does '2>&1' work ?

but why this code make ifconfig no output in screen?

Normally, backticks capture stdout only, so stderr goes to the terminal, but if you redirect stderr to stdout, both are captured (you do ignore the captured output in the Perl program, though).

That said, under normal circumstances (no error), ifconfig prints to stdout anyway... — so, without the 2>&1 redirection, you'd get no output either:

$ perl -e '`ifconfig`' $