Perl value is not sticking -


i know missing simple here, can't figure out , google not working

i trying use value $f not working. leave out of code. error saying $f requires specific package name

sub capturefile() {     $f = $file::find::name;     if ($f = ~/txt$/)     {       $f=~ s:(.*)(\/reports\/.*):$2:;       loadenvironmentproperties($f);     }  }    sub loadenvironmentproperties()  {     print $f;  } 

always use strict; use warnings;!

you try specify $f argument

loadenvironmentproperties($f);                           ^^ 

to function declared has no parameters

sub loadenvironmentproperties()                              ^^ 

and never read arguments in loadenvironmentproperties. want:

sub loadenvironmentproperties {    ($f) = @_;    print $f; } 

Comments

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -