Re: [Boston.pm] finding more mongers

2016-02-25 Thread Kripa Sundar
On Thu, Feb 25, 2016 at 4:14 PM, Uri Guttman wrote: > how about scheduling some meetings on a different day of the week? [...] > why not rotate between mon-wed each month or something similar? I second Uri's suggestion. peace, -- Kripa

[Boston.pm] Perl regex question

2012-10-25 Thread Kripa Sundar
Folks, I need help to reset my brain, w.r.t. an apparently-straightforward regex. I am sure I am missing something obvious here. I keep thinking that the regex below ought to get me all the words on a line except the backslash. Instead I am only getting the final word. (In my code, I threw out

Re: [Boston.pm] Perl regex question

2012-10-25 Thread Kripa Sundar
Thanks to all who replied so promptly. Duane's explanation captured it best for me. From: Duane Bronson Subject: Re: [Boston.pm] Perl regex question Date: Thu, Oct 25, 2012 at 06:31:01PM -0400 m// returns an array of ($1,$2,$3...), but your word (\w\S*) is always $1 even though it's hit

[Boston.pm] Q: giant-but-simple regex efficiency

2011-02-04 Thread Kripa Sundar
Hi folks, Problem: I have a 900 Meg text file, containing random text. I also have a list of 6000 names (alphanumeric strings) that occur in the random text. I need to tag a prefix on to each occurrence of each of these 6000 names. My premise: I believe a regex would give the simplest and most

Re: [Boston.pm] YAPC::NA 2011

2010-03-25 Thread Kripa Sundar
Hi all, From: Jerrad Pierce If funding would help someone devote time to proposal logisitics, I'd like to reiterate a previous proposal: that people chip in a few bucks to that end. [...] I'll be glad to contribute money to facilitate anyone's efforts towards bringing YAPC to Boston.

Re: [Boston.pm] Larry's Harvard and MIT talks

2009-03-26 Thread Kripa Sundar
Hi all, Does anyone know whether the Harvard (3/31) and MIT (4/1) talks on the same topic, or two different talks? peace, || Basketball star with fifteen-dollar shoes: --{kr.pA} || http://www.dailygood.org/more.php?n=2543 -- Warning: gratuitous use of gratuitous in current

Re: [Boston.pm] exit(expr) versus exit expr

2007-06-19 Thread Kripa Sundar
Dear Ronald and Uri, Thanks for your prompt replies. After reading your replies, I realised that Uri's summary (that named unary operators are of higher precedence than ? :) is echoed by the Named Unary Operators section of perldoc perlop. Thanks for the -MO=Deparse,-p example, Ronald.

[Boston.pm] glob() bug?

2007-02-22 Thread Kripa Sundar
Hi all, Is this a glob() bug, or am I overlooking something obvious? perldoc -f glob didn't help. TIA. The .[0-9]*[0-9] is globbed correctly when it is not inside braces. % touch a ab abcd a.777 % % perl -le \ 'print for glob(a{,b,b*d,.[0-9]*[0-9]}), ---, glob(a.[0-9]*[0-9])' a ab

Re: [Boston.pm] glob() bug?

2007-02-22 Thread Kripa Sundar
It looks to me like a bug. Thanks for confirming my experience, Ben. I was getting tired of re-reading and re-typing my command lines to rule out stupid typo's. Incidentally, perl v5.8.3 shows the same buggy behaviour on solaris as well as linux. peace, || Ben Cohen tells us

Re: [Boston.pm] Calendar Reminder

2006-12-04 Thread Kripa Sundar
http://perladvent.pm.org and http://advent.pm.org are available, http://www.perladvent.org still is not. Thanks for the prompt fix, Jerrad! peace, || Akanksha: Not your average after-school program: --{kr.pA} || http://tinyurl.com/49ghs -- If it's theoretically

Re: [Boston.pm] How do I wait for all child processes to terminate?

2006-03-31 Thread Kripa Sundar
Dear Ben, Thanks for the detailed reply to my query. If my questions below can be answered by online docs, please feel free to point me to them. I read through the following docs before my previous email. But I am still mostly in the dark: * man -s 2 for fork(), wait(), waitpid() and kill() *

[Boston.pm] How do I wait for all child processes to terminate?

2006-03-30 Thread Kripa Sundar
Hello all, I thought this was fairly simple (and it probably is). But I am not able to figure out how I can fork() off, say, five child processes, and wait for all of them to terminate. Is the code below on the right track? Is it as simple as wait for [EMAIL PROTECTED]? I think this will let

[Boston.pm] IPC insight [was: daemonizing a perl script]

2006-02-21 Thread Kripa Sundar
While talking to my son he pointed out that tailing xferlog would be a problem when the log is being rotated. [...] Wow, so child processes can communicate useful information back to parent processes after all! :-) peace, || No Coke at University of Michigan: --{kr.pA}

Re: [Boston.pm] Perl style regex in shell command for matching across lines?

2005-10-19 Thread Kripa Sundar
Dear Ranga, I tried grep and egrep - they seem to match only one line at a time. I am unable to match for \n inside the pattern. What shell utility would do it? I dont want to bring in the perl interpreter just for this! Please *do*! If the perl invocation is your performance

Re: [Boston.pm] Perl style regex in shell command for matching across lines?

2005-10-19 Thread Kripa Sundar
Dear Ranga, Two clarifications on my previous email. I wrote: If the perl invocation is your performance bottleneck, that is a pleasant problem to deal with. What I meant to write is this: If the overhead of invoking perl is your performance bottleneck, that is a pleasant problem to deal

Re: [Boston.pm] script to normalize output of Windows dir command

2005-09-23 Thread Kripa Sundar
Dear Steve, Also date and time are combined into three fields, but the third is either time or year. This makes it harder to process. I would actually prefer time in seconds since the start of the Unix eon. IMHO, File::Find and stat() should solve your problems. The following is a starting

Re: [Boston.pm] yapc::boston?

2005-08-26 Thread Kripa Sundar
Dear Uri and others, I spoke to lesley.edu . Their largest theatre has 189 seats only. The lady who helped me could not offer any other suggestions. So I guess Lesley is out. To make further enquiries, we (those of us who are volunteers/followers) need to know the following information at

Re: [Boston.pm] yapc::boston?

2005-08-25 Thread Kripa Sundar
Dear Uri, so an easy thing to do is to search the local college sites for similar pages and see what is out there. then call someone and get some more info. this is something anyone (even kripa! :) can do. in fact can someone call the lesley contact on that page and see if they have larger

Re: [Boston.pm] Trying to learn about the problems with eval()

2005-08-17 Thread Kripa Sundar
Dear Ben, Tim and others, I've been learning a lot from this entire thread. Thanks to all the responders. Tim writes: [...] [W]e can indeed add another item to Kripa's list: * context confusion eval() executes in the context in which it's called, not the context in which the

Re: [Boston.pm] Trying to learn about the problems with eval()

2005-08-17 Thread Kripa Sundar
i just want to reiterate my view on string eval (and symrefs). they are powerful tools that are needed to solve a certain class of problems. they rarely are the best solution [...] so my rule again (and kripa, tell your cow-orker this one) is: you should not use string eval (or symrefs)

Re: [Boston.pm] Trying to learn about the problems with eval()

2005-08-15 Thread Kripa Sundar
Dear Uri, Thanks to you and the others for your prompt responses. another bad point about eval is that it can access and modify lexicals and globals anywhere in the code. so that can lead to action at a distance and very hard to find bugs. I don't quite follow. Globals are anyway

Re: [Boston.pm] Trying to learn about the problems with eval()

2005-08-15 Thread Kripa Sundar
Dear Tom, You seem to be blending the concepts of eval and system. Sorry about the confusing presentation there. My friend had actually written something like: --\/BEGIN-\/-- $string = system(\cat $somefile | mail -s \\\$something\\\

Re: [Boston.pm] Trying to learn about the problems with eval()

2005-08-15 Thread Kripa Sundar
Which of course should really be written as: system(mail -s '$something' '$audience' $somefile); Yes, of course. It is one of the classic useless uses of cat(1). I had meant to write this also to my friend, but forgot in my indignation over six backslashes. :-) peace,

Re: [Boston.pm] Trying to learn about the problems with eval()

2005-08-15 Thread Kripa Sundar
Dear Ben, another bad point about eval is that it can access and modify lexicals and globals anywhere in the code. so that can lead to action at a distance and very hard to find bugs. [...] I'm not sure if this is what is referred to, but it applies. If this is dynamic code where

Re: [Boston.pm] more syntax checking

2005-07-18 Thread Kripa Sundar
Dear Uri, [...] subs can come into existance any time and be handled by AUTOLOAD and such. so there is no easy compile time way to check that at the moment. [...] A sub can, of course, be defined at run-time and then used. But this is not the point. It is the same principle as for any other

Re: [Boston.pm] Using a regex to match smart quotes within an RSS feed

2005-07-15 Thread Kripa Sundar
Dear Chris, $xml =~ s/chr(145)/'/g; $xml =~ s/chr(146)/'/g; $xml =~ s/chr(147)//g; $xml =~ s/chr(148)//g; Would this work for you? --\/BEGIN-\/-- warn WARNING: UNTESTED CODE; my %map = ( chr(145) = q.'., chr(146) = q.'.,

Re: [Boston.pm] Perl RE: first occurrence of a pattern?

2005-05-13 Thread Kripa Sundar
Dear Nilanjan, Yup! Thanks, Thanks to Larry and friends for inventing non-greedy quantification. :-) peace, || Udayachal: a newspaper edited by slum children: --{kr.pA}|| http://tinyurl.com/57jaf -- This .sig intentionally left blank.

Re: [Boston.pm] Perl RE: first occurrence of a pattern?

2005-05-12 Thread Kripa Sundar
Dear Nilanjan, If I used a RE like the following: $dir =~ m,^(.*)/($fruits)/,; I get a greedy match, upto including the last occurrence. Is there a RE to get the path up to the first occurrence of any one of the alternatives? Doesn't non-greedy quantification solve your problem? $dir

Re: [Boston.pm] Quick question(s) about strict subs

2005-05-04 Thread Kripa Sundar
Hello all, I had asked: Command 5: Why is - bogus not treated as a unary minus operation on a bareword? Why does it get stringified and squeezed into -bogus? (See Command 7.) perldoc perlop says that this is the intended behaviour: || Unary - performs arithmetic negation if the operand

[Boston.pm] regex in RHS of s/// spotted

2005-03-03 Thread Kripa Sundar
Hi all, An unnamed White House source today stated that regexes are beginning to infiltrate the RHS of substitutions, and thus threaten our national security. This was corroborated by the following sighting: s/Perl/(Bike Riding|Gardening|Cooking|Painting|Teaching|Filmmaking)/; :-) :-) for the

Re: [Boston.pm] regex in RHS of s/// spotted

2005-03-03 Thread Kripa Sundar
s/Perl/(Bike Riding|Gardening|Cooking|Painting|Teaching|Filmmaking)/; Oddly enough, the the syntactically correct code does not quite have the same meaning or elegance. ... \begin{nitpick} The s/// is already syntactically correct. :-) \end{nitpick} ... Note that I modified the list

Re: [Boston.pm] Can I do a chgrp() without invoking a child process?

2004-11-23 Thread Kripa Sundar
Then use chown(): chown LIST Changes the owner (and group) of a list of files. [...] Thanks, Brian and Ron. That was fast! peace, || Uttaranchal: Electricity from 7th century water mills: --{kr.pA} || http://tinyurl.com/yufep -- What difference does

Re: [Boston.pm] Re: Code generation

2004-10-06 Thread Kripa Sundar
Dear Gyepi, As it turns out, I have also implemented 'atomic' operations on groups of files solely in perl. In this case, each undoable action stores an undo coderef in a global array after the 'do' action has completed. [...] I'd love to learn more. Of course, but I assume we are all

Re: [Boston.pm] Re: Code generation

2004-10-05 Thread Kripa Sundar
Dear Gyepi, #!/bin/sh type=$1 if [ $type eq do ]; then groupadd bar useradd foo ... gpasswd -a foo bar ... elif [ $type eq undo ]; then userdel foo groupdel bar ... fi Thanks for the example. This is certainly an interesting technique. But

Re: [Boston.pm] Guess what is wrong with this logic

2004-09-11 Thread Kripa Sundar
Dear Uri, from perlop: A (file)glob evaluates its (embedded) argument only when it is starting a new list. All values must be read before it will start over. [...] i call that documented :) I am forced to agree. :-) KS If I want to grok ~someone/some/stuff, glob()

Re: [Boston.pm] Guess what is wrong with this logic

2004-09-10 Thread Kripa Sundar
20: warn blah blah\n if (glob(~$arg) !~ m{^ (/\w+)+ /$arg $}x); globIn list context, returns a (possibly empty) list of filename expansions on the value of EXPR such as the standard Unix shell /bin/csh would do. In scalar context, glob iterates

Re: [Boston.pm] Guess what is wrong with this logic

2004-09-10 Thread Kripa Sundar
Anyway, you should probably be using getpwnam() rather than glob() to check for valid usernames. Thanks, Ronald. I'll do that. (But the glob bug is still a bug, IMHO.) peace, || Operation Shoe Fly: Send your shoes to Afghan children: --{kr.pA} || http://tinyurl.com/6jnpf --

Re: [Boston.pm] a car talk puzzle

2004-09-08 Thread Kripa Sundar
Dear Chris, The word I have written here is [...] masculine, and ends in s. Not only that, but you change this word from plural to singular and from masculine to feminine, all by adding an s to it! [...] If the word in question is in /usr/share/dict/words, then it should be one

Re: [Boston.pm] a car talk puzzle

2004-09-08 Thread Kripa Sundar
Dear Chris, I wrote: || % perl -wMstrict -lne 'use vars qq.%x.; (my $y = $_) =~ s/ss$/s/; \ || print if $x{$y}; $x{$_}++;' /usr/dict/words || ass || buss || canvass || discuss || Douglass || hiss || % [...] The Lingua::EN::Inflect approach would obviously not

Re: [Boston.pm] Trouble debugging a simple parse error

2004-08-24 Thread Kripa Sundar
As this doc excerpt (from map on perlfunc) says it should: { starts both hash references and blocks, so map { ... could be either the start of map BLOCK LIST or map EXPR, LIST. Because perl doesn't look ahead for the closing } it has to

[Boston.pm] Trouble debugging a simple parse error

2004-08-23 Thread Kripa Sundar
Hello all, I am clearly overlooking something basic, but I can't wrap my head around the parse error in the second command below. It is apparently caused when the the only contents of a map() BLOCK is a list without parens. || % perl -le 'print map {1; 1, 2} qw(a b)' || 1212 || % || %

Re: [Boston.pm] Tech Meeting w/ Damian Conway, Tuesday, July 13

2004-07-01 Thread Kripa Sundar
... send your RSVPs now, so we can arrange for a larger room if necessary. Yes. I'll plan on bringing my laptop. How big of a laptop is it? [...] :-) Proportional to the size of the lap, I imagine. peace, || Avoiding dimpled chads in Rajasthan: --{kr.pA}

Re: [Boston.pm] Tech Meeting w/ Damian Conway, Tuesday, July 13

2004-07-01 Thread Kripa Sundar
KAG Pay no attention to the man hiding behind the laptop. why are you going to bring it anyway? damian uses his own ibook. I see you are paying no attention, as advised. :-) He needs it to hide behind. :-) peace, || Avoiding dimpled chads in Rajasthan: --{kr.pA}

Re: [Boston.pm] regex - how to match the last CR+LF

2004-06-22 Thread Kripa Sundar
Dear Bill, Or, my favorite, chop while /\s$/; ### Omit all trailing whitespace, ### including whole blank lines at the end ### and last CRLF or NL or whatever is holy IMHO s/\s*$// is faster for the author's brain, the

Re: [Boston.pm] Variable used only once warning

2004-06-07 Thread Kripa Sundar
Dear Mike, To use a variable means to have it on the RHS, usually. LHS only counts as defining it. In computer science, yes. In perl (surprise!) no. --\/BEGIN-\/-- % perl -lwe '$x = hi;' Name main::x used only once: possible typo at -e

Re: [Boston.pm] Variable used only once warning

2004-06-07 Thread Kripa Sundar
Dear Chris, If you define a variable use it only once, the compiler will complain. No, it won't. At least not the perl compiler. For perl, an assignment (== definition) is also a use. =begin repeated_example --\/BEGIN-\/-- % perl -lwe

[Boston.pm] Which T-station for tomorrow's meeting?

2004-04-26 Thread Kripa Sundar
Hello all, Ronald writes: = Boston.pm will have a tech meeting on Tuesday, April 27, at Boston = University, Kenmore Classroom Building, 565 Commonwealth Ave, room 106 = (directions below). [...] = Directions, courtesy of Sean: = [...] = If you're taking the T, exit on the same side as the

Re: [Boston.pm] Which T-station for tomorrow's meeting?

2004-04-26 Thread Kripa Sundar
Thanks, Kenneth and Sean. peace, || House calls: hope in Koinpur, Orissa: --{kr.pA} || http://tinyurl.com/x8l3 -- Quiquid latine dictum sit altum viditur. ___ Boston-pm mailing list [EMAIL PROTECTED]

Re: [Boston.pm] why no warning about this infinite loop

2004-01-28 Thread Kripa Sundar
Ronald writes: = As you say, it is hard to detect infinite loops. :) No, it is straightforward to detect *any* infinite loop. But it does take infinite time to detect it. ;-) peace, || Project Why in Delhi's Giri Nagar slums: --{kr.pA} ||

Re: [Boston.pm] Re: the XPath replace() function and regex patterns like s/^.../. ../g

2003-11-11 Thread Kripa Sundar
Dear Steve, = One clarification. The suggested workaround was not to just = start the regex with a ^ but to start it with ^.* Longest left-most match means that anchoring with ^.* will replace the *last* occurrence of the LHS, instead of the first occurrence. In addition, the .* in the s/// is

[Boston.pm] Bringing YAPC to Boston

2003-06-06 Thread Kripa Sundar
Hi all, I emailed Dan Sugalski about bringing YAPC to Boston. Here is part of his reply: = [...] Now that the perl foundation's finally = gotten itself sorted out we should be in a position to take = applications for next year's YAPC and make decisions soon. Pop a note = to the boston.pm