A Easy Example-to-tell-you-are "2>&1" in Perl

Source: Internet
Author: User

You can decide if make the output shown on command screens by using 2>&1 or NUL

Testing script:

print "without null \ n";

System ("dir 2>&1");

print "with null \ n";

System ("dir > NUL");

print "End \ n";

Result:

C:\rebecca\script\perl\unicode>perl calculate.pl

Without null

Volume in drive C Isosdisk

Volume Serial Numberis ba23-5612

Directory of C:\Rebecca\script\perl\Unicode

01/22/2015 04:59pm <DIR>.

01/22/2015 04:59pm <DIR>.

01/22/2015 04:58pm 227 calculate.pl

01/22/2015 09:19am 194 unicode_test_v1.pl

01/21/2015 05:23pm 193unicode_test_v1.pl.ba

3File (s) 614 bytes

2Dir (s) 175,476,535,296 bytes free

With null #you can see with NUL, there isn ' t any output shown here

End


A Easy Example-to-tell-you-are "2>&1" in Perl

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.