|
|
|
|
|
by tyingq
1091 days ago
|
|
The same shortcut syntax that people complain about does make perl really handy for one-time tasks where you're iterating on ideas. Lots of features there that make that easy. One example: #!/usr/bin/perl
while (<>) {
# various processing here
# $ARGV is set to either "-" for piped input, or the current filename
# $_ is the data of the current line
}
That (<>) construct accepts data from stdin, redirection or file(s) named as arguments and iterates over the data. There's lots of things like that throughout the language. |
|