Re: Hi everyone, who can tell me how to extract five texts on each side of an URI? Thanks

2006-11-08 Thread Bjørge Solli
On Thursday 09 November 2006 01:33, 辉 王 wrote: > Hello, everyone, > > Recently, when I want to implement Chakrabarti's algorithm > > using Perl, I found it difficult for me to extract five texts on > > each side of an URL. > > I can make my program do its job at last, but it runs slowly. > > Can

Re: Trying to understand this forking open stuff...

2006-11-08 Thread Jeff Pang
>Thanks Jay and Tom! I added this little bit to my script: > >select (CHILD); >$| = 1; >select (STDOUT); > >and it worked just as I expected it to. It's interesting, though, >that I've been working with sockets a bunch through IO::Socket and my >print statements seem to print to the socket strea

Re: Hi everyone, who can tell me how to extract five texts on each side of an URI? Thanks

2006-11-08 Thread Jeff Pang
> > Recently, when I want to implement Chakrabarti's algorithm > >using Perl, I found it difficult for me to extract five texts on > >each side of an URL. > > No one can give helps unless he also know this special algorithm. -- Books below translated by me to Chinese. Practical mod_per

Re: Round to mult. of 5?

2006-11-08 Thread C . R .
In article <31086b240611080714m228f0808hfb07ccff550f33d6 @mail.gmail.com>, [EMAIL PROTECTED] says... > 1. Divide by five. > 2. Round to the nearest integer. > 3. Multiply by five. > 4. Profit! Now that's very clear, with no obscure Perlese code. Thanks! -- To unsubscribe, e-mail: [EMAIL

Re: Re: Trying to understand this forking open stuff...

2006-11-08 Thread Jay Savage
On 11/8/06, Jen Spinney <[EMAIL PROTECTED]> wrote: Thanks Jay and Tom! I added this little bit to my script: select (CHILD); $| = 1; select (STDOUT); and it worked just as I expected it to. It's interesting, though, that I've been working with sockets a bunch through IO::Socket and my print

Re: Trying to understand this forking open stuff...

2006-11-08 Thread Jen Spinney
On 11/8/06, Jay Savage <[EMAIL PROTECTED]> wrote: There are a couple of things going on here. First, the issue of what prints when is driven by buffering. Since you haven't turned on autofulsh on any of your file handles, the buffer is flushed whenever it's convenient for the the system. The res

Hi everyone, who can tell me how to extract five texts on each side of an URI? Thanks

2006-11-08 Thread 辉 王
Hello, everyone, Recently, when I want to implement Chakrabarti's algorithm using Perl, I found it difficult for me to extract five texts on each side of an URL. I can make my program do its job at last, but it runs slowly. Can anybody tell me how to improve the running speed of

Re: Trying to understand this forking open stuff...

2006-11-08 Thread Tom Phoenix
On 11/8/06, Jen Spinney <[EMAIL PROTECTED]> wrote: print CHILD "printing to child\n"; sleep 5; Concurrent processes can be counterintuitive at times. Because the CHILD filehandle is buffered, that line won't necessarily be sent to the child process right away. In your program, I'd expe

Re: Trying to understand this forking open stuff...

2006-11-08 Thread Jay Savage
On 11/8/06, Jen Spinney <[EMAIL PROTECTED]> wrote: use strict; use warnings; print "First Trial:\n\n"; if (open(CHILD, "|-")) { print "parent starts: ", (scalar localtime),"\n"; sleep 5; print "parent ends: ", (scalar localtime),"\n"; } else { print "child starts: ", (scalar l

Re: Trying to understand this forking open stuff...

2006-11-08 Thread Jen Spinney
On 11/8/06, John W. Krahn <[EMAIL PROTECTED]> wrote: Jen Spinney wrote: > Hello all! Hello, > print "\nSecond Trial:\n\n"; > > if (open(CHILD, "|-")) > { >print "parent starts: ", (scalar localtime),"\n"; >print CHILD "printing to child\n"; >sleep 5; >print "parent ends: ", (sca

Re: Trying to understand this forking open stuff...

2006-11-08 Thread John W. Krahn
Jen Spinney wrote: > Hello all! Hello, > print "\nSecond Trial:\n\n"; > > if (open(CHILD, "|-")) > { >print "parent starts: ", (scalar localtime),"\n"; >print CHILD "printing to child\n"; >sleep 5; >print "parent ends: ", (scalar localtime),"\n"; > } > else > { >my $time = sc

Trying to understand this forking open stuff...

2006-11-08 Thread Jen Spinney
Hello all! I've come to a point where I really need to start understanding forking, threaded, select, and all that stuff. I created a test script to play around with and it's doing what I'd expect, except for one bit. My test script: use strict; use warnings; print "First Trial:\n\n"; if (op

Re: Round to mult. of 5?

2006-11-08 Thread Tom Phoenix
On 11/7/06, C. R. <[EMAIL PROTECTED]> wrote: Does anyone have a routine that will round an integer to a multiple of 5? 1. Divide by five. 2. Round to the nearest integer. 3. Multiply by five. 4. Profit! Hope this helps! --Tom Phoenix Stonehenge Perl Training -- To unsubscribe, e-mail: [

Re: code issue

2006-11-08 Thread Tom Phoenix
On 11/8/06, Tim Wolak <[EMAIL PROTECTED]> wrote: $grp = "E\$"; if ( substr($_, 69,2) =~ /($grp)/) { Despite appearances, the string from the first statement doesn't contain a backslash. (Maybe you wanted to use qr// instead of double quotes? Or you could write the st

Re: Round to mult. of 5?

2006-11-08 Thread JupiterHost.Net
C.R. wrote: Does anyone have a routine that will round an integer to a multiple of 5? Didn't find anything on CPAN? Odd... A search for "Round" -> http://search.cpan.org/search?query=Round&mode=all Yeilded Math::Round, nearest() looks promising. For example: if number ends in 0 or 5, no rou

code issue

2006-11-08 Thread Tim Wolak
All, I have been working on this script to extract information based on group selection, being E0, GE, E5. This works fine however I am testing the selection to see if E$ is entered and it so escape the $ in the process. Am I missing something because it never finds E$ in any of the files I'm par

Re: Round to mult. of 5?

2006-11-08 Thread Rob Dixon
C.R. wrote: Does anyone have a routine that will round an integer to a multiple of 5? For example: if number ends in 0 or 5, no rounding is done. If number ends in 1,2 the ones place rounds down to 0. If number ends in 3,4 the ones place rounds up to 5. If number ends in 6,7 the ones place r

Re: Round to mult. of 5?

2006-11-08 Thread John W. Krahn
C.R. wrote: > Does anyone have a routine that will round an integer to a multiple of > 5? > > For example: if number ends in 0 or 5, no rounding is done. > If number ends in 1,2 the ones place rounds down to 0. > If number ends in 3,4 the ones place rounds up to 5. > If number ends in 6,7 the

Re: Best book to update XML via Perl?

2006-11-08 Thread C . R .
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] says... > Hi, I have Perl 5.6.0 on Solaris, and on DOS. We have an XML document > that has many prices in it that need to be changed. They are keyed by > part number, and each part has a price grade, each grade has a price. > > I know there are

Round to mult. of 5?

2006-11-08 Thread C . R .
Does anyone have a routine that will round an integer to a multiple of 5? For example: if number ends in 0 or 5, no rounding is done. If number ends in 1,2 the ones place rounds down to 0. If number ends in 3,4 the ones place rounds up to 5. If number ends in 6,7 the ones place rounds down to