Here is the table in which I am retrieving the data from an SQLite database.
Its having lots of records, so near that ADD button I need something like
|< < > >| which would do the paging function whenever I click.
Also, besides the table each header (e.g. UserName UserId) I need a sorting
button. Something like a ^ button. Please do h...
I am facing a problem in my code. Whenever I try to insert
a text field then it's giving an error. What's wrong in the syntax here?
print '<table>';
print "<tr style='background-color:#CDC9C9;'>
<td><A HREF=\"http://localhost/cgi-bin/AddUser.cgi\">ADD</A></td>
<td></td>
<td><b>UserId</b></td>
<td><input type="text" ...
Suppose I have a piece of Perl code like:
foreach my $x (@x) {
foreach my $y (@z) {
foreach my $z (@z) {
if (something()) {
// I want to break free!
}
// do stuff
}
// do stuff
}
// do stuff
}
If something() is true, I would like to break ('last') all the loops.
how can I do that?
I thought of two options, bot...
I would like a command line function that I can run on any file to change the include("myinc.inc"); PHP statement to include 'myfile.inc'; I have made a start by adding the following to my ~/.bashrc file:
function makestandard() {
perl -p -i -e 's/include\("([\w\.]+)"\)/include '$1'/g' $*
}
I source ~/.bashrc; and run the command ...
I'm using WWW::Mechanize to retrieve a form from a webpage:
#!/usr/bin/perl
use WWW::Mechanize;
my $mechanize = WWW::Mechanize->new();
$mechanize->proxy(['http', 'ftp'], 'http://proxy/');
$mechanize->get("http://www.temp.com/");
$mechanize->form_id('signin');
The website HTML has code as follows
<form action="https://www.temp.co...
I have a reference to an array $arr_ref. I would like to get a reference to an array containing only cells i..j in the original array.
...
I've written Perl code using WWW::Mechanize to retrieve a webpage. When I retrieve http webpages it works fine but it doesnt work for https. I've checked and I have the Crypt::SSLeay package. What else could be wrong?
The error message is..
Error GETing https://www.temp.com: Can't Connect to www.temp.com:443 <Bad hostname 'www.temp.com...
I'm building a count matrix in Perl using AoA: my @aoa = () then call $aoa[$i][$j]++ whenever I need to increment a specific cell. Since some cells are not incremented at all, they are left undef (these are equivalent to 0 counts).
I would like to print some lines from the matrix, but I get errors for undef cells (which I would simply l...
Hello all,
I try to execute a simple perl script on my server and I get an internal 500 server and when I check the error logs it shows:
Premature end of script headers: test.pl
Here is the perl script:
#!/usr/bin/perl -w
print "Content-type: text/plain\n\n";
print "testing...\n";
My cgi-bin folder has permissions of 0755. The scri...
I'm trying to set up MovableType 4.34 using a Postgres database, and I'm getting the following (unhelpful) error message:
Connection error: authentication method 7 not supported
The database server doesn't support SSL connections, so I suspect that's to blame -- but I can't be sure (what is "authentication method 7" ?), and at any rat...
Is there any way I could optimize the following script to run faster?
foreach my $arg (@data){ #
@score=();
`program $arg $arg1 > $result`; #!!! $arg1 is a very large file with lots of data!!!
open(FH,$result);
while(<FH>){
chomp;
if($_ =~ /\d+.+\s+(\d+\.\d+|\d+\.|\.\d+).+/){ #here i'm looking for any number su...
I was noticing some curious behavior with Perl's split command, particularly in cases when I would expect the resulting array to contain empty strings '', but it actually doesn't.
For example, if I have a delimiter(s) at the end (or the beginning) of the string , the resulting array does not have an empty string(s) '' as the last (or fi...
I've always used printf, and I've never used write/format. Is there any way to reproduce printf("%12.5e", $num) using a format? I'm having trouble digesting the perlform documentation, but I don't see a straightforward way of doing this.
EDIT: based on the answers I got, I'm just gonna keep on using printf.
...
I got a text file of this kind
INFO [main] (porter.java:100) - Added record 7147 read from file: 1484301
INFO [main] (porter.java:100) - Added record 7148 read from file: 1484302
INFO [main] (porter.java:100) - Added record 17147 read from file: 1484303
INFO [main] (porter.java:100) - Added record 76148 read from...
Hi,
My perl code is as follows
#!/usr/bin/perl
use strict;
use warnings;
use WWW::Mechanize;
use Crypt::SSLeay;
# proxy
$ENV{HTTPS_PROXY}='http://proxy:8080/';
# debugging (SSL diagnostics)
$ENV{HTTPS_DEBUG} = 1;
my $mechanize = WWW::Mechanize->new(noproxy => 0);
$mechanize->proxy(['http', 'https'], 'http://proxy:8080/');
$mechaniz...
I'm trying to debug a problem on a remote user's site. We've narrowed it down to a problem with formatted output in Perl. The user swears up and down that
perl -e 'printf "Number: %lG\n", 0.1'
prints
Number: %lG
not
Number: 0.1
The user reports that their Perl is version 5.8. The oldest version I have around is 5.8.1, and it se...
I'm trying to use WWW::Mechanize with a proxy server, but seems like I cant get it to work.
Since Mechanize is a subclass of LWP::UserAgent, I've been reading about the proxy thing over
link text
I have a list of proxies, for example:
74.87.151.157:8000
69.171.152.25:3128
190.253.82.253:8080
189.11.196.221:3128
41.234.205.201:808...
I have lines of code with two large arrays (so can't just write it into a hash) which I want to connect with a hash.
For example, $array1[0] becomes the key and $array2[0] becomes the value and so on to $array1[150],$array2[150].
Any ideas how I do this?
...
I have a large hash and have a subset of keys that I want to extract the values for, without having to iterate over the hash looking for each key (as I think that will take too long).
I was wondering if I can use grep to grab a file with a subset of keys? For example, something along the lines of:
my @value = grep { defined $hash{$_}{...
Hi all,
I am looking for a testing file for my Sentence Splitter Application, and i hope the file can cover as many cases as possible.
Thanks!
...