anagrams (was: Re: Regex question.)

2008-07-05 Thread Dr.Ruud
Gunwant Singh schreef: > I have a query regarding regexes. No, you don't. > I am to match only one specific word in a wordlist which has only > those alphabets which it contains and none other than that. To do that, you can use regexes, but you don't need to. > My Wordlist contains: > > alph

Re: anagrams

2008-07-05 Thread Dr.Ruud
"Dr.Ruud" schreef: > $sorted = join "", sort split "", lc($word); This one is better: $sorted = join "", sort split //, lc($word); The parentheses around $word are (also) not necessary. -- Affijn, Ruud "Gewoon is een tijger." -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addit

Re: How to remove [], {}, and other characters, rendering numeric values in a CSV file ?

2008-07-05 Thread Rob Dixon
[EMAIL PROTECTED] wrote: > > I have discovered that the number between square brackets [] won't be > only a one-digit number, but now it can contain an un-foreseen number > of digits, because the number inside the square brackets will grow > from 1 to several millions > > As I have just stated, w

Re: Removing lines from start of tag to end of tag in XML's

2008-07-05 Thread Rob Dixon
vigneshwara balaji wrote: > > Thank you for that input. I was also enable to successfully complete the > same with the below script. (its a mix up from various scripts :D) You must always use strict; use warnings; at the start of your code, and declare all variables with 'my'. That way a lot

Re: Removing lines from start of tag to end of tag in XML's

2008-07-05 Thread Rob Dixon
Rob Dixon wrote: > > Meanwhile, how about a simpler solution like mine below, which I think is much > more readable. > > HTH, > > Rob > > > > > use strict; > use warnings; > > my $source = ''; > my $new = '.new'; > > open my $in, '<', $source or die $!; > open my $out, '>', $new or

Re: Integer data type

2008-07-05 Thread howa
On 7月5日, 上午4時56分, [EMAIL PROTECTED] (Rob Dixon) wrote: > A Perl scalar value (including array and hash elements) can have more than one > type simultaneously. Why do you think you need to know what type of value is > being held? > > Rob hello, can you show an example of "more than one type simu

Re: Removing lines from start of tag to end of tag in XML's

2008-07-05 Thread vigneshwara balaji
Hi Rob, Thank you for that input. I was also enable to successfully complete the same with the below script. (its a mix up from various scripts :D) $file1 =""; # input file $file2=".new"; my $flag=0; #output file open(INFO,"$file1"); # Open the first file open(OUT,">$file2");

Re: Integer data type

2008-07-05 Thread John W. Krahn
howa wrote: On 7$B7n(B5$BF|(B, $B>e8a(B4$B;~(B56$BJ,(B, [EMAIL PROTECTED] (Rob Dixon) wrote: A Perl scalar value (including array and hash elements) can have more than one type simultaneously. Why do you think you need to know what type of value is being held? can you show an exampl

Re: isolating text in a string

2008-07-05 Thread John W. Krahn
Perl WANNABE wrote: * John W. Krahn <[EMAIL PROTECTED]> [2008-06-27 11:28]: Tim Bowden wrote: On Tue, 2008-06-24 at 19:37 -0700, John W. Krahn wrote: Perhaps: my ( $snippet ) = $string =~ /\w\["([^"]+)",/; $string =~ /\w\["([^"]+)",/; my $snippet = $1; does the trick. I can see If I

Re: isolating text in a string

2008-07-05 Thread Perl WANNABE
* John W. Krahn <[EMAIL PROTECTED]> [2008-06-27 11:28]: > Tim Bowden wrote: >> On Tue, 2008-06-24 at 19:37 -0700, John W. Krahn wrote: >>> >>> Perhaps: >>> >>> my ( $snippet ) = $string =~ /\w\["([^"]+)",/; >> >> $string =~ /\w\["([^"]+)",/; >> my $snippet = $1; >> >> does the trick. I can see If

Re: Optimize the script

2008-07-05 Thread matt
On Jul 4, 4:08 am, [EMAIL PROTECTED] (Jet Speed) wrote: > Hi All, > > I put togather a piece of code with some help, to capture the output as > below from a file "cxout1" as below. I am sure this can be written in few > lines or even differnt way of getting the same out put with use of hash etc. >

Re: Integer data type

2008-07-05 Thread Rob Dixon
howa wrote: > On 7月5日, 上午4時56分, [EMAIL PROTECTED] (Rob Dixon) wrote: >> A Perl scalar value (including array and hash elements) can have more than >> one >> type simultaneously. Why do you think you need to know what type of value is >> being held? >> >> Rob > > hello, > > can you show an exampl

Re: Debug Help Please

2008-07-05 Thread John W. Krahn
Andy wrote: Greets Hello, Thanks for your earlier help, but I am still stuck. I took your advice and I believe I put together the script as you said. Except that you apparently haven't yet enabled the warnings and strict pragmas in your program to help you find your mistakes. I decid

how to change string to scalar

2008-07-05 Thread loody
Dear all: I try to update the end of my file index by 1 per day. ex: file_0 --> file_1 file_10 --> file_11 I know I can do some stupid things as writing 10 elseifs to determine right now value and write back it after adding 1. But is there some faster way to do so? Like some default