Prepare for your Next Interview
This is a discussion on Number of lines in a PERL script within the PERL forums, part of the Web Development category; How do I check number of lines in script in PERL? Thanks...
|
|||
|
Re: Number of lines in a PERL script
hi
you can add ( print __LINE__ ; ) statement at the end of your script it will display how many lines are there in the script. For e.g #!/usr/bin/perl use strict; my @array=qw(hello World Show must go on); my $first_str; my $second_str; my @rev_sorted=reverse( sort { lc $second_str cmp lc $first_str } @array) ; print "\n Rev_Sorted array:@rev_sorted"; my $count=scalar @array; print "\n Count :$count"; print "\n $array[($count/2)] \n"; print __LINE__; Ans is: 16 |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| about PERL... | psuresh1982 | PERL | 5 | 09-04-2007 10:04 PM |
| How is PERL helpful for testers | Geek_Guest | Career Advice | 0 | 06-28-2007 03:10 AM |
| Getting a list of ipaddress from the array using perl | anushya | Scripting | 1 | 02-10-2007 01:42 AM |
| Points and lines | smart_coder | Brainteasers | 8 | 01-25-2007 01:00 PM |
| Need Forums or PERL/PYTHON | kalayama | Suggestions & Feedback | 3 | 12-21-2006 08:14 PM |