[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [Fun With Perl] A Very Important Question



On 12 Jun 1999 19:25:49 PDT, Randal L. Schwartz wrote:
:>>>>> "Bill" == Bill Jones <bill@fccj.org> writes:
:
:Bill> or the default hash  %_
:
:Surprise me. Name one place where this is used.

It's used in plenty of places!  I just don't know of any place 
where it's a default.  Since we're having fun with Perl, though,
here's one place it's used:


(@_=qw[J P T a e h l n o r u);
push(@_,<DATA>);
sub _ {
  $_ .= getpwuid($:)
    if ( ! lstat @_ && -l _ );
  if ( !exists( $ENV{TPJ} ) )
  {
    for (sort keys %ENV){$_++}
  }
  opendir( D, shift ) ;
  grep /2/ && printf("%8s:%9d\n", $`, $'), readdir(D)
} 
_
__END__
(++$]) if $]>=5;
$_=<<_;
$_[12]
_ 
{(\$,,\@_)=($_[40]'.');$_[34](;
\@_;){\$;=\$_=$_[41];\@'=$_[21];
$_[29]\$%{\$:=\$'[4]})
&(\$%{\$:}=$_[17]||\$:);
\$_{"\@'[0,1]"}++||((\$"{\$:}
+=\$'[12]),((-l|!-d)||($_[39]\$,,\$_),
(\@_=(\@_,$_[44]!/^\\.\\.?\$/
&s/^/\$;\\/\/,$_[50])))))}@{[@_[34..36]]}
\%{"}){$_[47]\$%{\$_},\$"{\$_})}}
_
s//$_/ee,&_


and that wasn't even good for an honorable mention in TPJ's OPC.  Sigh.
(Spoiler: On a Unix system, it prints the disk usage by user under the
current directory.)

Michael
-- 
$@='@'^'@';$_='!'&~'"';$/='"'&~'!';$^='$'&~'!';$,='('&~'!';$:='$'&'"';$~='?'^
'/';$;='@';$_="$@$;$@$@$@$@$@$:$@$@$,$@$:$@$@$@$@$@$_$@$@$@$/"|"$@$_$/$^$@$_".
"$_$@$_$@$_$_$@$@$_$_$_$@$@$_$^$^$^$@$_"|"$~$^$~$,$@$^$^$@$/$^$@$^$@$@$^$,$/".
"$,$@$^$,$,$,$@$/"|"$:$:$:$:$@$,$:$@$^$:$:$:$@$/$,$:$:$:$:$:$:$~$:$/$^"|"$;".
"$@$;$;$:$:$;$@$:$;$;$;$@$:$;$;$;$;$;$;$;$;$;$:$:";`$_`.'`';$~=$$&$!,"$_.'"

==== Want to unsubscribe from this list? (Don't you love us anymore?)
==== Well, if you insist... Send mail with body "unsubscribe" to
==== fwp-request@technofile.org