|
|
Up |
|
|
  |
Author: Perl PraPerl Pra
Date: Dec 26, 2008 03:52
Hi All,
I am able to create simaltaneous threads and access a subroutine(which
performs firing of reqeusts). with the created threads.
Some time I get the following error *"Free to wrong pool 225f40 not 13ddbd50
at C:/Perl/lib/constant.pm line -1." .*Whats the reason for the error?
**
Please check the below code and tell me if there is efficient way of
managing the created threads.
Basically i want the following:
Releasing the thread once it has completed the taks and release the
memory associated with it.
I want to pass thread_id to subroutine(the value of $thr->tid);
#######SNIP
use strict;
use warnings;
use Threads;
sub perform
{
my($tid)=
|
| |
|
| |
1 Comment |
|
  |
Author: Perl PraPerl Pra
Date: Dec 26, 2008 01:30
hi All,
I need to get current time in milliseconds.
Any pointers would be highly appreciated
thanks,
siva
|
| |
|
| |
no comments
|
|
  |
Author: Sharan BasappaSharan Basappa
Date: Dec 25, 2008 05:45
Hi Jenda, Rob, Shawn,
I am attaching a sample flowchart figure.
Step1 and Step2 are the process steps and D1 and D2 are the decisions.
Will this code translate to the foll in perl?
do
{
do
{
step1
} while (D1)
step2
} while (D2)
What if D2 traces back to Step2 instead? How would the code change?
Regards
|
| |
|
1 Comment |
|
  |
Author: Chas. OwensChas. Owens
Date: Dec 25, 2008 03:18
On Wed, Dec 24, 2008 at 22:09, Collaborate yahoo.com> wrote:
> On Dec 23, 3:34 pm, nore...@gunnar.cc (Gunnar Hjalmarsson) wrote:
>> Collaborate wrote:
>>> I am wondering if there is a way to copy a webpage to a text file
>>> using Perl.
>
> Thanks for your input. This is a really simple code to grab the html
> code and works great. Is there also a way to grab the text shown on
> the webpage rather than the html code? For example, the text on pages
> that are javascript (such as Yahoo Finance stock quotes) do not show
> on the html code. I would like to be able to copy the text even it is ...
|
| Show full article (2.44Kb) |
|
no comments
|
|
  |
Author: RichardRichard
Date: Dec 24, 2008 18:49
what's wrong w/ this ?
I used (dot) . to indicate the maximum length of each element in the
print but last one does not print out in alinged format..
What am i missing?
use warnings;
use strict;
my $yabal = 'truncated';
my $never = 'sai';
my $noway = 'han1';
my %%never = qw(hi how are you today fine i am good and everyday12345678
never123456899999);
printf "%%-.5s %%-15s %%-.2s\n", $yabal, $never, $noway;
for (keys %%never) {
printf "%%.2s %%.10s\n", $_, $never{$_};
}
|
| Show full article (0.60Kb) |
|
1 Comment |
|
  |
Author: Charlie FarinellaCharlie Farinella
Date: Dec 24, 2008 10:16
I need to read in a file of 200 lines and print each out to a separate
file.
I've been stumbling with this, but I don't know how to name each outfile
individually. I was hoping to see 200 files named tx1 - tx200, but
instead I get tx1234..................... for 123 files and then it dies.
Help?
==
#!/usr/bin/perl
use strict;
use warnings;
my $i = 0;
my $outfile = "tx";
open( INFILE, "speed_test.csv" );
|
| Show full article (0.86Kb) |
|
1 Comment |
|
  |
Author: Mr. Shawn H. CoreyMr. Shawn H. Corey
Date: Dec 24, 2008 08:50
On Wed, 2008-12-24 at 21:42 +0530, Amit Saxena wrote:
> However when I try to execute it even with the proper text, I get the
> different output than anticipated.
>
I'm not surprised that the results are not what you expected. Capture
variables, $1, $2, $3, ... are globals and cannot be used in recursion.
I am surprised by exactly what was returned; it is not what I expected.
IMHO, recursion in regular expressions (RE) is a Bad Idea.
First, it makes the RE more difficult to understand. Second, they don't
always work right.
I would keep my REs simple and use Perl code to implement what is
needed. The demon Murphy is still out to get coders and KISS is the
most effective means to deal with him.
--
Just my 0.00000002 million dollars worth,
Shawn
Believe in the Gods but row away from the rocks.
-- ancient Hindu proverb
|
| |
|
no comments
|
|
  |
Author: Sanket VaidyaSanket Vaidya
Date: Sep 23, 2008 02:07
Hi Anjan,
Not able to get where your "column" is. I am Assuming your column is
in Text file. However even if it is not in text file, then also this may
provide you a fair hint about how to proceed further.
use warnings;
use strict;
open FH,"example.txt" or die "Cannot open file: $!"; #(example.txt is file
containing your column)
undef $/;
my $text = ;
$text=~s/[^AGTC]//g; #remove anything which is not A,G,T or C
print "$text"; # $text will contain your required output
Let me know if this helps.
Thanks
Sanket Vaidya
|
| Show full article (2.29Kb) |
|
no comments
|
|
  |
Author: Aa AaAa Aa
Date: Sep 22, 2008 21:52
Hi everyone, I get an string from an filename, and then create an mysql table using that filename. Since the rule is different, eg, a file name AA3bb.cc is ok but it can't used as a mysql table's name. So that I will modify that file name to AA3bb-cc. That means if any character in the filename !~ /[0-9a-zA-Z\-\_]/, then replace that character to hyphen "\-". Could anyone hlep me to code an perl regular expression to "replace that character to hyphen \-":if ($filename !~ /[0-9a-zA-Z\-\_]/){replace that character to hyphen "\-"}
Thanks
Bairu
_________________________________________________________________
Win a Hotmail Go-Kart to race at Bathurst. Enter today!
http://www.livelife.ninemsn.com.au/compIntro.aspx?compId=4602
|
| |
|
no comments
|
|
  |
|
|
  |
Author: Anjan PurkayasthaAnjan Purkayastha
Date: Sep 22, 2008 18:21
here is my problem:
i have to check the entries of a column and write them out to a file if they
happen to be DNA sequences ie they are exclusively composed of the letters
A, T, G, C- no spaces or digits.
the column also happens to have other strings that are made of
word/digit/space characters.
i tried
if($x=~ /[ATGC]/ )then .....
however this pattern matching expression is unable to filter out the non-DNA
sequences.
i have also tried other expressions too convoluted to write out here.
any ideas?
tia,
anjan
|
| Show full article (0.75Kb) |
|
3 Comments |
|
|
|
|