Re: Using regex special characters from a string

2011-03-09 Thread Ben Lavery
> there must be a slight trade-off... the processing required to initialize the > hash table with it's keys and values is probably more intensive than defining > an array with its respective values? Unless, internally, Perl stores arrays > as hashes, with the indexes as the keys. I would have

Re: Using regex special characters from a string

2011-03-09 Thread Ben Lavery
On 9 Mar 2011, at 03:01, Ben Lavery wrote: > I shall change from a hash to an array and use grep, or looking into it I may > use List::MoreUtils as it has a "first_value" sub which should make it > somewhat more efficient. OK, so about an hour after I wrote this I wa

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 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

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: need to include and install CPAN modules as part of application stack

2011-01-27 Thread Ben Lavery
Personally, I'd like to see a way of executing a perl script/application in such a way that Perl runs off and grabs any required modules from CPAN (if the user has permission, of course). Ben On 27 Jan 2011, at 21:05, Mark Meyer wrote: > Hello all, > > > > > > I need to include CPAN modu

Re: Extracting properties from objects.

2011-01-24 Thread Ben Lavery
Hi Sean, In your given example, $l becomes a link object, so you go: $l->url(); to get the URL, for example. After using your code below, look at this page: http://search.cpan.org/~petdance/WWW-Mechanize-1.66/lib/WWW/Mechanize/Link.pm That will show you how to use $l. Hope that helps, Ben On 2