Click here to get back home

Long line in perl script

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Long line in perl script Subra 02-22-2008
Posted by Subra on February 22, 2008, 3:17 am
Please log in for more thread options
Hi ,

I have very long line in perl script. I need to break it into
multiple lines. Some thing like below.

Present Code :-

if ($settings->-
> || $settings->->) {

New code should be:
if ($settings-
>-> ||

$settings->->) {


Is there any special character like in C (\) which I should put at the
end of the broken line ????

As this script is suppose to run in many platforms so this info is
very imp for me.

thanks,
Subra...

Posted by Gunnar Hjalmarsson on February 22, 2008, 4:18 am
Please log in for more thread options
Subra wrote:
> I have very long line in perl script. I need to break it into
> multiple lines. Some thing like below.
>
> Present Code :-
>
> if ($settings->-
>> || $settings->->) {
>
> New code should be:
> if ($settings-
>> -> ||
>
> $settings->->) {

Looks weird to me. How about:

if (
$settings->->
||
$settings->->
) {

> Is there any special character like in C (\) which I should put at the
> end of the broken line ????

No.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

Posted by rthangam on February 22, 2008, 5:36 am
Please log in for more thread options
> Subra wrote:
> > I have very long line in perl script. I need to break it into
> > multiple lines. Some thing like below.
>
> > Present Code :-
>
> > if ($settings->-
> >> || $settings->->) {
>
> > New code should be:
> > if ($settings-
> >> -> ||
>
> > $settings->->) {
>
> Looks weird to me. How about:
>
> if (
> $settings->->
> ||
> $settings->->
> ) {
>
> > Is there any special character like in C (\) which I should put at the
> > end of the broken line ????
>
> No.
>
> --
> Gunnar Hjalmarsson
> Email:http://www.gunnar.cc/cgi-bin/contact.pl

Did you using perl beautify ?

Posted by Gunnar Hjalmarsson on February 22, 2008, 5:43 am
Please log in for more thread options
rthangam wrote:
>> Looks weird to me. How about:
>>
>> if (
>> $settings->->
>> ||
>> $settings->->
>> ) {
>
> Did you using perl beautify ?

What's that? Anyway, I didn't use any such thing.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

Posted by comp.llang.perl.moderated on February 22, 2008, 3:09 pm
Please log in for more thread options
> rthangam wrote:
> >> Looks weird to me. How about:
>
> >> if (
> >> $settings->->
> >> ||
> >> $settings->->
> >> ) {
>
> > Did you using perl beautify ?
>
> What's that? Anyway, I didn't use any such thing.
>

s/perl beautify/perltidy/ perhaps ... ?

eg, perltidy output:

if ( $settings->->
|| $settings->-> )
{

--
Charles DeRykus


Similar ThreadsPosted
How long is too long for cgi script? April 22, 2005, 12:07 pm
ignore new line for long string August 8, 2005, 10:05 am
breaking a long arithmetic statement into multiple line December 4, 2006, 8:20 pm
Having problems parsing command line options using Getopt::Long on windows December 2, 2004, 8:48 am
'long long integer' in Perl February 15, 2006, 2:30 pm
Long running CGI script June 17, 2005, 4:13 am
script quitting abruptly (long) June 17, 2005, 8:00 am
script to find the files with very long names June 12, 2006, 3:34 am
How to pass a range (2 .. 42) by Getopt::Long to a script? March 6, 2008, 6:38 pm
automate command line script using perl June 15, 2006, 1:32 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap