Visit Our UNIX and Linux User Community


Perl scripting absurd error !!


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Perl scripting absurd error !!
# 1  
Old 07-31-2009
Perl scripting absurd error !!

I am facing strange compilation errors while doing Perl scripting:

Example: suppose my code contain

my $line=1;
call_fun($line); // call_fun is a function
my $line1=2;

It is not showing any compilation error ... but suppose if I am putting a new line char in between "my $line=1;" and "call_fun($line);" then it is showing me the compilation error...!!

like:
my $line=1;

call_fun($line); // call_fun is a function
my $line1=2;


This kind of absurd errors most of the time I am facing if I am putting new lines or legal spaces or statements..

Anyone ever have faced such problem??
Is it due to some perl configuration problem??
# 2  
Old 07-31-2009
Hi.

I suggest using perl comment markers:
Code:
call_fun($line); # // call_fun is a function

Best wishes ... cheers, drl
# 3  
Old 08-03-2009
Quote:
Originally Posted by drl
Hi.

I suggest using perl comment markers:
Code:
call_fun($line); # // call_fun is a function

Best wishes ... cheers, drl

Hey no no...! I just put '//' for general purpose.. not in scriptingSmilie..

This is a real issue... I am facing
I am using Notepad++ editor to write/ftp into unix box. The Perl script I have written is very large and contains HTML code inside. Whenever I am changing something like putting a line in between two lines it is throwing me some absurd error.
# 4  
Old 08-03-2009
Quote:
Originally Posted by Niroj
Hey no no...! I just put '//' for general purpose.. not in scriptingSmilie..
I suggest you post real code. Smilie

Quote:
Originally Posted by Niroj
This is a real issue... I am facing
I am using Notepad++ editor to write/ftp into unix box. The Perl script I have written is very large and contains HTML code inside. Whenever I am changing something like putting a line in between two lines it is throwing me some absurd error.
I suggest you get a real editor. There are many free ones available.

I use GViM, but it's too archaic for most people, so I don't make any recommendations.
# 5  
Old 08-03-2009
Quote:
Originally Posted by Niroj
Hey no no...! I just put '//' for general purpose.. not in scriptingSmilie..

This is a real issue... I am facing
I am using Notepad++ editor to write/ftp into unix box. The Perl script I have written is very large and contains HTML code inside. Whenever I am changing something like putting a line in between two lines it is throwing me some absurd error.
Make sure to transfer the file in ASCII (or text) mode and your ftp application should convert Windows style newlines into Unix newlines automatically. Otherwise the Windows style \r\n newlines might cause problems on the Unix server.

Previous Thread | Next Thread
Test Your Knowledge in Computers #731
Difficulty: Medium
Microsoft introduced Visual Basic in 1989.
True or False?

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl Scripting Help

Hello, Can anyone help with pearl Scripting. I'm looking for equilant pearl code which can do - OS=`uname -s` if ]; then my $HOME='/home/mqm' else my $HOME='/export/home/mqm' fi thanks (4 Replies)
Discussion started by: skrv
4 Replies

2. Web Development

Perl scripting or shell scripting?

i am going to study any one of the scripting languages mentioned above(shell 0r perl scripting) . Which is having more scope for a fresher? (1 Reply)
Discussion started by: Anna Hussie
1 Replies

3. What is on Your Mind?

Shell Scripting vs Perl scripting

Gents, I have been working in a Solaris/Unix environment for about 9 months. I took some linux classses online before getting the job. But, I am not very good at scripting. I want to learn how to script. Do you think that I should start with Shell scripting or Perl? I wanted to continue with... (2 Replies)
Discussion started by: Pouchie1
2 Replies

4. What is on Your Mind?

Shell scripting vs Perl scripting

Hi all, I would like to start developping some good scripting skills. Do you think it would be best to start with shell scripting or Perl? I already got a fundation, really basics, in perl. but I am wondering what would be best to be good at first. Can you please help me determine which one to... (14 Replies)
Discussion started by: Pouchie1
14 Replies

5. UNIX for Dummies Questions & Answers

Need help configuring Active Perl on Windows Vista.: Perl Scripting on Windows

Hi All, Need help configuring Active Perl on Windows Vista. I am trying to install Active Perl on Windows Vista. The version of Active Perl i am trying to install is : ActivePerl 5.10.1 Build 1006 After installing it through cmd, When i try to run perl -v to check the version, i get the... (2 Replies)
Discussion started by: Vabiosis
2 Replies

6. Shell Programming and Scripting

Call Shell scripting from Perl Scripting.

Hi How to call a shell scripting through a Perl scripting? Actually I need some value from Shell scripting and passes in the Perl scripting. So how can i do this? (2 Replies)
Discussion started by: anupdas
2 Replies

7. Shell Programming and Scripting

Help with perl scripting

Hi All, I need to run smartctl using nagios account but I'm not familiar with perl scripting. The existing script runs smartctl using root account. I need it to run using nagios to eliminate security risks. #!/usr/bin/perl -w # checks for possible disk errors use strict; my... (3 Replies)
Discussion started by: linuxgeek
3 Replies

8. Shell Programming and Scripting

Perl scripting

Hi, I want some Perl tutorials, kindly tell me if there are any links... (1 Reply)
Discussion started by: darshakraut
1 Replies

9. Shell Programming and Scripting

perl scripting

Hi does anyone know how to ouput "I love scripting" to "scripting love I" without using reverse() function in perl? Thanks (2 Replies)
Discussion started by: ccp
2 Replies

Featured Tech Videos