Answer to Question #16120 in Perl for mohamed

Question #16120
$site=<STDIN>;
chomp $site;

print "\n";
print "source code\n\n 1 = php\n\n-> ";
$code=<STDIN>;
chomp($code);

if ( $site !~ /^http:/ ) {
$site = 'http://' . $site;
}
if ( $site !~ /\/$/ ) {
$site = $site . '/';
}
print "\n";

print "-> Target: $site\n";
print "-> Site source code: $code\n";
how i make this script get the target automatic from file.txt
1
Expert's answer
2012-10-24T10:08:34-0400
Inorder to do what you want, you're going to populate a file with
the URL's (preferably one per line). Then, read in the file and
process each URL in turn.
Thethings you're going to research on how to use are things like the open
function and also how to read a file into an array (or just how to
read each line from a file in turn. hint: foreach would work).

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS