Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: function help

by starbolin (Hermit)
on Jun 03, 2008 at 16:34 UTC ( #689934=note: print w/replies, xml ) Need Help??


in reply to function help

moritz gives good advice but I will word it stronger: Don't call find from inside find! There is no need and you run the risk of clobbering your variables ( though this is fixed in new versions of find. )

This:  $size1 += -s is wrong. Since $size1 wasn't declared with my, $size1 is not local to the subroutine and will only contain '0' once, being incremented each time your callback is called. There's no real need to set any variable, just do:  print $File::Find::name if not -s; inside your callback.


s//----->\t/;$~="JAPH";s//\r<$~~/;{s|~$~-|-~$~|||s |-$~~|$~~-|||s,<$~~,<~$~,,s,~$~>,$~~>,, $|=1,select$,,$,,$,,1e-1;print;redo}

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://689934]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2022-09-29 07:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer my indexes to start at:




    Results (125 votes). Check out past polls.

    Notices?