#!/usr/local/bin/perl print "\n" ; print "Which file do you want to open? " ; # we are asking which file to open $file0 = ; $file = $file0 || "somelist"; #here's my effort to apply a default to the input if it is blank. # THIS IS WHAT I WOULD LIKE TO DO -> if stdin is blank, i'd like to assign $file a variable. chomp($file) ; # print "\n" ; print "Which driver do you want to see? " ; # we are asking to output info from a particular line chomp ($name = ) ; # the more idiomatic way # Our requested file is accessed and displayed $bibfile = "$file" ; open (IN, "<$bibfile") or die "Can't open $bibfile\n"; print "File Contents:\n" ; while ($line = ) { chomp($line) ; ($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 ;