madmonster99 has asked for the wisdom of the Perl Monks concerning the following question:
I have access to the /etc/passwd file. All I'm doing is trying to write a program that reads the file /etc/passwd and prints the list of usernames and names of the users contained in the file. The output needs to be in the format:
username_1 name_1
username_2 name_2
The code for this problem that I am using is this:
- UW PICO(tm) 4.5 File: password5.pl-----------------------------
and the error i get is this: et791:~$ ./password5.pl String found where operator expected at ./password5.pl line 3, near "lne 'print (split(/:/))[0]'" (Do you need to predeclare lne?) syntax error at ./password5.pl line 3, near "lne 'print (split(/:/))[0]'" Execution of ./password5.pl aborted due to compilation errors.#!/usr/bin/perl -lne 'print (split(/:/))[0]' /etc/passwd
Back to
Seekers of Perl Wisdom