RE: moving to the next line

From: Charles K. Clarkson (cclarkson_at_htcomp.net)
Date: 12/16/04


To: <beginners@perl.org>
Date: Thu, 16 Dec 2004 00:02:34 -0600

Christopher Spears <cspears2002@yahoo.com> wrote:

: So everybody wants to know what I have been working
: on. I finally got permission to post this:
:
: #!/usr/bin/perl -w
: use strict;
:
: my $Pixarport = 7498;
: my $host = "lex";
: my $Pixarfile = $Pixarport."@".$host;
: my @line;
: my $line;
: my @features_array;
: my @handles_array;
: my $handles;
: my $features;
: my $sizeof;
: my $counter = 0;
: my $answer;
: my $string;

    Don't declare all your variables at the beginning
of the script. It works in other languages, but not
in perl. Declare them as you go.

: LOOKING_LINES: while(@line = `cat clicenses_output`){

    Stop using line labels. They work in perl, but they
are rarely needed.
[snip]

: This is the line giving me issues:
:
: LOOKING_HANDLES: while (@line = `cat
: clicenses_output`);
:
: Basically, after I grab $feature I need to move to the
: next element of the array @line and start looking at
: each element until I hit Users again (in which case I
: grab the feature and the process begins again). So
: how do I make the big jump to that next element?

    Why is this output in a loop? Does `cat clicenses_output`
place a new array in @line each time through? Where does it
break its listing?

HTH,

Charles K. Clarkson

-- 
Mobile Homes Specialist
254 968-8328


Relevant Pages

  • Part 4 of Short Steps Toward Generic Programming: KIND Genericity
    ... In this part I will again be discussing a feature that has been ... KIND and select the appropriate instance at compile-time in the ... Assumed Rank Arrays ... argument that don't require knowledge of the rank of the array. ...
    (comp.lang.fortran)
  • Re: Is it possible to use the value of the PROGRAM ID within the source code?
    ... Until the universal availability of scope terminators there were ... But 'reusability' is not a unique feature of OO design. ... remain and some are now garbage. ... A tree can be made faster by increasing its width; an array ...
    (comp.lang.cobol)
  • Re: Properly using Rubys specialness
    ... Ruby, I used this feature to add in a method to the Array class ... of making a class that inherited from Array and added that method. ... Open classes are best used sparingly. ...
    (comp.lang.ruby)
  • Re: changing a field without recompiling the record
    ... When gawk first got RS as a regexp and the RT variable, ... RT is a really cool feature, I use it all the time. ... it only parses the record up to the largest field ... neither he needs to access that special array. ...
    (comp.lang.awk)
  • Re: Linear Array Feature
    ... How do you create an array of features when the feature to array is ... Linear Pattern Direction 1, Distance, Number of "feature" to repeat ... The above method only creates a linear 1 x N array with the original pattern ...
    (comp.cad.solidworks)