Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re: Running an external command

by 2teez (Priest)
on Apr 26, 2012 at 04:29 UTC ( #967231=note: print w/ replies, xml ) Need Help??

in reply to Running an external command

If your program output a file, why use a backtick? simply use a open function in Perl, like this:

use warnings; use strict; my $output_file="output.bam"; open my $fh,'>',$output_file or die "can't open $output_file:$!"; print $fh " ... hello world into my file..."; close $fh or die "can close file: $!";
Please, check perldoc perlopentut
or perldoc -f open for more ...
Hope this helps

Comment on Re: Running an external command
Download Code

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://967231]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2015-11-25 10:29 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (673 votes), past polls