#!/usr/bin/perl -w use strict; use Data::Dumper; my $x = shift; # ... then i can play with $x here my @xvalues = (1 .. $x); my @yvalues = map { $_ ** 2 } @xvalues; print Dumper \@xvalues, \@yvalues; exit (0); #### #args <- commandArgs(TRUE) # This works okay but I would like to replace 10 as a parameter though x <- c(1:10) y <- c(x^2) png(filename="plot.png", bg="transparent") plot(x, y) dev.off()