tags:

views:

61

answers:

2

i want put this perl code in another perl file :

my $ua = new LWP::UserAgent(agent => 'Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.5) Gecko/20060719 Firefox/1.5.0.5'); 

for example : i want open UP.PL and this perl file copy the above perl code in another perl file (ex:send it into another.pl) what am i going to do ? Thanks in advance .

A: 

Just copy and paste.

You do need the extra line

use LWP::UserAgent;

above it for this to work succesfully.

bart
A: 

Do you mean you want some Perl script to write Perl scripts with that line of code? That would be easy: you would simply make the script open a file and write the above into it. If the other file already exists you could use a regular expression to insert the line in a defined place. Is that what you are after?

tospo