[Boston.pm] Off topic: C question

2006-03-11 Thread Greg London
Off topic. Please reply offlist to email at greglondon dot com Sorry, but I need to get this working by Monday morning, and I'm out of people to ask. I need to write a function in C that wraps printf, passing printf all the parameters that got passed into the wrapper. In perl, it would look

[Boston.pm] Off topic: C question

2006-03-11 Thread Bob Rogers
From: Greg London [EMAIL PROTECTED] Date: Sat, 11 Mar 2006 11:04:29 -0500 (EST) Sorry, but I need to get this working by Monday morning, and I'm out of people to ask. I need to write a function in C that wraps printf, passing printf all the parameters that got passed into the

Re: [Boston.pm] Off topic: C question

2006-03-11 Thread Federico Lucifredi
Greg, google for Varargs, and you will have your answer :) If memory serves me right, the Gnu C library manual (which you should own, but is available in postscript at gnu.org) has a nice chapter on them. best -f On Sat, 2006-03-11 at 11:04 -0500, Greg London wrote: Off topic. Please

[Boston.pm] Regex warning

2006-03-11 Thread Joel Gwynn
I know I've done this before, but I'm not sure what I'm doing differently today. I'm trying to capture a simple command-line option like so: my $debug = 0; if(grep(/--debug=(\d+)/, @ARGV)){ $debug = $1; print debug: $debug\n; # Error here } But I keep getting Use of uninitialized value

Re: [Boston.pm] Regex warning

2006-03-11 Thread Bill Ricker
But I keep getting Use of uninitialized value in concatenation (.) or string when I try to do something with the debug variable. How can $1 not be initialized? If it's matching, then it should have a value, no? Possibly the reason the $1 isn't available might be related to it's an if-grep

Re: [Boston.pm] Regex warning

2006-03-11 Thread Ben Tilly
On 3/11/06, Joel Gwynn [EMAIL PROTECTED] wrote: I know I've done this before, but I'm not sure what I'm doing differently today. I'm trying to capture a simple command-line option like so: my $debug = 0; if(grep(/--debug=(\d+)/, @ARGV)){ $debug = $1; print debug: $debug\n; #

Re: [Boston.pm] Regex warning

2006-03-11 Thread Chris Ball
On Sat, 11 Mar 2006 17:20:35, Joel Gwynn [EMAIL PROTECTED] said: But I keep getting Use of uninitialized value in concatenation (.) or string when I try to do something with the debug variable. How can $1 not be initialized? If it's matching, then it should have a value, no?

Re: [Boston.pm] Regex warning

2006-03-11 Thread Ben Tilly
On 3/11/06, Ben Tilly [EMAIL PROTECTED] wrote: On 3/11/06, Joel Gwynn [EMAIL PROTECTED] wrote: I know I've done this before, but I'm not sure what I'm doing differently today. I'm trying to capture a simple command-line option like so: my $debug = 0; if(grep(/--debug=(\d+)/,

Re: [Boston.pm] Regex warning

2006-03-11 Thread Joel Gwynn
Correcting myself, I don't think it is a bug. $1 is dynamically scoped. In your construct above, that means that when grep ends, $1 is cleaned up. while(grep(/--debug=(\d+)/, @ARGV)){ $debug = $1; print debug: $debug\n; last; } And I think this works because the inner

Re: [Boston.pm] Regex warning

2006-03-11 Thread Ben Tilly
On 3/11/06, Joel Gwynn [EMAIL PROTECTED] wrote: Correcting myself, I don't think it is a bug. $1 is dynamically scoped. In your construct above, that means that when grep ends, $1 is cleaned up. while(grep(/--debug=(\d+)/, @ARGV)){ $debug = $1; print debug: $debug\n;

Re: [Boston.pm] Regex warning

2006-03-11 Thread Joel Gwynn
On 3/11/06, Ben Tilly [EMAIL PROTECTED] wrote: On 3/11/06, Joel Gwynn [EMAIL PROTECTED] wrote: Correcting myself, I don't think it is a bug. $1 is dynamically scoped. In your construct above, that means that when grep ends, $1 is cleaned up. while(grep(/--debug=(\d+)/, @ARGV)){

Re: [Boston.pm] Regex warning

2006-03-11 Thread Uri Guttman
JG == Joel Gwynn [EMAIL PROTECTED] writes: JG I know I've done this before, but I'm not sure what I'm doing JG differently today. I'm trying to capture a simple command-line JG option like so: JG my $debug = 0; JG if(grep(/--debug=(\d+)/, @ARGV)){ JG $debug = $1; JG print debug:

[Boston.pm] meeting announcements

2006-03-11 Thread Uri Guttman
i was just reading use.perl.org and i keep seeing meeting announcements for several other pm's. maybe someone other than ronald to post our announcements to use.perl? i bet we will reach some perl hackers around here who don't know we have regular meetings. i dunno if there are any other sites

[Boston.pm] bad tutes

2006-03-11 Thread Uri Guttman
on irc (#perl/efnet) i regularly find newbies who for some reason find some perl tutorial on the net. the problem is that they are invariably poor to bad. a small fraction are even decent and very few are accurate and good. i have seen so many of these sites and some are worthy of spreading