Perl System values to variables

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……..!!!

802 total views, 3 views today

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.