in reply to german nouns gender
Good places to start would be open and split.
The basic flow of the program should be something like this:
Read the file one line at a time:open my $fh, '<', $filename or die "Failed to open $filename - $!";
Check the number of items in a list (by evaluating a list in scalar context):while (my $line = <$fh>) { # Do something with $line }
Get a line of input:my $count = @list;
Update - hint: always use strict and warningsmy $answer = <STDIN>;
By default perl is extremely forgiving and tries to do what you mean. Sometimes this is desireable, but normally you want perl to be strict and catch the mistakes you make. Save yourself a lot of debugging time by always using both strict and warnings.use strict; use warnings;
|
|---|