in reply to Re: Backreferences
in thread Backreferences
"...syntax errors."
#!/usr/bin/env perl use strict; use warnings; my $line; print "\n"; $line = '<a href="http://www.mysite.com/" target="_blank">'; $line =~ /\shref=(["'])?([^\s\>\1]+)/; # FIRT MATCH if ( defined $1 ) { print "\$1= $1\n"; } else { print "1) not defined\n"; } if ( defined $2 ) { print "\$2= $2\n"; } else { print "2) not defined\n"; } print "\n"; $line =~ /\shref=(["'])?([^\s\>"']+)/; # SECOND MATCH if ( defined $1 ) { print "\$1= $1\n"; } else { print "1) not defined\n"; } if ( defined $2 ) { print "\$2= $2\n"; } else { print "2) not defined\n"; } __END__ karls-mac-mini:playground karl$ perl -c testomato.pl testomato.pl syntax OK
Apparently not. How did you jump to this conclusion?
«The Crux of the Biscuit is the Apostrophe»
perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Backreferences
by soonix (Chancellor) on Jan 07, 2018 at 11:57 UTC | |
|
Re^3: Backreferences
by karlgoethebier (Abbot) on Jan 07, 2018 at 12:17 UTC |