Re: Data structure key as a literal string

2006-04-06 Thread Ryan Gies
Now I'm confused, what's the difference between a Perl interrupter and a Perl interpreter? Or, what perldoc is that info in? Thanks Mr. Shawn H. Corey wrote: On Thu, 2006-06-04 at 13:10 -0700, Ryan Gies wrote: With the intention of optimization, I am looking for a way around us

Data structure key as a literal string

2006-04-06 Thread Ryan Gies
With the intention of optimization, I am looking for a way around using *eval* in the below snippet at line 19: my $value = eval $key; The objective is to get from $key to $value, knowing that $key is a literal string. Thank you for an insights! #!/usr/bin/perl -w use strict; use Data:

Re: perl script help

2006-04-04 Thread Ryan Gies
Your file should be at: C:/per/lib/Mail/Sendmail.pm Uh, make that: C:/perl/lib/Mail/Sendmail.pm -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: perl script help

2006-04-04 Thread Ryan Gies
If you have sendmail.pm (with a lower-case 's') it surely isn't the same thing as Sendmail.pm (with an upper-case 'S'). The MS Windows PATH environment variable is much different than Perl's @INC. Fortunately for you, your @INC includes C:/perl/lib. Your file should be at: C:/per/lib/Mail/Se

Re: how to rewind file?

2006-03-09 Thread Ryan Gies
See the function seek (given a file handle) seek($handle,0,0); [EMAIL PROTECTED] wrote: > After I use <> operator on s file handle, I need read it from head again. I > found these is no rewind function, must I close it and open again? > > > --- > Li

Re: extract words from an array

2006-03-05 Thread Ryan Gies
Scott Ulmen wrote: There must be a better (read shorter) way to do what I did. foreach $singleline (@lines) { my @stuff = $singleline =~ /\b\w*[^aeiou\s]{4}\w*\b/ig; @stuff and print "matched: ", join( ',', @stuff ), "\n"; } The regular expression: /\b\w*[^aeiou\s]{4}\w*\b/ig 1.

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

printing the contents of the last eval

2006-02-22 Thread Ryan Gies
Inpecting $@ and caller() after an eval will yield: Error message (eval 6750):428 How does one view line 428. Are there formal hooks with which (immediately following an eval) one can: my $eval_number = ???; my $eval_contents = ???( $eval_number ); The debugger seems to do a g

Re: Repeated Regex over a line with double quotes

2006-02-21 Thread Ryan Gies
Yet another way to do it*: while () { chomp; # extract fields my @fields = split /"?,"|"?,(?=\d)/; # print the fields separated with * print join '*', @fields; print "\n"; } *Presumimg that fields which are *not* enclosed in quotes will begin with a digit. *Note