in reply to Reading a array

I don't see anywhere where you are setting $_. If (as it appears) $_ is undef, then it won't match your regex and the while loop won't ever execute..

--

See the Copyright notice on my home node.

"The first rule of Perl club is you do not talk about Perl club." -- Chip Salzenberg

Replies are listed 'Best First'.
Re^2: Reading a array
by Bloodnok (Vicar) on Aug 08, 2008 at 13:27 UTC
    Further to davorq's most apposite observation, even if $_ had been defined, the $_ =~ is redundant since $_ =~ /RE/ and /RE/ are exactly equivalent.

    You might also want to use the standard strictures and warnings.

    I'm guessing something like this might be a little closer to what you want (to check that, for each tag in a list of tags, the tag body can be found in a named array of valid tag names - or some such) ...

    use strict; use warnings; . . sub validate_tag { # Assume tags passed as arg list while("@_" =~ /<(.+?)>/g) { print "Invalid tag $1 found" unless grep /(:?$1)/, @{$ARGV[1]} +; } } . .

    A user level that continues to overstate my experience :-))