Perl
To substitute text in files in place:
perl -p -i.bak -e 's/old_value/new_value/g;' (file filter)
To install CPAN modules:
perl -MCPAN -e 'install Chocolate::Belgian'
Use the CPAN shell:
perl -MCPAN -e 'shell'
To set values in the configuration (in the CPAN shell)
o conf urllist shift (removes the top value)
o conf urllist push
To match a regex across multiple lines:
$string =~ m/(regex)/s;
OR
undef $/
open( FILE, $name );
$file = <FILE>;
$file =~ m/(regex)/;
Updated Jun 14, 2010
|