Jin Zhisong wrote:
The following code didn't work. ========================================================

    My $type = $ARGV[1]

    my $match = ( $type eq 'bcv' ) ? 'BCV' : 'RAID-5' ;
    my $pattern = ( $type eq 'bcv' ) ? "${match}\s+N\/Asst" :
"${match}\s+N\/Grp" ;
while ( <DATA> ) {
    next unless /$pattern/;
print $_ ; }

In addition to Tom's comment, you'd better add

    use strict;
    use warnings;

at the beginning of your script. That makes Perl give you an indication of what the problem is.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to