Perl System values to variables

In perl you can easily assign the system (“some commands”) values to variables using the  Capture::Tiny Module.

Step 1: Download the Capture::Tiny Module from cpan.

Step 2: Extract the downloaded file and go into that and run

perl Makefile.PL


make run

make install 

commands to install.

Step 3:  Example program.

use strict;
use warnings;
BEGIN {required Capture::Tiny; }
my $out = Capture::Tiny::Capture {system ("commands");};
print "$out";



Thanks for reading this post…!!

please leave a command to improve the site……..!!!

307 total views, 2 views today

Leave a Reply

Your email address will not be published. Required fields are marked *