#!/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);