A2p, error in the perl script?

  1. The problem statement, all variables and given/known data:

    filename = awkdata

Part 1: Write an awk program that removes the first field and prints only those lines where the third field is greater than 15 million.

Part 2: Do the same command above, but with perl instead of awk.

  1. Relevant commands, code, scripts, algorithms:
awk '{$1=""}1&& $3 > 15000000' awkdata

which outputs:

Sacramento 38593635 Eureka 12
Austin 23967433 Houston 26

  1. The attempts at a solution (include all code and scripts):

Using a2p, I get:

#!/usr/bin/perl
eval 'exec /usr/bin/perl -S $0 ${1+"$@"}'
if $running_under_some_shell;
# this emulates #! processing on NIH machines.
# (remove #! line above if indigestible)
eval '$'.$1.'$2;' while $ARGV[0] =~ /^([A-Za-z_0-9]+=)(.*)/ && shift;
# process any FOO=bar switches
$[ = 1; # set array base to 1
while (<>) {
@Fld = split(' ', $_, -1);
if ($awk) {
$Fld[1] = '';
}
print join(' ',@Fld) if 1 &&
$Fld[3] > 15000000;print join(' ',@Fld) if $awkdata;
}

When I run this perl script, I get no errors, but it acts as if the command is not finished and gives me a blank line instead of the desired output.

  1. Complete Name of School (University), City (State), Country, Name of Professor, and Course Number (Link to Course):

Pima Community College, Tucson AZ, PScott, CIS 137

PS. This is an Intro to UNIX course, not a programming course. I have no knowledge of perl, so staring at this script is like staring at Chinese writing.