Running system commands

In Perl, all you have to do is use a similar syntax that UNIX shell scripting uses -- at least BASH. Here's an example that displays the date from the UNIX date command. Basically, just enclose your system commands in back ticks. (`)

#!/usr/bin/perl

use strict;

my $date = `date +%Y%m%d`;

print $date;

The use strict; just forces you to use the my function which delares a variable local to the containing block.

Page Comments (Click to edit)






[Click to add or edit comments])

Please prepend comments below including a date

Design by N.Design Studio, adapted by solidGone.org (version 1.0.0)
Have a nice day.