Re: File::Find module won't run recursively?

2006-03-02 Thread Tom Phoenix
On 3/2/06, Timothy Driscoll <[EMAIL PROTECTED]> wrote: > sub get_all_files :Export(:DEFAULT) > { > my ($cwd, $ext, @list_of_files); > $ext = shift; > $cwd = shift; > $ext = 0 unless defined $ext; > $cwd = `pwd` unless defined $cwd; > chomp $cwd; > >

File::Find module won't run recursively?

2006-03-02 Thread Timothy Driscoll
hi, I am using the File::Find module to scan a dir tree, pulling out files that have a specific extension. in a separate package, I wrote a sub called get_all_files: sub get_all_files :Export(:DEFAULT) { my ($cwd, $ext, @list_of_files); $ext = shift; $cwd = shift;

Re: Adding ID numbers to names

2006-03-02 Thread Chas Owens
What you need is Regexp::List (http://search.cpan.org/dist/Regexp-Optimizer/lib/Regexp/List.pm). It will take a list of strings and produce an optimal regex to find those strings. You can then use a hash in the replacement to map to the right key. For example, the list Chas Owens, John Smith, Jo

Re: Taint compliant mail checker

2006-03-02 Thread JupiterHost.Net
Tom Allison wrote: I was interested in using Mail::CheckUser in a CGI script. I've liked it in the past for other applications that weren't exposed like a CGI script. However I just found out that the module is not compatable with the Taint pragma. Since I'm relatively new to writing CGI s

Taint compliant mail checker

2006-03-02 Thread Tom Allison
I was interested in using Mail::CheckUser in a CGI script. I've liked it in the past for other applications that weren't exposed like a CGI script. However I just found out that the module is not compatable with the Taint pragma. Since I'm relatively new to writing CGI scripts and am devoutly

Re: Filter Quotes

2006-03-02 Thread Chas Owens
On 3/2/06, maillists <[EMAIL PROTECTED]> wrote: > Hi, > > I'm trying to filter quotes out of a web form and replace them with > " > > $Values->{text_field} =~ s/"/"/; > return; > > However, This does not seem to work. Is this right? > Also, I would like to replace the single quote ' > > Tha

Filter Quotes

2006-03-02 Thread maillists
Hi, I'm trying to filter quotes out of a web form and replace them with " $Values->{text_field} =~ s/"/"/; return; However, This does not seem to work. Is this right? Also, I would like to replace the single quote ' Thanks Rick -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additi

Re: Adding ID numbers to names

2006-03-02 Thread Ash Varma
On 3/3/06, Ryan Gies <[EMAIL PROTECTED]> wrote: > > Ash Varma wrote: > > > > Any hint on the J Smith and J Smith Thomas ?? > > > > Hmm, good point. I'm sure there are several methods, but the first > which comes to mind is to do two replacements... > > a. sort you list by the length(), processing

Re: Adding ID numbers to names

2006-03-02 Thread Ryan Gies
Ash Varma wrote: Any hint on the J Smith and J Smith Thomas ?? Hmm, good point. I'm sure there are several methods, but the first which comes to mind is to do two replacements... a. sort you list by the length(), processing longer names first b. 1st replacement replaces the all names with

Re: Adding ID numbers to names

2006-03-02 Thread Ash Varma
On 3/3/06, Ryan Gies <[EMAIL PROTECTED]> wrote: > > > for ($i=0;$i<=$#id;$i++) { > > $randomtext =~ s/$name[$i]/$name[$i] $id[$i]/g > > } > > Putting the word-break identifiers around your search text will prevent > "J Smithers" from getting replaced when the $i for "J Smith" comes around. > >

Re: Adding ID numbers to names

2006-03-02 Thread Ryan Gies
for ($i=0;$i<=$#id;$i++) { $randomtext =~ s/$name[$i]/$name[$i] $id[$i]/g } Putting the word-break identifiers around your search text will prevent "J Smithers" from getting replaced when the $i for "J Smith" comes around. $randomtext =~ s/\b$name[$i]\b/$name[$i] $id[$i]/g -- To unsu

Re: Adding ID numbers to names

2006-03-02 Thread Ash Varma
On 3/3/06, Wagner, David --- Senior Programmer Analyst --- WGO < [EMAIL PROTECTED]> wrote: > > Ash Varma wrote: > > Hi.. > > > > I have 2 files of data.. > > > > File 1 = id,name > > > > eg: > > > > 0001, J Smith > > 0002, J Smithers > > 0003 J Smith Thomas > > > > > > File 2 = general text, with n

RE: Adding ID numbers to names

2006-03-02 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Ash Varma wrote: > Hi.. > > I have 2 files of data.. > > File 1 = id,name > > eg: > > 0001, J Smith > 0002, J Smithers > 0003 J Smith Thomas > > > File 2 = general text, with names recorded at different locations.. > > eg. > > This is random text for with J Smith, J Smithers and J Smith Tho

Adding ID numbers to names

2006-03-02 Thread Ash Varma
Hi.. I have 2 files of data.. File 1 = id,name eg: 0001, J Smith 0002, J Smithers 0003 J Smith Thomas File 2 = general text, with names recorded at different locations.. eg. This is random text for with J Smith, J Smithers and J Smith Thomas I am trying to replace all J Smiths with J Smith

Re: Expect script to install sshkey

2006-03-02 Thread Wiggins d'Anconia
Ramprasad A Padmanabhan wrote: > Hi all, >I have a perl Expect script that install rsa keys for ssh auto login. > When I run the script on command line it works fine. > Now when I run it inside a CGI the script simply gets stuck. I can see > from the from the SSH server and also the expect log

Expect script to install sshkey

2006-03-02 Thread Ramprasad A Padmanabhan
Hi all, I have a perl Expect script that install rsa keys for ssh auto login. When I run the script on command line it works fine. Now when I run it inside a CGI the script simply gets stuck. I can see from the from the SSH server and also the expect logs that the login is happenning. But Af

Re: Retrieve lsit of computers using net::ldap

2006-03-02 Thread Tom Phoenix
On 3/2/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Can anyone point out how use the ldap search object to get a list of > computers in an OU? The Net::LDAP FAQ has some example code, and links to other resources. Does anything there help you? http://search.cpan.org/~gbarr/perl-ldap-0.

Re: Fast way to find neighboring strings ( wth Hamming Distance)

2006-03-02 Thread Chas Owens
On 3/2/06, Edward WIJAYA <[EMAIL PROTECTED]> wrote: snip > $str = 'TTTCGG'; # (length 6) > $str_amb = '[TA]TTCGG'; # Ambiguous (length 6) > $d = 2; snip I haven't read you question or code too closely, but given your choice of test data I assume you are working with DNA. You may wish to loo

Re: problems matching strings within variables.

2006-03-02 Thread Chas Owens
On 3/2/06, Angus <[EMAIL PROTECTED]> wrote: snip > In my code below I tried to split the variable > $dhcp{$hostname}->{ip} into 4 separate octets but that failed, I then tried > to match the last 1 to 3 characters in $dhcp{$hostname}->{ip} but that also > failed. Can anyone tell me how I might do

Retrieve lsit of computers using net::ldap

2006-03-02 Thread perl
Hi, I'm trying to retrieve a list of computer names using net::ldap, but my script returns no values. It's my first time working with the protocol, so I can't figure out why it doesn't work. I checked the docs several times, but the ldap filter usage is still not clear. Can anyone point out h

Fast way to find neighboring strings ( wth Hamming Distance)

2006-03-02 Thread Edward WIJAYA
Hi all, Suppose I have a string ($str) and also the number of maximum mismatch position is given ($d). The string may come in two types first is normal string the other is ambiguous. $str = 'TTTCGG'; # (length 6) $str_amb = '[TA]TTCGG'; # Ambiguous (length 6) $d = 2; What I intend t

Encoding Trouble

2006-03-02 Thread Laurent Coudeur
Hi I am trying to use the encoding options for open Like so use strict; use Encode qw/encode decode/; open(OFILE,'<:encoding(UTF-16)', $source) or die "cant open file $source\n"; open (OOUT,'>:encoding(UTF-8)',"$source.out") or die "cant create file $source.out\n"; my @fh = ; print OOUT @

Re: problems matching strings within variables.

2006-03-02 Thread John W. Krahn
Angus wrote: > Hello all, Hello, > I have found a very useful little module for parsing DHCP logs and in the > following script I have been able to create a hash of hashes based on the > data extracted from a dhcp log. However, my problem now is that I want to > determine what subnet a host is o

Re: How to implement Sudoku Solver/Generator by using Perl

2006-03-02 Thread Gavin Henry
> Hi, > > Is this possible to build "application" which solves Sudokus puzzles and > also generates these ? I quess that I'm not only person on this planet who > is thinging this question ;) See this quarters The Perl Review: www.theperlreview.com > > - hannhirv - > > > -- > To unsubscribe, e-m

How to implement Sudoku Solver/Generator by using Perl

2006-03-02 Thread Hannu Hirvonen
Hi, Is this possible to build "application" which solves Sudokus puzzles and also generates these ? I quess that I'm not only person on this planet who is thinging this question ;) - hannhirv - -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: problems parsing a DHCP.leases file.

2006-03-02 Thread John W. Krahn
[ Please do not top-post. Please remove any quoted text that is not relevant to your post. ] Angus wrote: > From: Hans Meier (John Doe) >> >> Here is a way to process one lease { } >> after another, with the possibility to extract every field you want. >> >> I think it is easy to read, unders

problems matching strings within variables.

2006-03-02 Thread Angus
Hello all, I have found a very useful little module for parsing DHCP logs and in the following script I have been able to create a hash of hashes based on the data extracted from a dhcp log. However, my problem now is that I want to determine what subnet a host is on. For the moment I will on

RE: problems parsing a DHCP.leases file.

2006-03-02 Thread Angus
Hans, This script works really well but, I am a bit confused on what you are doing with this: local $/="}\n"; I have not seen local used much as I thought it was replaced by "my". It almost looks like you are defining the end of each lease entry with a closing curly brace and a new line. Does t