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
Post a Comment