Why Am I Getting a Compile Error?

Why Am I Getting a Compile Error?

Post by Jeff Westm » Fri, 28 Mar 2003 03:35:41



This doesn't make sense to me:


line 129:  $ordCnt = trim($result[16]);

sub trim($) {
    my $arg = shift;
    chomp($arg);
    $arg =~ s/^\s+//;
    $arg =~ s/\s+$//;
    return $arg;

Quote:}    

$ perl -c conv.pl
syntax error at conv.pl line 129, near "result["
conv.pl had compilation errors.

"trim" works fine if I pass it a quoted literal such as '"  25  "'.  Why
won't it work with an element reference?!

-Jeff

__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com