if ($prodContent !~ '404') { print "$prodURLn"; #PRODUCTION MAIN CONTENT if ($prodContent =~ /(.*)(<div class="popup-container)(.*)(<!-- /CONTENT FILE -->s*</div>)(.*)/s) { # Content copy $mainContent = $prodContent; $mainContent =~ s/(.*)(<div class="popup-container)(.*)(<!-- /CONTENT FILE -->s*</div>)(.*)/${2}${3}${4}/s; $mainContent =~ s//(us_english|us_spanish|canada_english|canada_french)[w|d|.|-|/]*.(gif|jpg|png)/@imglib@${&}/gs; $mainContent =~ s//(us_english|us_spanish|canada_english|canada_french)[w|d|.|-|/]*.(js|css)/@doclib@${&}/gs; $mainContent =~ s//(us_english|us_spanish|canada_english|canada_french)/javascript/jquery-1.2.6.js/@doclib@${&}/gs; &setContent("Main Content", $mainContent); } else { &setContent("Main Content", "$prodContent"); } # Rest of code... }quick.pl
I keep a file like quick.pl on my desktop at all times. In XP, I create a shortcut to the program in the start menu, and assign it a shortcut key of Ctrl+1. In Vista, I put it first in the quick launch bar, which allows me to use
+ 1. The value is always having an easy-to-reach, editable script that will perform whatever monotonous functions I have to do: get images, change URL paths, escape HTML, etc.
#!/usr/bin/perl #use strict; use Win32::Clipboard; use WWW::Mechanize; use HTTP::Cookies; ## CLIPBOARD $CLIP = Win32::Clipboard(); $clipboard = $CLIP->GetText(); #MECHANIZE $mech = WWW::Mechanize->new(); $mech->agent_alias( 'Windows IE 8' ); $mech->cookie_jar(HTTP::Cookies->new()); #Win32::Clipboard let's us pull data straight from the clipboard, #like copied URLs, etc. It also lets us put it back there after #we do something with that content. #WWW::Mechanize automates interactions across HTTP #So, we can create quick scripts that will pull URLs from the #clipboard, modify the content, or segments of content, and #put that modified content back into the clipboard so we can #paste it wherever we want to. #This is awesome for comparing web pages, changing image paths #in a CMS system, etc.

