Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

use strict code issue

Status
Not open for further replies.

MamaLoca

Programmer
Aug 29, 2005
48
Hey fellas,

I'm trying to learn PERL and I keep hitting brick walls. So I thought I'd come to the best!

Please let me know what is wrong with this code

Code:
#!/usr/bin/perl -w

use CGI;

use diagnostics;

$cgi=new CGI;

print $cgi->header;

print "Here I is";

if I throw in use strict; it gives me an internal error. Without it it works just fine. Perhaps I place it in the wrong location in my script, It should be first right after the shabang I am guessing? :/



Life would be so much easier if I only had the source code.
 
You should declare you all your variables $cgi with my when you have use strict 'vars'. So my $cgi should be ok.

Corwin
 
Ok sorry for the strange post. :) Just declare $cgi with "my".

Corwin
 

Ahh, I see, OK will try.

Strange posts are better than no posts. :D



Life would be so much easier if I only had the source code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top