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
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
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
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
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
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; #
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?
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+)/,
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
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;
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)){
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:
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
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
14 matches
Mail list logo