#!/usr/bin/perl # # Reformat the project3Dada.txt file to make more accesible $file = '/u/home/jhart2/perl/project3Data.txt'; # Name the file open(INFO, $file); # Open the file for input use strict; use warnings; my $NoOfCharsPerLine = 80; my $NoOfLinesPerPage = 100; my $RightMargin = 7; my $header = 3; my $footer = 5; my @argument; # Read command line arguments @argument = split(/=/, $ARGV[0]); if ($argument[1] =~ /\D/) { print "Nonumeric value for lines option \"$argument[1]\" --script aborted\n"; } if ($argument[0] eq "--chars") { $NoOfCharsPerLine = $argument[1]; } elsif ($argument[0] eq "--lines") { $NoOfLinesPerPage = $argument[1]; } else { print "unrecognized command line option \"$argument[0]\" --script aborted\n"; exit; } close(INFO); # Close the file print "$NoOfCharsPerLine\n"; print "$NoOfLinesPerPage\n";