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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Length of Script Error?

Status
Not open for further replies.

1DMF

Programmer
Jan 18, 2005
8,795
GB
Why has my script started to error just because it has gone over 1020 lines, is there a limit?

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
What editor are you using? My scripts range from 1000 - 2000 lines.

Also what version of perl and such are you using?
 
i don't know the version but i don't see how it's an editor problem, I use SourceEdit, it can handle thousands of lines.

is it because it is a module, do modules have a line length limit ?

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
The only limit is available ram and I doubt that's your problem.
I would guess that it's more likely that recent additions have introduced errors.
What error messages are you getting?




(very injured) Trojan.
 
i was geting an error @ line 2019 saying "near ])"

but line 2019 is nothing but ################

Code:
2019 #############################################
2020 ######### End of Module - Return 1; #########
2021 #############################################
2022 1;

all i did was go through the code and remove a few blank lines here and there to make the last line 2015 , uploaded it and it works fine!

very bizzare?

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
No, not at all.
You have obviously removed something else by accident.
Are you using warnings and strict?
Are you using diagnostics? If not, I suggest you try these.




(very injured) Trojan.
 
yes i use warnings and strict and no i didn't delete anything else, promise!

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Promise all you like, it makes no difference as to what is actually there or not.
We need to find out what's actually wrong.
Add "use diagnostics" to the top of you script and try again.





(very injured) Trojan.
 
near ])"

Looks like perl is expecting something?

--Paul

cigless ...
 
yeah i know paul but what? either way the module is running fine seings as I cut the line count down to 1015, and for the moment that will have to do.

If I need to add any code to the module and i get the same problem, i'll add the diagnostic bit and post the results.

1DMF

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
1DMF - your script is only running correctly by accident. There's no way you can be sure it's doing what you want it it in fact you can almost be sure it isn't. You need to go back to the version with the obvious error and find the error.

Mike

You cannot really appreciate Dilbert unless you've read it in the
original Klingon.

Want great answers to your Tek-Tips questions? Have a look at faq219-2884

 
Although it's by no means a foolproof method, you could try opening the file in a syntax-colouring editor - you might see an obvious error from the highlighting (maybe a big chunk being taken as a literal)?
 
Mike I just realised what you said, I find that funny :p

your script is only running correctly by accident

WTF - no my programs if they are running correctly, they are doing so because i meant them too, my programs never work correctly by accident, they only ever mis-behave, which is the problem i've been having.

I know what you meant though, sorry it's my sense of humour.

I can't find anything wrong, I even went an added a load of hashes ##### to make the lines up to over 1021 and it is running fine now, maybe the upload got corrupted and that was causing the problem.

let's hope that's all it was and there isn't some bug in my module. (as if there would be [wink] )


"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
1DMF !
You are the HOLY GRAIL !
A developer that never makes mistakes !

(sorry, that was MY sense of humour) ;-)





(very injured) Trojan.
 
lol - I wish, If only I was a conjurer rather than a developer it would make life a lot easier, but then what would I have to do if there really was a magic wand, god my day would be so boring not having bugs to fix and code to make me pull my hair out.

hmmm what are we going to do when computers program themselves.

Oh and how's the hand, that must be making programing difficult at the moment, hope your all fixed up real soon.

regards
1DMF

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
I'd post some photos of my thumb but I think I'd get red flagged!
It's very painful and grotesque and yes, it's making typing almost impossible.
;-)




(very injured) Trojan.
 
No spaces in anything at the moment then [2thumbsup]

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top