I try to make it OOP. What I want to do is I want to create an array of objects (@x in main) from "Package.pm". Each object has its own array which has different values (variables of objects). My problem is when I create an array (@a in the code above) in Package.pm but everytime that...
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...
To Justice41...
yes. Many modules use the same constant so I don't want to declare each constant seperately in each module as it is not a good idea to modify it later on. For the config file, u mean I should read the value from the file and then keep it in the constant variable?? Is there a...
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...
to use 'Foo', the meta tag has to be <meta http-equiv="Foo" content="..."> ???
if the meta tag is <meta name="description" content="...">, is the syntax should be "$h->header('Description')" ?? I've tried it but it doesn't work. Any suggestion...
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??
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.