Gossamer Forum
Home : General : Perl Programming :

perl script problem

Quote Reply
perl script problem
i have a perl script that has worked for a long time. i uploaded a small change to the file today and suddenly a lot of the comments in the file caused problems. the problems were the result of the comment spilling over to a second line. when i tried to run the script, the script didn't recognize that the second line was a continuation of the first. these were not changes but had been there forever. my ftp program uploads pl files in ascii mode and i double checked to be sure that was still the setting. after i located the lines with spillovers and added # on the second line or pulled up the spillover to the first line, the script worked fine again. what could cause this weird behavior?
Quote Reply
Re: [delicia] perl script problem In reply to
So you're saying it used to have something like:

Code:
# here is a long comments, with a description of what is going on in this part of the code
my $foo = 1;

..and its converted to something like:

Code:
# here is a long comments, with a description
of what is going on in this part of the code
my $foo = 1;

That right?

If so, using "pico" in SSH can sometimes do that , and I guess some editors may also do that (should be in the settings for any programs)

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] perl script problem In reply to
i have no idea what "pico" in SSH is. i'm thinking the problem could be i'm using notepad to edit the file and it is now 162KB. what text editor do you recommend? is wordpad ok? tks

Last edited by:

delicia: Feb 10, 2011, 6:28 AM
Quote Reply
Re: [delicia] perl script problem In reply to
Hi,

Personally, I use Notepad++ (as its free, and supports a LOT of file formats). Also has handy inline highlighting, which can help you see when you make a mess up (Which we all enevitably do Wink)

Pico is a SSH/Telnet based editor... i.,e:

Code:
pioc file.txt

..and this opens up a copy of the file in SSH, so you can edit it (useful when editing files you can't normally get access to via FTP)

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] perl script problem In reply to
i have a stupid question -- i downloaded and unzipped notepad++. there are two directories - ansi and unicode. which one do i use?
Quote Reply
Re: [delicia] perl script problem In reply to
Hi,

Not sure what you mean? In Windows, you would just right click the file, the "Open With", and select "NotePad++" from the list of programs.

OR open NotePadd++, and then open your .cgi script 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: [Andy] perl script problem In reply to
when i unzipped the download it created two folders, one called ansi and one called unicode. there's a notepad++.exe in each folder. the notepad++ website says the ansi is old so i guess i should use the unicode one. i just want to be sure it doesn't put any weird characters in the file and when i upload in ascii mode all will be ok.

since i just unzipped and didn't 'install' it doesn't show in list of programs though i guess i could browse to find it.

ok, i went back and downloaded the installer so that should simplify things. is there any setting i need to do to be sure it saves files properly for ftp to web?

Last edited by:

delicia: Feb 10, 2011, 1:21 PM
Quote Reply
Re: [delicia] perl script problem In reply to
Should be as simple as installing it. That's all I did on my laptop, and it worked right away ;)

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] perl script problem In reply to
looks like it has a lot of cool features. thanks!