, ,
Perl 5.003 FreeBSD
2.01.
OS/2 , MS-DOS Windows NT
, .
#!/usr/local/bin/perl
# test1.pl
print " !\n";
.
#!/usr/local/bin/perl
-.
- -.
# test1.pl
.
'#'
"
", .
.
.
print " !\n";
.
" !".
print - "". - ,
\n - ';' - . .
';'. '#' -
.
"hello", "hello all", " ",
" " . ..
, 10$,
!
, " ".
, , .
test1.pl .
:
chmod +x test1.pl
. :
which perl
: /usr/bin/perl
: perl: Command not found.
.
.
man ( - man manual ).
01 which.
:
test1.pl
50$ ,
:
./test1.pl
, .
test1.pl , .
#!/usr/local/bin/perl
open(PASS, ")
{
print;
}
close(PASS);
:
open(PASS, ")
$_.
{
.
print;
$_
}
.
close(PASS);
. -
.
cat /etc/passwd.
!
( ).
#!/usr/local/bin/perl
open(PASS, ")
{
($login, $pass, $uid, $gid, $name, $home_dir, $shell) = split(':');
print "$login \t $name\n";
}
close(PASS);
:
($login, $pass, $uid, $gid, $name, $home_dir, $shell) = split(':');
, ':'.
print "$login \t $name\n";
login - . '\t' - .
#!/usr/local/bin/perl
open(PASS, "sort -n -t : +3 -4 +0 /etc/passwd|") || die " !";
while()
{
($login, $pass, $uid, $gid, $name, $home_dir, $shell) = split(':');
print "$login \t $gid \t $name\n";
}
close(PASS);
:
open(PASS, "sort -n -t : +3 -4 +0 /etc/passwd|") || die " !";
!
sort .
.
.
#!/usr/local/bin/perl
open(PASS, "sort -n -t : +3 -4 +0 /etc/passwd|") || die " !";
while()
{
($login, $pass, $uid, $gid, $name, $home_dir, $shell) = split(':');
write(); # .
}
close(PASS);
exit 0; #
############ ##################
format STDOUT =
: ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$name
^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$name
^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$name
----------------------------------------------------------------------
Login:@<<<<<<<< Uid:@<<< Gid:@<<< Home dir:@<<<<<<<<<<<<<<<<<<<<<
$login, $uid, $gid, $home_dir
----------------------------------------------------------------------
. #
:
: - .
.
. 2-23-06,,,
----------------------------------------------------------------------
Login:uucryst Uid:1055 Gid:66 Home dir:/var/spool/uucppublic/
----------------------------------------------------------------------
: ,,,
----------------------------------------------------------------------
Login:uudilen Uid:1075 Gid:66 Home dir:/var/spool/uucppublic
----------------------------------------------------------------------
,
.
!
Last-modified: Thu, 24 Apr 1997 17:43:55 GMT