Perl Testing using system function

commandline session

$cat test4.pl
#!/usr/bin/perl
use strict;
use warnings;

system "echo 1 > 1";
print "n";
system "echo 2 > 2";
print "n";
system "echo hello";
print "n";
$perl test4.pl


hello

$cat 1
1
$cat 2
2
$

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s