I am trying to update a script I wrote to automate
g++. Here is an excerpt:
#!/bin/perl -w
use strict;
my $number_of_args = @ARGV;
open STDERR, ">./caught_errors" or die "Can't create
caught_errors: $!";
if ($number_of_args == 0)
{
print "Not enough arguments!\n";
}
foreach (my $i = 0; $i < $number_of_args; $i++)
{
print "g++ $ARGV[i] \n";
}
When I run the script like so:
./script blah
I get the following error message:
Argument "i" isn't numeric in array element at
./cedit01 line 61.
g++ blah
"g++ blah" is proper result that I am looking for.
However, I don't understand the statement above it.
What does that mean?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>