Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl -w
- use strict;
- $_ = 'The HAL-9000 requires authorization to continue';
- my $search_pattern1 = 'HAL-[\d]+';
- print "\$_ = $_\n";
- print "\$search_pattern1 = $search_pattern1\n";
- if (/$search_pattern1/) {
- print "The string mentions some model of HAL computer.\n";
- # print "Matching Character: '$1'\n";
- }
- else {
- print "It failed to match!\n";
- print "$!\n";
- }
- print "done.\n";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement