I need to execute a sub-routine from a module everytime I run a perl script. This sub-routine sets the library path depending on the base path of the script.
Easier way would be modify the script and add code to execute this sub-routine. But we have hundreds of scripts to edit which we are not...
Hello, I am trying to install DBD::Oracle and I am getting the following error when I do make test. Can someone let me rectify this.
Thanks.
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/01base................Failed to load...
I have the following XML file in the below format:
<root>
<clients id="4">
<name>temp</name>
<order>yes</order>
</clients>
</root>
I am using XML::Parser Tree Style and the Dumper gives me:
$VAR1 = [
'root',
[
{},
0...
I have the following class:
package MyClass;
sub new {
my $classname = shift;
bless {'a'=>1,'b'=>2}, $classname;
}
1;
And I am accessing the class in my script as below:
#!/usr/bin/perl -w
use MyClass;
my $objref = MyClass->new();
print ref($objref) . "\n";
print for...
print "Palindrome is $1\n"
while ($str =~ m/(?=((.+).?(??{reverse($2)})))/g);
when a string like 'sdsd' is given, the above code will give all palindromes such as 'sds' and 'dsd'
If we remove the positive look ahead assertion as below:
print "Palindrome is $1\n"
while ($str =~...
I am having a problem with the following code.
my $exists = 0;
my @exists = $dbh_src->FetchData();
chomp($exists[0]);
print "Before if stmt: Fetched: $exists[0], userid = $user_id, flag = $exists\n";
$exists = 1 if ('$exists[0]' == '$user_id');
print "After if stmt: Fetched: $exists[0], userid...
I am having problem with passing array reference to sub-routine. I think I should be doing a small mistake somewhere.
print "Above function: $data[0]\n";
my $line = array_refer("\@data");
sub array_refer {
my @data = @$_[0];
print "In function: $data[0]\n";
}
The output I...
I need to remove directories recursively. I was wondering if there is any perl function equivalent to unix function 'rm -r directory_name'. rmdir function removes a directory only when it is empty. If there anyway that I can force the directory and all contents in it to get deleted. I can have a...
I have couple of questions:
1) How do we know when a file is created. In stat, atime gives the last access time and mtime gives the last modified time. But is there a way to know when the file is first created.
2) I feel this is something more difficult, is there a direct way to find when a...
How can I get total number of lines in a text file using perl from command line. $. gives the line number where the file handle is pointing to, but I need only the last line number.
Thanks.
My system went down and had to move to a new system. So I installed crystal reports and created DSN's. But when I tried to see the output it is giving the following error:
Failed to open a row set.
Details: HYTOO:[MySQL][ODBS 3.51 Driver]mysqld-3.23.49-log]Unknown table 'ticket_dup' in filed...
I have a parameter field. Lets say it is CountryName. When I enter a CountryName, it should match that countryname from the database. We can do that with
{Country.CountryName} = {?CountryName} in record selection.
Example, if we give {?CountryName} as USA, then it diplays the rows only with...
I couldnt understand where the error could be.
I get the correct sql statement, when I execute this statement in MySQL, it gives the correct document_id. So there is no mistake in SQL statement.
There are no compilation errors or runtime errors, but I couldnt get correct value in...
I need to join two tables from different databases.
$src->prepare($sql) would execute the sql statement, but my doubt is how to address the tables from different databases in the sql statement.
Thanks.
Hi.. I have a problem passing value from subreport to main report.
I have following code in a formula in a subreport, where I am using
shared variable. I should get #Total Billable Amount value into
total_asr_value. (#Total Billable Amount value is correct and I am
getting it).
if...
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.