continue line in perl script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting continue line in perl script
# 1  
Old 06-08-2009
continue line in perl script

HI ,
I am new to the perl , I am using a if condition and in that if condition i am checking 7 variables value. so it continue to second line .And if i user "\" for the continue line it showing error.

Example :
Code:
if(a >9 || b>8 || c> 10 \
d > 11)
{
print();
}

The above statement is showing error.
Please help me regarding this .


Thanks in advance
julee
# 2  
Old 06-08-2009
have you read a basic Perl book or manual? type perldoc perltoc and read the documentation. The basic variable declaration include a dollar sign.
# 3  
Old 06-08-2009
In an "if" condition you can just drop to another line:

Code:
if ($blah < 9 &&
    $blah > 1 &&
    $blah == $foo ||
    $blah != $baz ) {
    print "What a load of doo-doo\n";
}

As ghostdog has suggested, read some perl books or tutorials to get familiar with the basics.
# 4  
Old 06-08-2009
Thanks for you help . sorry for my typo mistake ...thatr i haven't put the $ sign here ...but in my program i have put.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Search for word in huge logfile and need to continue to print few lines from that line til find date

Guys i need an idea for one logic..in shell scripting am struggling with a logic...So the thing is... i need to search for a word in a huge log file and i need to continue to print few more lines from that line and the consecutive line has to end when it finds the line with date..because i know... (1 Reply)
Discussion started by: Prathi
1 Replies

2. Shell Programming and Scripting

Add new line after 'continue' in if statment

Hello, im creating a csv file for email reporting on issues. my problem is that after 'continue' command in if statment in a loop the new paramter writing into the log doesnt take new line. timeout 4s zabbix_get -I $ZBX -p $PORT -s $IP -k "system.run" if ; then ... (3 Replies)
Discussion started by: batchenr
3 Replies

3. Shell Programming and Scripting

Concatenate small line with next line perl script

Hello to all, I'm new to perl, I have input file that contains the string below: 315350535ff450000014534130101ff4500ff45453779ff450ff45545f01ff45ff453245341ff4500000545000This string has as line separator "ff45". So, I want to print each line but the code below is not working. perl -pe '... (2 Replies)
Discussion started by: Ophiuchus
2 Replies

4. Shell Programming and Scripting

Continue an instruction on more than one line in a script shell ?

Hello, I have a very long instruction to write, but, for lisibility reasons, I would like to cut it on more than one line and comment each lines. is it possible ? thanks :b: (1 Reply)
Discussion started by: shadok
1 Replies

5. Shell Programming and Scripting

perl/unix: script in command line works but not in perl

so in unix this command works works and shows me a list of directories find . -name \*.xls -exec dirname {} \; | sort -u | > list.txt but when i try running a perl script to run this command my $query = 'find . -name \*.xls -exec dirname {} \; | sort -u | > list.txt';... (2 Replies)
Discussion started by: kpddong
2 Replies

6. Shell Programming and Scripting

Doing a tail in a script and then return back and continue script

Hello all, I am trying to do a tail in a script. But when I quit the tail my script quits also. This is not what I want. I am struggling to get this done. #!/bin/bash askFile() { echo -n "Enter file: " read FILE } doTail() { tail -F "${1}" } askFile doTail... (4 Replies)
Discussion started by: markdark
4 Replies

7. Shell Programming and Scripting

Line in bash script to wait for x feedbacks and then continue

I have a script that runs a console/terminal command on the server and what is want is for each of the multiple success reports fed back from the clients (echo-ed out onto the conosle) to be counted and after x number of reports reboot the server. The Details: The command (program) is... (0 Replies)
Discussion started by: dp123
0 Replies

8. Shell Programming and Scripting

Perl script to search a line and copy it to another line

Hi I have a log file (say log.txt). I have to search for a line which has the string ( say ERROR) in the log file and copy 15 lines after this into another file (say error.txt). Can someone give me the code and this has to be in PERL Thanks in advance Ammu (3 Replies)
Discussion started by: ammu
3 Replies

9. Shell Programming and Scripting

Continue output redirection on the same line?

I have for i in 1 2 3 4 do echo $i >> test.txt done test.txt contains ... 1 2 3 4 But I want it to contain ... 1234 Any suggestions? (3 Replies)
Discussion started by: Bandit390
3 Replies

10. Shell Programming and Scripting

perl - understand process status and continue the code execution

Hello, I need advice on how to check if started processes are finished in perl, here's explanation : OS is RHEL 4, perl -v = "This is perl, v5.8.0 built for i386-linux-thread-multi" The logic of the script : #!/usr/bin/perl use warnings; $param1 = $ARGV; $param2 = $ARGV; $param3 =... (2 Replies)
Discussion started by: sysgate
2 Replies
Login or Register to Ask a Question