Is there a way to close a cmd window when a task is complete and also tell how many are already open?
system( qq{ start "List Perl files" perl c:/perlscripts/new_spider.pl $new_href } )
...
I'm trying to write the following recursive function. The problem is that it never ends and I can't understand why:
sub do_smth(@first, @second){
my @tmp_first = @first;
$tmp = shift(@tmp_first);
if (@tmp_first > 0){
do_smth(@tmp_first, @second);
}
my @tmp_second = @second;
$tmp = shift(@tmp_second)...
I would like to program bsub job limits into my Perl script which launches lsf jobs under the hood. If I have something like 2000 jobs, I would like to run at max 20 jobs at any given time. I would prefer that the jobs running is max 20. I seen scripts where people launch 20 jobs and wait for it to finish before launching another 20.
...
I'm on linux, nfs, with multiple machines involved.
I'm trying to use fcntl to implement filelocking. I was using flock until I discovered it only works between processes on the same machine.
Now when I call fcntl with F_SETLKW, perl alarms (for adding a timeout) don't work as before. This would normally be ok, but ctrl-c doesn't reall...
I am writing a Perl script to test certain parts of my webpage as I make changes to it. Using the WWW::Mechanize class, how can I select a radio box and submit a form?
...
I have this command that I load (example.sh) works well in the unix command line.
However, if I execute it in Perl using the system or ` syntax, it doesn't work.
I am guessing certain settings like environment variables and other external sh files weren't loaded.
Is there an example coding to ensure it will work?
More Updates on codi...
Possible Duplicate:
How can I iterate through nested arrays in Perl?
I am trying to create a 3 - 4 dimensional hash by
for ( $j=0;$j<$#temp_1;$j++)
{
for ( $i=0;$i<$#temp_2;$i++)
{
$var1{$mode}{$temp_1[$j]}{$temp_2[$i]}=$temp_3[$i];
}
}
$mode is predefined. also arrays @temp_1 , @temp_2 and @temp3
If I want ...
While learning Perl I am also learning Linux (Ubuntu), so it is kinda fire-hose sipping time around here.
What is the difference between:
find . -type f | perl -nle '... #aka yada yada'
and
perl -nle '... # same yada yada' `find . -type f`
The first passes the file NAMES to Perl and the second passes the file CONTENTS it seems. ...
I have a simple log file which is very messy and I need it to be neat. The file contains log headers, but they are all jumbled up together. Therefore I need to sort the log files according to the log headers. There are no static number of lines - that means that there is no fixed number of lines for the each header of the text file. And ...
For some reason, using DBI's bind parameter feature for the below AES key is causing a query to fail to find any rows.
use strict;
use warnings;
use DBI;
my $dbh = DBI->connect('dbi:mysql:database=thedb;host=localhost');
my $aes_key = 'X`ku@wC_BI\SgY[S%/<iaB>&VXd5zDA+';
print length($aes_key), "\n";
my $test = $dbh->selectrow_hashref...
I am writing Perl regex code to separate out PL/SQL procedure from the package.
Each procedure starts with the PROCEDURE key word and ends with END, But the END is for BEGIN, IF, or LOOP. There may be many BEGIN|IF|LOOP.
Below is the kind of input, I want to separate each procedure. How can I do this?
PROCEDURE LOG_ECS_MSG( MD_CURR C...
I have to delete a line which contain zero in two columns. How do I do that?
...
I'm using the DateTime Perl module to get the time in a particular timezone. The result of the time is as follows
2010-09-24T02:18:52
How can I convert this to HTTP format before printing?
...
The following code is a test to test what I have already done with my new found knoledge of threads.
#!/usr/bin/perl
use strict;
use warnings;
use threads;
use threads::shared;
use URI;
use URI::http;
use File::Basename;
use DBI;
use HTML::Parser;
use LWP::Simple;
require LWP::UserAgent;
my $ua = LWP::UserAgent->new;
$ua->timeout(10);
$...
Since discovering perlbrew, I'm a happy CPAN user. But what I have never figured out is how to read changelogs of modules. For example, when looking at the outdated ones with "r" in the CPAN shell, I'd like to easily inspect the changelog to decide whether to upgrade or not.
Of course I can download the module, unpack it, and hunt aroun...
I'm using HTML::TokeParser to parse a website for a particular field. The field looks as follows
09/23/10 - 12:14 PM EDT
However, when I print whatever is received, It displays,
2010-09-23 12:14:32.0
Why the inconsistency? Is it recognizing it as a time parameter and converting it to some internal format? If so how can I read...
I have a array of hashes, each hash containing same keys but values are unique. On the basis of particular value, I need to store hash ref.
See the below example to understand it properly:
my @aoaoh = (
{ a => 1, b => 2 },
{ a => 3, b => 4 },
{ a => 101, b => 102 },
{ a => 103, b => 104 }...
Hello everybody i hope everybody is doin well,
Actually i have a table in which i fetch the data from sqlite database,i have done the paging and filtering for the grid using perl,now i need to do the sorting.
The way in which i want to do is "MAKE THE TABLE HEADERS AS HYPERLINK AND WHENEVER I CLICK THEM THEN IT SHOULD SORT THE TABLE IN A...
I have a set of data stored in text files, which I have now via Perl put into a CSV file. The data in question now needs to be displayed in a chart.
What suggestions do you have for doing this? XML was suggested, but XML can't put the data into a chart itself.
Ideally what would happen is: the data would be decoded from the text file, ...
How does the || works in Perl? I want to achieve c style || operation.
@ARRAY=qw(one two THREE four);
$i=0;
if(($ARRAY[2] ne "three")||($ARRAY[2] ne "THREE")) #What's the problem with this
{
print ":::::$ARRAY[2]::::::\n";
}
while(($ARRAY[$i] ne "three")||($ARRAY[$i] ne "THREE")) #This goes to infinite loop
{
pri...