Gossamer Forum
Home : General : Perl Programming :

excuse me for all my posts...i need help...please help me with this and ill go away

Quote Reply
excuse me for all my posts...i need help...please help me with this and ill go away
1) how can i save a "command" i wrote in Perl

2) if i messed up in a previous line, after i hit enter, how do i go back up to it to fix it?


3) why does the following loop?...it keeps displaying "Hello fred!Welcome" over non-stop...why

print "name? ";
$a = <STDIN>;
chop $a;
while ($a ne "fred")
{
print "sorry. Again? ";
$a = <STDIN>;
chop $a;
}
while ($a == "fred")
{
print "Hello, fred!\n";
print "welcome!";
}

thanks

Last edited by:

skateboarder83: Feb 15, 2003, 8:14 PM
Quote Reply
Re: [skateboarder83] excuse me for all my posts...i need help...please help me with this and ill go away In reply to
1) What do you mean "save a command" ?

2) Is this running a script, writing it, or what? You need to be a bit more descriptive Wink

3) Try adding an exit call into it. Just after the;

print "welcome!";
exit;

...line

Hope that helps Smile

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [skateboarder83] excuse me for all my posts...i need help...please help me with this and ill go away In reply to
Code:
while ($a == "fred")

You need eq there, not ==. eq for strings, == for numerics
Quote Reply
Re: [Mark Badolato] excuse me for all my posts...i need help...please help me with this and ill go away In reply to
Whoops, missed that Blush

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Mark Badolato] excuse me for all my posts...i need help...please help me with this and ill go away In reply to
I think he'll probably want to use chomp instead of chop too :)
Quote Reply
Re: [andy] In reply to
In Reply To:
1) What do you mean "save a command" ?
like the whole "name command i typed above...how can i save that so i dont have to type it again and again after i test it once? FYI: i found out that if i write the script in Note Pad and save it as a ".pl" file, it does what i want it to, but can i save it while running Perl?
2) Is this running a script, writing it, or what? while writing a script...like, i see that i messed up by putting an "==" instead of "eq", while im writing the script, and i noticed that, but i was three lines down from it, how do i "go" back up to that line and fix it?

Last edited by:

skateboarder83: Feb 17, 2003, 10:22 AM
Post deleted by Andy In reply to
Quote Reply
Re: [skateboarder83] In reply to
1) Just save it as whatever.cgi (or .pl)...you can write it in any text editor. Just assign your favorite editor to open .pl and .cgi files. You then just need to FTP it to your server. Sounds like you are doing it the hard way via Telnet at the moment Frown

2) Using the above method will allow you to edit it.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] In reply to
ANDY: thanks for all your help...but i dont know what you mean by Telnet or how i can FTP it to my server...what would it do if i FTP'd it?
Quote Reply
Re: [skateboarder83] In reply to
Goto http://www.cuteftp.com , download a free copy. Then find your hosts FAQ's, and I'm sure they will have instructions on how to upload files to your server via FTP Tongue

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!