Previous Thread
Next Thread
Print Thread
Rate Thread
#101171 09/08/2000 7:32 PM
Joined: Sep 2000
Posts: 138
Em8
Offline
Member
Member
Offline
Joined: Sep 2000
Posts: 138
I have just learned perl and got the $ to display somthing automaticly today. I was wondering what was wrong with this script:
Code
code:
This was a test script. So can you help?

------------------

[This message has been edited by Em8 (edited September 08, 2000).]

Sponsored Links
#101172 09/08/2000 8:31 PM
Joined: May 2000
Posts: 243
Member
Member
Offline
Joined: May 2000
Posts: 243
get ride of all the "my"s in front of the variables. you don't need thme. This below is an example of useing it:

=========================
&goto("Hi");

sub goto {
my $variable = shift;
print "$variable";
}
=========================

Even when you delete all the my's in front. You'll still get a white page. Try this:

==========================
use CGI qw/:standard/;

if (param('action') eq 'TopHTML') {
&TopHTML;
}
==========================

Now from your browser:
http://www.yoursite.com/cgi/yourscript.cgi?action=TopHTML

If you would rather it link to like

yourscript.cgi?action=top

change TopHTML to...

====================
if (param('action') eq 'top') {
&TopHTML;
}
====================

Hope that helps



------------------
My Freeware Board

#101173 09/08/2000 10:40 PM
Joined: Aug 2000
Posts: 3,590
Moderator
Moderator
Offline
Joined: Aug 2000
Posts: 3,590
Quote
quote:
No, no, no, no....

Getting rid of the my's would actually cause an error when using strict, which should always be done. Your "scope" must be specified...



------------------
I wish I were a Canuck
All they have to do is drink beer, play hockey, and say "Eh"

* No offense meant to any Canadians

#101174 09/09/2000 12:19 AM
Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
P.I.T.A. / Programmer
Offline
Joined: Sep 2000
Posts: 755
Get rid of the my's??? Just because you don't understand something doesn't mean you should tell people not to do it. My's are a good thing. It's called proper programming.

Now to the root of the problem:

1) The heredoc is wrong:

print <:
:
HTML

That close should be TOPHTML, not HTML

2) there's no actual call in the code to sub TopHTML so the routine is never getting executed.

--mark

------------------


"Annnnnnnndd now, opening for Iron Maiden...... WYLD STALLYNS!!!" --Bill S. Preston, Esquire and Ted "Theodore " Logan
#101175 09/09/2000 11:58 AM
Joined: Sep 2000
Posts: 138
Em8
Offline
Member
Member
Offline
Joined: Sep 2000
Posts: 138
So, like
Code
code:

I uploaded it just like that but I was wondering, the
print "Content-type: text/htmlnn";

print " &TopHTML; ";

&TopHTML;

should I remove

print "Content-type: text/htmlnn";

print " &TopHTML; ";

or should I remove

&TopHTML;

or leave it like it is? Thanks for all the help!

Sponsored Links
#101176 09/09/2000 12:21 PM
Joined: Aug 2000
Posts: 3,590
Moderator
Moderator
Offline
Joined: Aug 2000
Posts: 3,590
You need the content line always when you are printing to a browser. Remove the print " &TopHTML"; line...

------------------
I wish I were a Canuck
All they have to do is drink beer, play hockey, and say "Eh"

* No offense meant to any Canadians

#101177 09/10/2000 8:37 PM
Joined: May 2000
Posts: 243
Member
Member
Offline
Joined: May 2000
Posts: 243
my goodness people I'm still learning perl myself so please you don't need to jump on my back you could atleast politly correct me...

------------------
My Freeware Board

#101178 09/10/2000 11:34 PM
Joined: Sep 2000
Posts: 755
P.I.T.A. / Programmer
P.I.T.A. / Programmer
Offline
Joined: Sep 2000
Posts: 755
If you're just learning yourself, then you have no right telling people to do or not do something, especially if you have no idea what it is.

Polite? Not my style. It pisses me off when wrong or bad information is passed on too people, especially when the people doing the passing are not simply misinformed, but rather have no basis for the information they provide.

--mark

------------------


"Annnnnnnndd now, opening for Iron Maiden...... WYLD STALLYNS!!!" --Bill S. Preston, Esquire and Ted "Theodore " Logan
#101179 09/11/2000 5:05 PM
Joined: Aug 2000
Posts: 3,590
Moderator
Moderator
Offline
Joined: Aug 2000
Posts: 3,590
If you teach someone the wrong way to to do something, than it's no good....

------------------
Da Wannabe Cannuck

Andy Tomaka
YaBB Developement Team
[email protected]
http://www.yabb.org

#101180 09/24/2000 2:48 PM
Joined: Sep 2000
Posts: 138
Em8
Offline
Member
Member
Offline
Joined: Sep 2000
Posts: 138
Quote
quote:
Ya. I mean he tried to help.



------------------

Sponsored Links

Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
JAISP
JAISP
PA
Posts: 449
Joined: February 2008
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)