I have a running LWP::UserAgent that should be applied on following URL:
http://dms-schule.bildung.hessen.de/suchen/suche_schul_db.html?show_school=5503
This runs with many many similar targets see the following endings:
html?show_school=5503
html?show_school=9002
html?show_school=5512
I want to do this with use LWP::UserAgent:
fo...
When I try this:
$a = 1;
$b = 2;
print ($a && $b) . "\n";
The result is 2. Why?
...
I have an controller that has actions that are set up using chained. My chained root action is in my root controller, then my 'section' controller has a 'root' action chained from the root controller's 'root' action. I then have endpoint actions in the 'section' controller class that chain from the 'root' action in the same class:
pack...
I want to install File::Fetch, which is a core module in Perl 5.12, in my Perl 5.8.9. In general, I want to compile and install future-dated modules in my back-dated Perl because I cannot upgrade my Perl.
So I downloaded the module and also its dependencies. It's quite painful following the dependency tree but I'm more concerned about ...
Web frameworks such as Rails and Django has built-in support for "slugs" which are used to generate readable and SEO-friendly URLs:
Slugs in Rails
Slugs in Django
A slug string typically contains only of the characters a-z, 0-9 and - and can hence be written without URL-escaping (think "foo%20bar").
I'm looking for a Perl slug funct...
I need to make running multiple Perl scripts as easy as possible, and make all of their statuses easily known, to see if they are all still working.
I'm thinking of having a single Perl script which runs and monitors the other scripts I have, and displays the data on a 'master' command prompt. Is this possible? Is there an easier way to...
I use MooseX::Storage for serialization of Moose objects. Can I use it for serialization of multiple Moose objects to the same file, or more specifically, an array or a hash of Moose objects?
I guess I can define another Moose objects ('array_of_myobj') but this isn't very elegant.
So, how would you recommend to serialize an array (or ...
I am working on a Perl script where it checks for root access, at the beginning of execution.
if ($< != 0) {
print "You need to be root";
die " ";
}
How is the $< evaluated in Windows? I searched google and here, but could not find an answer.
The closest I got was in perlvar. It has some descriptions of special variable handling...
Hi,
I have two data structures with a mix of hashes and arrays. How can I compare the two data structures and return their differences, something like perl's Test::Harness module, but I don't want to actually run a unit test. ...or is there a way to tun Test::Harness without actually running a unit test?
...
I need to ensure that this LOAD query succeeded. How do I know inside my program it did not fail?
sub loaddata{
my ($name) = @_;
my $DBH = init_dbh( );
my $STH_GO = $DBH->prepare(q{
LOAD DATA LOCAL INFILE '?' INTO TABLE authors FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\r...
Hi, I have a timestamp that looks like 25-OCT-10 04.11.00.000000 AM. I'm trying to convert this to a time format with
Time::Piece->strptime("25-OCT-10 04.11.00.000000 AM","%d-%b-%y %I.%M.%S.%6N %p")
but it keeps throwing errors. I've tried %OS, %SZ. They dont seem to work. Can someone tell me what I'm doing wrong?
...
I have installed DBD::Pg version 2.17.1 but still still getting error while using below code
$res = $conn->prepare($query);
$res = $res->execute();
@tuple = $res->fetchrow_array;
error:
Can't call method "fetchrow_array" without a package or object reference at test.pl line 69.
Please suggest.
...
I'm using Sybase::CTlib to query a Sybase server. However when I execute the following:
while( $dbr->ct_results($restype) == CS_SUCCEED ) {
if( $restype == CS_CMD_FAIL ) {
warn "Update Check Failed...";
next;
}
next unless $dbr->ct_fetchable($restype);
$ts = $dbr->ct_fetch;
}
My query returns exactly one value....
Am I missing anything, or does JSON lacks a write_to_file() and read_from_file() subroutines?
Obviously, I can easily implement them, but as they seem so handy I wonder how can it be they are not there.
...
I'm using perl with the Net::Telnet module.
My problem is while sending a command that has an output of 1000 rows, the "wait_for" looks for a string in the middle.
The wait_for stops but the buffer is still keeps storing the command's output.
the problem is with the next command that I send - I'm getting the rest of the first command'...
I had a look at the source of Slurp and I would love to understand how does slurp() work:
sub slurp {
local( $/, @ARGV ) = ( wantarray ? $/ : undef, @_ );
return <ARGV>;
}
Where is the file even opened?
...
I'm trying to remove a specific character from a string in Perl:
my $string="MATTHATBAT";
substr($string, 2, 1, '');
EDIT: This does work, sorry. Leaving this here in case someone needs to know how to do this.
Also, is there a more efficient way of doing this?
The string should now be MATHATBAT.
Am I missing something? I know tha...
Is it possible to build a Perl wrapper around the GNOME terminal which would help me to pass commands to it and also capture the ouputs on the terminal?
...
If my gz file does not exist, why doesn't it DIE?
$ cat test.pl
open(FILE, "zcat dummy.gz |") or die "DIE";
$ ./test.pl
zcat: dummy.gz: No such file or directory
If I read a file normally, it works as expected:
$ cat test2.pl
open(FILE, "dummy.gz") or die "DIE";
$ ./test2.pl
DIE at ./test.pl line 2.
...
print <<EOF
stuff
EOF
;
print <<EOF;
stuff
EOF
Why would you use one over the other?
...