Hi all,
I have my own package which has one array as a global variable. In my main pgm, I use a "for" loop to create objects.
package.pm
our @array;
sub new {
my ($self, $a);
push (@array, $a);
}
main.pl
for ($i=0; $i<=3; $i++) {
$x[$i] = package->new($i);
}
print @x...
Hi all,
Is there any function/a method to check if a particular value is in an array apart from using "foreach" to check it one by one??
Thanks,
I had this problem before so it might be useful for someone
package Global;
use strict;
require Exporter;
use vars qw(@ISA @EXPORT);
@ISA = qw(Exporter);
@EXPORT = qw(A B);
use constant A => "A";
use constant B => "B";
1;
within the caller one use...
Hi,
I've got this code from an example in PerlDoc. It's a package to test HTML::Filter. From the manual, it says this package will count table tags and then make output not happen when inside a table.
package TableStripper;
require HTML::Filter;
@ISA = qw(HTML::Filter);
sub start {
my...
Hi,
I would like to extract the information of the header from a Web page. I've found an example as the following.
use LWP::Simple qw($ua get);
use HTTP::Headers;
use HTML::HeadParser;
$ua->proxy(http => "http://www.proxy.com/");
$h = HTTP::Headers->new;
$p =...
Hi,
I would like to create a database and use it on LAN with 10 users accessing it. I prefer to write an EXE program in VB coz I don't want to install Access on every user machines. My requirement is each user can access to different part of the DB e.g. some can add data into tables and some...
I have an input that could be
http://www.svr.com/ or
http://www.svr.com/file.ext
if the input if "http://www.svr.com/file.ext", I want to eliminate file.ext and get "http://www.svr.com/".
I've tried
$url =~ m[^http://+?/+?\.*?]
but it doesn't work. Any suggestion??
I want to set the agent but I don't know what I should put for AgentName.
$ua->agent("AgentName/0.1 " . $ua->agent);
For example, if I want my Agent to be IE, what should I put? Also, what does ".$ua->agent" mean? As when I put
$ua->agent("IE/6.0");
I think IE...
The information comes partly from rfc2068 and then how that is implemented in LWP::UserAgent (using HTTP::Headers) to modify the request header.
In compliance with HTTP 1.0 the request needs to send a 'Pragma: no-cache' in the request header.
With HTTP 1.1 the preferred method is to include a...
I want to save HTML files of Web pages back to the local machine.
First of all, I wrote this code
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Response;
$ua = LWP::UserAgent->new;
$res = HTTP::Resquest->new('GET', "http://server.name";);
$rep = $ua->request($res);
This code...
I want to save HTML files of Web pages back to the local machine.
First of all, I wrote this code
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Response;
$ua = LWP::UserAgent->new;
$res = HTTP::Resquest->new('GET', "http://server.name");
$rep = $ua->request($res);
This code...
I want to save a HTML file from a Web site. I've 2 questions about it
1. I use LWP::Simple as below
$url = "http://server.com";
$file = "/path/test.html";
$response = getstore($url, $file);
I have already changed mode of path to 777 (this path is outside my web directory)...
I want to write a perl code to save back HTML files of Web sites in order to analyse them. I first test by using the following code
$ua = LWP::UserAgent->new;
$req = HTTP::Request->new('GET',"http://www.yahoo.com");
$res = $ua->request($req);
if ($res->is_error) {
print...
I have got "500-Internal Server Error" but I don't know what the error is. So I'm wondering how to debug it.
Well, I cannot run "perl code.cgi" coz of the configuration of the server I'm using. I have to run it through CGI only.
I have got "500-Internal Server Error" but I don't know what the error is. So I'm wondering how to debug it.
Well, I cannot run "perl code.cgi" coz of the configuration of the server I'm using. I have to run it through CGI only.
Hi all,
I'm trying to install this module. I've already installed all recommend pacakges (HTML::Parser, URI, MIME-Base64, libnet, Digest-MD5).
Once I type "perl Makefile.PL", there's nothing happened even I've been waiting for more than 20 mins. When I debug it, the program stuck at...
I'm using Konverse on Debian but once I installed it. There is an icon of a green question mark on my task bar. I think it's supposed to be a yellow lamp one. I used "apt-get install konverse" to install. Any suggestion to change it to the lamp picture coz now I can't see any status...
Hi all,
At the first place, I used the following code to check if LWP::Simple has been installed
eval "use LWP::Simple";
if ($@) {
print "LWP installed\n";
} else {
print "LWP not installed\n";
}
Once I runned this code, it said "LWP installed"...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.