develooper Front page | perl.beginners | Postings from May 2007

Re: Passing arguments to subroutine

Thread Previous | Thread Next
May 31, 2007 07:15
Re: Passing arguments to subroutine
Message ID:
On 31 May 2007 01:27:26 -0700, Alma <> wrote:
-- snip --
>         unlink($file_path);
-- snip --

I'm aware that the question was already answered, but a generic tip
for the future.
You could try adding a statement like:
   print "Deleting $file_path\n";
to help debug and ensure the variable got set up properly. You can use
it to help track down the source of the problem.

Alternatively, you (and I) should learn how to use a Perl debugger ;)

@Chas: Good question... I'm fairly new to Perl and everything I know
is learnt off the web. I've done stuff like `&myFunction` for zero
param functions and going from that to `&myFunction()` isn't such a
I suspect one of the tutorials that Google or points to has
something in it that needs correcting.

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About