-n causes Perl to assume the following loop around your
program, which makes it iterate over filename argu-
ments somewhat like sed -n or awk:
LINE:
while (<>) {
... # your program goes here
}
####
while(<>){
/ /, $;{$`}++}{print $_, $/ ^= "*" for %
}
##
##
while(<>){
/ /, $;{$`}++
}
{
print $_, $/ ^= "*" for %
}
##
##
while(<>){
/ /, $;{$`}++
}
{
print $_, $/ ^= "*" for %;
}
##
##
use English;
while( ){
m/\s/;
$hash{$PREMATCH}++;
}
{
for( %hash ){
print $_, $INPUT_RECORD_SEPARATOR ^= '*';
}
}
##
##
$username $num_logins
$username $num_logins
##
##
$ who|perl -MO=Deparse -ne'/ /,$;{$`}++}{print$_,$/^="*"for%'
LINE: while (defined($_ = )) {
/ /, ++$;{$`};
}
{
foreach $_ (%;) {
print $_, $/ ^= '*';
}
}
##
##
s**lil*; $*=join'',sort split q**; s;.*;grr; &&s+(.(.)).+$2$1+; $; =
qq-$_-;s,.*,ahc,;$,.=chop for split q,,,reverse;print for($,,$;,$*,$/)