in reply to Need Wisdom of Perlmonks to solve my problem in R software

A Perlish solution would be to write a Perl script that writes an R-source file for you. That R-source file can then be used from within R using the source("my_source.R") function if working interactively, or R CMD BATCH my_source.R if running as a batch from the command-line.

Or you could try R::Writer (warning: it is still in alpha).

Oh, and BTW, it is "Perl" (the language) or "perl" (the interpreter), but never ever "PERL".

Update: added link to R::Writer

CountZero

A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James