Re: Test automation using perl or shell

2013-09-10 Thread Michael Rasmussen
use warnings; foreach my $test (@ARGV) { system "./$test"; } -- Michael Rasmussen, Portland Oregon Be Appropriate && Follow Your Curiosity Other Adventures: http://www.jamhome.us/ or http://gplus.to/MichaelRpdx A special random fortune co

Re: Filtering Characters

2013-09-03 Thread Michael Rasmussen
int line _ Should be OK line finish with a printing line John's solution Seen line: a good line Seen line: Testing John code Seen line: a #!! should not print line Seen line: _ Should be OK line Seen line: finish with a printing line -- Michael Rasm

Re: Array iterator count

2013-08-10 Thread Michael Rasmussen
nter or was asking if there was an automagic indicator. This example shows one reason why a counter isn't a bad thing. -- Michael Rasmussen, Portland Oregon Be Appropriate && Follow Your Curiosity Other Adventures: http://www.jamhome.us/ or http://gplus.to

Re: Array iterator count

2013-08-10 Thread Michael Rasmussen
a list > my @letters = (a .. z); > foreach my $letter ( a .. z ) { >if ( $letter eq $letters[4] ) { > > but that's sort of silly. And buggy, consider: my @timings ( 11, 22, 3, 14, 18, 45, 18, ... 86 ); -- Michael Rasmussen, Portland Oregon

Re: using join

2013-08-04 Thread Michael Rasmussen
(#lines are commented out) Limit what join acts on by using parenthesis. print '[', join ( '][', @fruits ), ']'; This keeps your closing bracket from being part of the list that join is acting upon. -- Michael Rasmussen, Portland Oregon B

Re: modules

2013-06-03 Thread Michael Rasmussen
what it really is. Generically: use ; # code that calls on the modules functions or OO interfaces as documented. -- Michael Rasmussen, Portland Oregon Be Appropriate && Follow Your Curiosity Other Adventures: http://www.jamhome.us/ or http://gplus.to/

Re: Perl and Web Development

2013-06-03 Thread Michael Rasmussen
ything I've been trying to search for seems dated (2005 and earlier). > >> > >> > I'll second Catalyst. Start simple, and it's pretty easy to learn. > > http://www.catalystframework.org/ And I'll second Dancer, simplier, quicker to learn, plenty power

Re: Scripts in Padre do not run. Need step-by-step help in setting up, asall current procedures I have found have failed for me.

2013-05-26 Thread Michael Rasmussen
which perl' on the command prompt. What does it report? The OP states he's working in a Win7 environment, `which perl` is not available there. -- Michael Rasmussen, Portland Oregon Be Appropriate && Follow Your Curiosity Other Adventures: http://www.jamhome.us/

Re: Next subnet

2013-05-26 Thread Michael Rasmussen
binip : 110010101001 intip : 3232235521 no more mask last_ip : 192.168.0.255 no more prefixlen size : 255 iptype : PRIVATE no more reverse_ip After incrementing past last_ip Can't call method "ip" on an undefined value at ./tpl line 29. michael@bivy:~/rmme$

Re: Any alternative for substr() function

2013-04-12 Thread Michael Rasmussen
I don't believe substr extracting strings is your bottleneck. We really could use some sample data and code to assist. -- Michael Rasmussen, Portland Oregon Be Appropriate && Follow Your Curiosity Other Adventures: http://www.jamhome.us/ or http://gplus.

Re: Help required to extract multiple text fields from a text string

2012-05-27 Thread Michael Rasmussen
On Sun, May 27, 2012 at 07:24:26PM -0700, John W. Krahn wrote: > Michael Rasmussen wrote: >> [ a bunch of blather, snipped here ] > > The regular expression is not splitting! It is capturing. > split removes whitespace. > The regular expression captures non-whitespace. >

Re: Help required to extract multiple text fields from a text string

2012-05-27 Thread Michael Rasmussen
$str .= ' ' x (rand 10 + 1); $str .= ","; # change the /\S+/ to /,/ Rate regex split regex 63021/s-- -8% split 68790/s9%-- Perhaps the lesson is split on whitespace else regex -- Michael Rasmussen, Portland Oregon Other Adve

Re: how to display commands while perl script executing

2012-05-15 Thread Michael Rasmussen
main::(tpl:6): my @file = ; And after that just press to execute each command in turn. As you might imagine you can do other things with the debugger too. -- Michael Rasmussen, Portland Oregon Other Adventures: http://www.j

Re: Template toolkit issue [SOLVED] - mod_perl hosting

2012-05-06 Thread Michael Rasmussen
w if there are any. There are a few, the largest being pair Networks. http://perl.apache.org/help/isps.html -- Michael Rasmussen, Portland Oregon Other Adventures: http://www.jamhome.us/ or http://westy.saunter.us/ Fortune Cookie Fortune du courrier: The best book on progr

Re: Recommended config/ini file module?

2012-05-03 Thread Michael Rasmussen
On 2012-05-01 06:43, Manfred Lotz wrote: On Tue, 1 May 2012 05:57:28 -0700 Michael Rasmussen wrote: On Tue, May 01, 2012 at 11:58:46AM +0200, Manfred Lotz wrote: > Hi there, > What is a recommended Module for processing config resp. inifile > formats? > > One important featu

Re: Recommended config/ini file module?

2012-05-01 Thread Michael Rasmussen
our comments in addition to your previously defined entries. I've found it to be a very easy to use module. -- Michael Rasmussen, Portland Oregon Other Adventures: http://www.jamhome.us/ or http://westy.saunter.us/ Fortune Cookie Fortune du courrier: Dicipline is making the

Re: Problem with unless statement

2012-04-28 Thread Michael Rasmussen
d) and ($mail_field ne '') ) { >>> $host = $mail_field; >>> } >> >> I would use: >> >> my $host = $mail_field ? $mail_field : 'localhost' ; >> >> > > Well, since $mail_field is not likely to be false unless it's undef

Re: PERL CGI, HTML and PHP

2012-04-26 Thread Michael Rasmussen
ay I've come up with is to simply output the report data to > disk as an HTML file and then include that output in a PHP page that is > correctly formatted. Again, you haven't described why Perl can't create the same HTML the PHP does. -- Michael Rasmuss

Re: Merging multiple strings

2012-04-25 Thread Michael Rasmussen
Before Due Date: 06/15/12 0 06/15/12 Clean up and elegence left as an exercise for the reader -- Michael Rasmussen, Portland Oregon Other Adventures: http://www.jamhome.us/ or http:/

Re: Seek string to time module

2012-04-24 Thread Michael Rasmussen
makes sense. You're looking for Date::Calc... wait _time_ Time::Format? Time::Tiny has a from_string function that looks like what you're after. Is that what you're looking for? -- Michael Rasmussen http://www.jamhome.us/ Be Appropriate && Follow Your Curiosit

Re: Net::SMTP

2012-04-24 Thread Michael Rasmussen
gt; going for IO or Sockets.. > I want to make it work. > Please, I need some workable parameters. Help. > And it dies, simply. Don't know what goes on beneath the surface... > > > On Tue, Apr 24, 2012 at 6:26 AM, Michael Rasmussen >wrote: > >> On Tue, Ap

Re: Net::SMTP

2012-04-23 Thread Michael Rasmussen
to know any mailhost's address??? most programs/people ask the DNS system to return the mail host for any given domain. > Its irritating when you fail on the first step. Yes it's irritating. What is your objective? To learn about SMTP and Perl or to just send some mail? If &quo

Re: & and subroutine

2012-04-17 Thread Michael Rasmussen
e entire chapter on subroutines, including the many reasons to prefer () to & is online: http://www.devshed.com/c/a/Perl/Subroutines-in-Perl/ -- Michael Rasmussen, Portland Oregon Other Adventures: http://www.jamhome.us/ or http://westy.saunter.us/ Fortune Cookie F

Re: & and subroutine

2012-04-17 Thread Michael Rasmussen
cution of ./testsub.pl aborted due to compilation errors. Alternatively, and to my sensibilities cleaner: #!/usr/bin/perl use strict; use warnings; sub mysub; # declares it, mysub no longer a bareword mysub();# does it, () not required for Perl parser, but are nice for maintainers

Re: Regex again..

2012-04-14 Thread Michael Rasmussen
. The commentors add more examples. Somu, I believe this is what you've been asking for. On Sat, Apr 14, 2012 at 09:44:59AM -0700, Michael Rasmussen wrote: > On Sat, Apr 14, 2012 at 07:05:54PM +0300, Shlomi Fish wrote: > > Hi Somu, > > > > On Sat, 14 Apr 2012 21:0

Re: Regex again..

2012-04-14 Thread Michael Rasmussen
tarian hair brush to can of paint To a greater or lessor degree you might try to use one for the purpose but it's not the right tool for the job. -- Michael Rasmussen, Portland Oregon Other Adventures: http://www.jamhome.us/ or http://westy.saunter.us/ Fortune Cookie

Re: How Can I find all kinds of methods a Object support?

2012-04-12 Thread Michael Rasmussen
u need to assign the return of Class::Inspector->methods to a scalar and later defererence the reference. You could make these changes: my $methods = Class::Inspector->methods('IO::File', 'full', 'public'); print @$methods; # consider print join $/, @$met

Re: Help parsing tab delimited files

2012-04-08 Thread Michael Rasmussen
ue estoy amando > > Gracias a la vida que me ha dado tanto > Me ha dado la marcha de mis pies cansados > Con ellos anduve ciudades y charcos > Playas y desiertos, montaƱas y llanos > Y la casa tuya, tu calle y tu patio" > > Vioeta Parra - Gracias a la Vida > >