Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

peg - Perl _expression_ (GNU) grep script

by Clarendon4 (Acolyte)
on Nov 14, 2008 at 18:00 UTC ( #723699=perlnews: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
        eg% peg /needle/i haystack
    
        eg% peg "!(/^=\w/ .. /^=cut/) and /whatever/" *pm
    
  2. or download this
        eg% peg  needle  haystack
        eg% peg /needle/ haystack
    
  3. or download this
        eg% peg -inHC1Tm1 FOO words.txt
        words.txt-420-    afloat
        words.txt:421:    afoot
        words.txt-422-    aforementioned
    
  4. or download this
        eg% cat haystack | peg -i needle
    
  5. or download this
        eg% peg -i needle
    
  6. or download this
        eg% peg -p "/\.p[ml]$/i" -M 48h whatever
    
  7. or download this
        $Peg_p{p} = 'pl:pm:t'; # peg_ini.pl
    
  8. or download this
        eg% peg -p p -M 2d whatever
    
  9. or download this
        eg% peg -z "/^sub \w+/" foo *pm
    
  10. or download this
        $Peg_z{p} = '/^(?:\s*sub\s+\w|=head|__(?:END|DATA)__)/'; # peg_ini
    +.pl
    
  11. or download this
        eg% peg chmod Temp.pm -nz p
        **** (331) sub _gettemp {
    ...
        545:    chmod(0700, $path);
        **** (645) sub _force_writable {
        647:  chmod 0600, $file;
    
  12. or download this
        # peg_ini.pl
        $Peg_longopt{'ignore-dir'} = sub {
    ...
            my $dir_name = shift @$argv_ref or die;
            unshift @$argv_ref, "-p", qq{ \$File !~ m:(^|/)$dir_name/: };
        };
    
  13. or download this
        eg% peg foo --ignore-dir CVS
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlnews [id://723699]
help
Chatterbox?
and the fog begins to lift...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (7)
As of 2017-12-15 21:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (443 votes). Check out past polls.

    Notices?