Thanks for your help I couldn't get the grep methode to work but the regex works great. There shouldn't be any metacharactors to worry about.
I'm slowly learnig Perl, thanks again for your help.
Sean
: Hi,
:
: This line:
:
: : if ($a =~ m/@calls/)
:
: Is not doing what you think it is.
:
:
: my @a = ('foo', 'bar');
: my $regex = qr/@a/;
: print $regex; # prints (?-xism:foo bar):
:
: Basically, when you interpolate an array you do not (in Perl 5) get
: an alternation, just a space separated list of all the strings. So
: it won't match as you want it to. You could do something more like:
:
: my $calls_alt = join('|', @calls);
:
: And later:
:
: if ($a =~ m/$calls_alt/o) # o option = compile once
:
: Or perhaps safer (the regex solution breaks if any elements of your
: array are metacharacters) here's a non-regex solution:
:
: if (grep { $_ eq $a } @calls)
:
: Which is what I'd probably have done.
:
: Jonathan
: ###
: for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
: (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
: /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");