perl tips     
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

Number of readers
home
about me
blog archives
- docs
acroread
firefox
java
linux
mysql
perl
rpm
shell
vim
win

entertainment
experiences
funny lists
humor
intellectual
interests
mefi
music
opinions
photos
web designs
tools
software
webmaster help

Sign up
Enter your email address to be notified of new posts




Search the site







Random quote
(View all quotes)
"To see a need and wait to be asked is to already refuse."










Licensed under Creative Commons
(?) Choose theme:  X X X X X X


W3CCSS
Loaded in 0.0016 seconds