in reply to I have Values stored in array within Hashes, Can't really call one @ a time

my( @cpp , @php, @perl );

find ( ... \&test );

print join "\n", @cpp, "\n";

sub test {

push @cpp, $File::Find::name if is_cpp($File::Find::name);

push @perl, $File::Find::name if is_perl($File::Find::name);

push @php, $File::Find::name if $File::Find::name if is_php( $File::Find::name );

...

or

ack --help type

my @perl = qx{ack --perl "$startdir"};

my @php = qx{ack --php "$startdir"};

my @cpp = qx{ack --cpp "$startdir"};

  • Comment on Re: I have Values stored in array within Hashes, Can't really call one @ a time

Replies are listed 'Best First'.
Re^2: I have Values stored in array within Hashes, Can't really call one @ a time
by KroKite (Initiate) on May 11, 2012 at 17:36 UTC
    Could not really get how i can utilise with push,.. ack is useful with -w, but doesnot really fulfill my criteria.... Actually I would prefer grep, ... Just finding way to restrict the result..

      Could not really get how i can utilise with push,..

      what do you mean? You write a function  is_cpp that takes a filename as argument, and then it performs checks on the filename to determine if its cpp

      ack --perl --files-with-matches . /path/