#! /your/path/to/perl use strict; use warnings; print "\n"; print "Which file do you want to open? "; # we are asking which file+ to open my $file0 = ; chomp($file0); my $file = $file0 || "somelist"; #here's my effort to apply a default t+o the input if it is blank. # THIS IS WHAT I WOULD LIKE TO DO -> if stdin is blank, i'd like to as+sign $file a variable. print "OK, I will look in $file.\n"; # print "\n"; print "Which driver do you want to see? "; # we are asking to output+ info from a particular line chomp(my $name = ); # the more idiomatic way print "Aah, $name, truly a great driver.\n"; # Our requested file is accessed and displayed my $bibfile = "$file"; open(IN, "<$bibfile") or die "Can't open $bibfile\n"; print "File Contents:\n"; while (my $line = ) { chomp($line); my ($Drivers,$Points_Rank,$TotalPts,$Behind,$Starts,$Poles,$Wins,$Top5,$Top10,$DNF,$Winnings) = split /\,/, $line; if ($Drivers=~ m/$name/i) { print " $Drivers, $Points_Rank, $Top10, $Wins, $Starts, $DNF \n"; } # } close IN;