Warning: this is an htmlized version!
The original is here, and the conversion rules are here. |
####### # # E-scripts on some specific topics on Perl. # # Note 1: use the eev command (defined in eev.el) and the # ee alias (in my .zshrc) to execute parts of this file. # Executing this file as a whole makes no sense. # An introduction to eev can be found here: # # (find-eev-quick-intro) # http://angg.twu.net/eev-intros/find-eev-quick-intro.html # # Note 2: be VERY careful and make sure you understand what # you're doing. # # Note 3: If you use a shell other than zsh things like |& # and the for loops may not work. # # Note 4: I always run as root. # # Note 5: some parts are too old and don't work anymore. Some # never worked. # # Note 6: the definitions for the find-xxxfile commands are on my # .emacs. # # Note 7: if you see a strange command check my .zshrc -- it may # be defined there as a function or an alias. # # Note 8: the sections without dates are always older than the # sections with dates. # # This file is at <http://angg.twu.net/e/perl1.e> # or at <http://angg.twu.net/e/perl1.e.html>. # See also <http://angg.twu.net/emacs.html>, # <http://angg.twu.net/.emacs[.html]>, # <http://angg.twu.net/.zshrc[.html]>, # <http://angg.twu.net/escripts.html>, # and <http://angg.twu.net/>. # ####### # (find-pl5pod "toot" "ISA") # (find-pl5pod "func" "=item package") # (find-pl5pod "mod" "=head2 Packages") # (find-pl5pod "faq7" "=head2 What's a closure?") # (find-pl5pod "diag" "tainting mechanism") # (find-pl5pod "data" "Typeglobs") # (find-pl5pod "data" "local *FH; # not my!") # (find-pl5pod "ref") # (find-pl5pod "sub") # (find-pl5pod "mod" "Symbol Tables") # (find-pl5pod "func" "=item ref EXPR") # (find-pl5pod "func" "=item bless") # (find-pl5pod "obj" "bless") # (find-pl5pod "func" "=item eval EXPR") # (find-pl5pod "func" "eval { $x }; # CASE 4") # (find-pl5pod "func" "=item my EXPR") # (find-pl5pod "func" "=item local") # (find-pl5pod "sub" "=head2 Temporary Values via local()") # (find-pl5pod "sub" "=head2 Private Variables via my()") # (find-pl5pod "func" "=item use Module") perl <<'---' print "foo\n"; --- perl <<'---' my $a = 12; eval 'print "$a"; $a = 25'; print "$a\n"; --- perl <<'---' use strict; my $a = 12; print "$a\n"; --- perl <<'---' use strict; sub foo { return eval $_[0]; } my $a = 12; local $b = 25; $::c = 30; print((foo '$a'), (foo '$b'), (foo '$c'), "\n"); --- # (find-pl5pod "diag" "requires explicit package name") # (find-pl5pod "mod" "=head2 Packages") # (find-pl5pod "func" "=item use Module") # (find-pl5pod "func" "=item require") # (find-pl5pod "func" "=item do") # (find-pl5pod "func" "=item import") # (find-pl5pod "func" "=item package") # (find-pl5pod "var" "=item %INC") Idéias: posso ou switchar imediatamente para a package Main ou usar o 'do'. perl <<'---' use Data::Dumper; sub wdump { print "\n$_[0] :\n", Dumper($_[1]); } wdump '%::', \%::; wdump '%INC', \%INC; --- ###### # # "#!"-files # ###### # (find-fline "~/PERL/lasagna") # (find-fline "~/PERL/lasagna2") cd /home/root/PERL/ cat > lasagna <<'---' #!/usr/bin/perl use Data::Dumper; print Dumper([$0, @ARGV]); --- chmod 755 lasagna cat > lasagna2 <<'---' #!/home/root/PERL/lasagna woo bletch --- chmod 755 lasagna2 lasagna2 foo bar lasagna2 '' # Local Variables: # coding: utf-8-unix # End: