[ Content | View menu ]

Monthly Archive September, 2003

Search and Replace with Perl

September 30, 2003

# Sometimes you need to change something in a bunch of files at once. # These are some command-line ways of doing that. # For universal replacement (in all files down from the current directory): find ./ -type f -exec perl -pi -e \’s/stringtofind/stringtoreplacewith/g\’ {} ; # To do all “.php”s, for example: find ./ […]

code - Comments closed

ftp with perl

September 11, 2003

#!/usr/bin/perl -w # Yet another time when dependence on libraries bit me, I had to see if # I could manage an ftp script using the core perl libraries, so I wasn\’t # dependent on Net::FTP being present in the same form on the system. # This is just my proof of concept, developed with […]

code - Comments closed