• Best of luck to the class of 2024 for their HSC exams. You got this!
    Let us know your thoughts on the HSC exams here
  • YOU can help the next generation of students in the community!
    Share your trial papers and notes on our Notes & Resources page
MedVision ad

perl question (1 Viewer)

wakarimashita

Member
Joined
Jul 27, 2004
Messages
47
is there anyway i can use perl to go to a webpage, get its html code and store it into an array?

thnx
 

Adrian.

Member
Joined
Jul 7, 2004
Messages
378
Location
Newcastle
Gender
Male
HSC
2005
I'm not very good at Perl but I'm sure it could be done. Assuming you're using Linux and have wget installed I'd do something like this.

#!/usr/bin/perl
$site = "www..."; # sets site into variable
`wget $site` # downloads site and saves in current directory as index.html
* # I'm not sure how to do this but you'll have to save the contents of index.html into an array.
`rm index.html` # removes index.html so you don't fill up your directory.

OK, if you can find out how to get a file into an array this should work. I'm still learning Perl myself and I think it's a great language. Good luck!
 

wakarimashita

Member
Joined
Jul 27, 2004
Messages
47
i want an array of the site in lines...

ok maybe this is not the best way to do this... this is wat im trying to do...

i've got webspace that does not allow cgi, so im trying to upload the cgi script else and im trying to use it from there... how can i do that?

thank you sooo much!! :) :)
 

Adrian.

Member
Joined
Jul 7, 2004
Messages
378
Location
Newcastle
Gender
Male
HSC
2005
Maybe you're looking at this in the wrong way. Could you upload your CGI script to the webspace that allows it and redirect all visitors to your non CGI site to the CGI site. Have all your dynamic content on the CGI site and leave all the static content on your non CGI site?
This would mean all visitors will still use the same URL, the same bandwidth will still be used by both sites (assuming this why you don't have your CGI webspace host everything).

Just a thought.
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top