Pastie now auto-senses if line-wrap is a bad or good idea. Feedback?
## mark a section (Learn more)
#Example from http://reductivelabs.com/trac/puppet/wiki/Recipes/SimpleText #We've loaded these into our /etc/puppet/manifests/functions.pp #Having problems with this: #Replace a perl regexp with a string: define replace($file, $pattern, $replacement) { $pattern_no_slashes = slash_escape($pattern) $replacement_no_slashes = slash_escape($replacement) exec { "/usr/bin/perl -pi -e 's/$pattern_no_slashes/$replacement_no_slashes/' '$file'": onlyif => "/usr/bin/perl -ne 'BEGIN { \$ret = 1; } \$ret = 0 if /$pattern_no_slashes/ && ! /$replacement_no_slashes/ ; END { exit \$ret; }' '$file'", } #My "\s" in the input pattern is being replaced with a single space. I need all white space represented including tabs.
This paste will be private.
From the Design Piracy series on my blog: