Why am I getting an error with @_ ? 
Author Message
 Why am I getting an error with @_ ?

        Hi all.
        This may seem like a really dumb question, but to me it's not (I'm
still just learning Perl).

get says this:

syntax error at database.pl line 78, near "sub drop_table_1"

        The piece of code I am using looks a little like this...

sub drop_table_1{

        ....
        A LOT MORE CODING HERE
        ....

Quote:
} #end subroutine drop_table_1

Anyone have any ideas what I am doing wrong by trying to pass in this
parameter?
        Thanks.
                                                Bryan H


me any problems then and I didn't think that it should now....



Thu, 28 Sep 2000 03:00:00 GMT  
 Why am I getting an error with @_ ?

Quote:


> get says this:

> syntax error at database.pl line 78, near "sub drop_table_1"

>    The piece of code I am using looks a little like this...

"a little like this"? It helps to show the actual code that causes the

declared as a my() variable - not allowed. The code you posted didn't
_look_ as if that was happening, though. Maybe you've got a syntax error
that has confused the parser.

If you still can't find the problem, cut your code down to (say) a dozen
or so lines that you can post here. Good luck!

--
Tom Phoenix       Perl Training and Hacking       Esperanto
Randal Schwartz Case:     http://www.rahul.net/jeffrey/ovs/



Thu, 28 Sep 2000 03:00:00 GMT  
 Why am I getting an error with @_ ?


:       Hi all.
:       This may seem like a really dumb question, but to me it's not (I'm
:       still just learning Perl).

:       get says this:

: syntax error at database.pl line 78, near "sub drop_table_1"

I re-enter your code like this:

#!/usr/bin/perl -w

use strict;

&drop_table_1('testing...');

sub drop_table_1
 {

   print $table_tablename;
 }

and it worked fine. From the error message, I would guess it's some
sort of packaging issue, but it could be something as simple as a
missing semicolon to a switch of parenthesis and braces in the code
above the subroutine.

You might want to try the -w switch and use strict. In addition,
use diagnostics will give you more wordy error messages that are
occasionally more meaningful.

-- Tom Mornini
-- InfoMania



Thu, 28 Sep 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Why am I getting an undefined subroutine error?

2. Why am I getting this regexp error?

3. FAQ 4.1: Why am I getting long decimals (eg, 19.9499999999999) instead of the numbers I should be getting (eg, 19.95)?

4. FAQ 4.1: Why am I getting long decimals (eg, 19.9499999999999) instead of the numbers I should be getting (eg, 19.95)?

5. FAQ 4.1: Why am I getting long decimals (eg, 19.9499999999999) instead of the numbers I should be getting (eg, 19.95)?

6. FAQ: Why am I getting long decimals (eg, 19.9499999999999) instead of the numbers I should be getting (eg, 19.95)?

7. FAQ: Why am I getting long decimals (eg, 19.9499999999999) instead of the numbers I should be getting (eg, 19.95)?

8. FAQ: Why am I getting long decimals (eg, 19.9499999999999) instead of the numbers I should be getting (eg, 19.95)?

9. FAQ: Why am I getting long decimals (eg, 19.9499999999999) instead of the numbers I should be getting (eg, 19.95)?

10. FAQ: Why am I getting long decimals (eg, 19.9499999999999) instead of the numbers I should be getting (eg, 19.95)?

11. FAQ 4.1 Why am I getting long decimals (eg, 19.9499999999999) instead of the numbers I should be getting (eg, 19.95)?

12. FAQ 4.1 Why am I getting long decimals (eg, 19.9499999999999) instead of the numbers I should be getting (eg, 19.95)?

 

 
Powered by phpBB® Forum Software