Re: Using regex special characters from a string

2011-03-08 Thread Ben Lavery
Hi Jim, thanks for replying :) >> >> $word_list{$_} = 0; > > If you assign 1 to the hash value, you can dispense with the 'exists' in > your test, below. >> #Here, using a hash looks much cleaner than iterating through an array >> push(@all_combinations, $temp_word) if (exists $word_list{$temp_w

Re: Using regex special characters from a string

2011-03-08 Thread Jim Gibson
On 3/8/11 Tue Mar 8, 2011 2:51 PM, "Ben Lavery" scribbled: > Here is my code, I've taken out a few irrelevant bits, but this is the main > guts: > use warnings; > use strict; > use Math::Combinatorics; > > #Set up a hash for searching later > my %word_list; > > #Read list of valid words into

Re: multidimensional array check

2011-03-08 Thread John W. Krahn
vito pascali wrote: Ok ppl, after some hard work (for me at least!!) that's what I got: #!/usr/bin/perl -w use strict; use warnings; use DBI; use DBD::mysql; use warnings; my ( $db_gal,$db_gal2,$db_lab,$tbl_ary_ref_g1,$tbl_ary_ref_g2,$tbl_ary_ref_l1 ); You should declare your variables in the

Re: Using regex special characters from a string

2011-03-08 Thread Uri Guttman
> "BL" == Ben Lavery writes: BL> use warnings; BL> use strict; good! BL> use Math::Combinatorics; BL> #Read list of valid words into hash BL> my $WORDFILE='Words'; BL> open(WORDFILE, "$WORDFILE") or die "can't open $WORDFILE: $!"; BL> while () { BL> chomp; BL> $word_l

Re: Using regex special characters from a string

2011-03-08 Thread Ben Lavery
Hi Rob, Thank you for your response, sorry it wasn't as clear as I thought it might have been. > I have a script, and I want to feed it a special thing to let it know that > any character (A-Z or a-z does upper lower case matter?) is valid, but I > also want to use other characters at the same t

Re: Using regex special characters from a string

2011-03-08 Thread Rob Coops
Hi Ben, Not sure I get your point... but this is what it sounds like to me. I have a script, and I want to feed it a special thing to let it know that any character (A-Z or a-z does upper lower case matter?) is valid, but I also want to use other characters at the same time. So ./script.pl -s ABC

Using regex special characters from a string

2011-03-08 Thread Ben Lavery
Hi all, I have a script which takes a string of alphabetic characters as an argument, generates all combinations of the characters and all permutations of the combinations, then looks up each result in a list of valid words, if the result is a valid word it gets stored in an array. I would like

Re: Cumulative/recursive tagged diff/file evolution?

2011-03-08 Thread Rob Dixon
On 07/03/2011 20:56, Jay Savage wrote: 2011/3/7 Rob Dixon: But your job is first to describe the problem accurately, then to construct an algorithm that would solve it, and finally to code it up in your chosen programming language. If that language is Perl then this list should be able to help.

Re: multidimensional array check

2011-03-08 Thread vito pascali
Ok ppl, after some hard work (for me at least!!) that's what I got: #!/usr/bin/perl -w use strict; use warnings; use DBI; use DBD::mysql; use warnings; my ( $db_gal,$db_gal2,$db_lab,$tbl_ary_ref_g1,$tbl_ary_ref_g2,$tbl_ary_ref_l1 ); ###

Re: Regular expression to delete from a string unseen characters

2011-03-08 Thread Dr.Ruud
On 2011-03-06 17:22, Shlomit Afgin wrote: I have a data that contain unseen characters that I want to delete. The unseen characters can be ^L, ^N and other sign that I cannot copy but I see them in my data. Is someone know which regular can help me. See perldoc perlre, specifically [:cntrl

Re: Cumulative/recursive tagged diff/file evolution?

2011-03-08 Thread Dr.Ruud
On 2011-03-07 19:24, Jay Savage wrote: I'm working on a project to to track changes to text files over time. Start with git, and build on that? -- Ruud -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/