#!/usr/bin/perl use strict; use Getopt::Long; #GetOpt::Long::Configure('bundling'); #sub process_args(); #sub pars0r(); &process_args; &open_sesame; &pars0r; #my $hostname; my $vol_to_parse; my $file_to_parse; my @raw_data; my $status; my $volume; sub process_args(){ $status = GetOptions ( 'v=s' => \$vol_to_parse, # volume to parse argumento 'h=s' => \$file_to_parse); print "Process arg subrountine real\n"; print "Using: "."vol: $vol_to_parse". " and " . "file: $file_to_parse" . "\n"; } #$file_to_parse="netapp_volume_location"; sub open_sesame{ open(DAT, $file_to_parse) || die("Could not open file! Is it there?"); @raw_data=; #Take everything from file and put in @raw_data array close(DAT); print "open and close ran \n"; } #my @arrayz=($raw_data[0]..$raw_data[-1]); print "Gonna print whole array"; print "$raw_data[0..-1]"; my $y = qw ($raw_data[0]..$raw_data[3]); sub pars0r{ # foreach $volume (@arrayz) foreach $volume (@raw_data) { chomp($volume); # print "$volume" . "\n"; if ($volume =~ $vol_to_parse) { print "$vol_to_parse"." ". "got got \n"; } # elsif ($volume !=~ $vol_to_parse) # { # redo; #} else{ print "Did not find volume!\n"; } } }