#!/usr/bin/perl -wl use strict; use File::Temp qw( tempfile ); my %rep_stats=(1=>24694, 2=>23551, 0=>22855, ... -41=>1, ); # only keep 0 < XP < 100 because we want the more mainstream # values and not the far-out ones my @xp_sorted = grep { $_>0 && $_<100 } sort { $a <=> $b } keys %rep_stats; # generate our R commands (my $r_commands = <&", $tmp or die "can't dup tmp->STDIN: $!"; # finally, we exec R, which will read our commands # from STDIN (the temp file will be deleted automatically # when the program exits) my @cmd = qw(R --no-save --no-init-file --no-restore-data --slave); exec @cmd; die "couldn't exec @cmd : $1"; # should never get here