Please note: This page is imported from my wiki, which hasn't been updated in over 10 years. Some of the formatting was lost during the import. I'll try to get around to fixing it someday.
my $myvar =
Backticks are used to execute commands and return the input to the perl script e.g.
$result = $command
;
exec is used to launch a command when the output is to be directed to STDOUT e.g.
exec $command;
my $file = $ARGV[0];
my $locate = locate $file
;
my @matches = split(“\n”, $locate);
my $i=1;
foreach my $match (@matches) {
print ”($i) $match\n”;
$i++;
}
my $choice =
Andrew McDonough is a consultant CTO and software developer, currently based between Berlin and London.
Follow Andrew on Twitter or Connect on LinkedIn