Hi,
I'm learning Perl with excellent "Learning Perl" from O'Reilly.
One of the examples given doesn't work on my computer though and I really can't
figure out why.
Here's the script :
#/usr/bin/perl -w
open(PW,"/etc/passwd") || die "How did you get logged in?";
while (<PW>) {
($user,$id,$gcos)=(split /:/)[0,2,4];
($real)= split /,/,$gcos;
write;
}
format STDOUT =
============================================
|@<<<<<<<<<<<|@<<<<<<|@<<<<<<<<<<<<<<<<<<<<|
$user, $id, $real
============================================
.
It exits with this message :
/home/eric/exos/perl/11-1.pl: line 3: syntax error near unexpected token
`open(PW,"/etc/passwd")'
/home/eric/exos/perl/11-1.pl: line 3: `open(PW,"/etc/passwd") || die "How did you get
logged in?";'
Is my computer wicked ??
This is Perl 5.6.0
Please CC me, I'm not subscribed.
--
Eric VAN BUGGENHAUT
[EMAIL PROTECTED]