Christopher Spears wrote:
Here is the latest version of my script:

#!/usr/bin/perl -w
use strict;

my $Pixarport = 7498;
my $host = "lex";
my $Pixarfile = $Pixarport."@".$host;
my @input;
my $line;
my $line_number;
my $file_length;
my @features_array;
my @handles_array;
my $handles;
my $features;
my $sizeof;
my $counter = 0;
my $answer;
my $string;
my $userid = `whoami`;

@input = `cat clicenses_output`;

Why not

 my @input = `cat ...

here instead of my'ing it above and then assigning to it here?

$file_length = scalar(@input);

Sama as above...

print "Is ".$userid." your userid (Y or N)?";

Why not

print "Is $userid your userid (Y or N)?";

the "".$var."" is pointless and confusing...

$answer = <STDIN>;
if ($answer =~ /^[nN]$/) {
    print "Enter your userid: ";
    chomp($userid = <STDIN>);
}elsif ($answer =~ /^[yY]$/) {
    print $userid." is your userid.\n";


same as above...

}

print "Do you wish to:"."\n";

same as above...

print "1) remove all of your floating licenses at
once"."\n";

same as above...

print "2) remove them one at a time"."\n";


same as above...

You could even use a here doc:

print <<OPTION;
Do you wish to:
  1) remove all ...
  2) remove them ....
OPTION

$answer = <STDIN>;

same as first "why not" above...

i know that wasn't your original question but it may be easier for you if the code was more readable...

HTH :)

Lee.M - JupiterHost.Net

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to