This piece is as much an aide de memoire for myself as anything else but putting it here seems worthwhile if it answers questions for others. The binding operators, =~ or !~, come in handy when you are framing conditional statements in Perl using Regular Expressions, for example, testing whether x =~ /\d+/ or not. The =~ variant is also used for changing strings using the s/[pattern1]/[pattern2]/ regexp construct (the “s” stands for “substitute”). What has brought this to mind is that I wanted to ensure that something was done for strings that did not contain a certain pattern and that’s where the !~ binding operator came in useful; ^~ might have come to mind for some reason but it wasn’t what I needed.
Topics Discussed
Adobe Blog Blogging Canon Command Line CSS Debian Fedora Firefox GNOME Google hard drive Hardware HTML Installation Internet Explorer JavaScript Linux Microsoft MySQL openSUSE Opera Operating System Perl Photoshop Photoshop Elements PHP SAS Software Ubuntu UNIX upgrade VirtualBox Virtualisation Virtual Machine Vista VMware Web Browsers Windows Windows XP WordPress WordPress.com WordPress plugins XHTML XP
Twitter Updates
- Delicious: Symphony. http://ow.ly/16Nhwe 8 hrs ago
- Delicious: Halogy | Brandable, Hosted CMS for Designers, Developers and Agencies http://ow.ly/16Ngze 9 hrs ago
- GR Shared Items: "SAS Talks" is home http://ow.ly/16N27w 23 hrs ago
- Delicious: WebAIM: "Skip Navigation" Links http://ow.ly/16MSBm 1 day ago
- Delicious: HTML 5 Outliner http://ow.ly/16MSBn 1 day ago
- More updates...
Archive for May 20th, 2009
About Perl’s Binding Operator
Wednesday, May 20th 2009
Topics: Scripting
Tags: binding operator, binding operators, conditional statements, Perl, regular expression
Tags: binding operator, binding operators, conditional statements, Perl, regular expression