Now the honest answer, is yes, you can use symbolic references, but you really really really don't want to.if( ( ${"MetaTag_$j"} !~ /description=/gi) && ( ${"MetaTag_$j"} =~ /posted=/gi )) { ... }
Now how to avoid it, depends lots on how the $MetaTag_* variables are being generated. Are they coming in with CGI? Perhaps you could use an array?
Note also that I use !~ not !=~. !=~ will not work. !~ says this string does not match this pattern. =~ says this strings will match this pattern.my @MetaTags = (.....); foreach my $tag (@MetaTags) { if(($tag !~ /description/gi) && $tag =~ /posted=/gi)) { print qq{<font size=-1 color="#000000" face=arial,sans-serif>$ +Summary<br></font>}; } }
I use qq{...} instead of a here document because I feel that they look nicer.
For reasons why you don't want to use symbolic references look no further than that search button up the top. Really, there are way too many good posts on why for me to repeat them. Look here for an interesting start.
In reply to Re: Can I do this?
by jarich
in thread Can I do this?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |