http://www.perlmonks.org?node_id=99116


in reply to Re: passing arguments to subroutine
in thread passing arguments to subroutine

More than one mistake in that code. I'd like to say that I left that mkdir check out because the code is still in the beginning stages, but I like to think of myself as an honest guy.

mkdir("$i/controlpanel", 0755) or die "Problems making dir : $!\n" unl +ess ( -d "$i/controlpanel" ); system("cp -fRp $dir/controlpanel") or die "Problems copying dir : $!\ +n";

better?

humbly -c

Replies are listed 'Best First'.
(redmist) Re: Re: Re: passing arguments to subroutine
by redmist (Deacon) on Jul 24, 2001 at 00:29 UTC

    All the more reason for you to check your mkdir if the code is in it's beginning stages. You want to throw all the sanity checking devices that you can think of in your code (especially beta code).

    redmist
    Silicon Cowboy
Re: Re: Re: passing arguments to subroutine
by PrakashK (Pilgrim) on Jul 24, 2001 at 00:43 UTC
    Change:
    system("cp -fRp $dir/controlpanel") or die "Problems copying dir : $!\ +n";
    To:
    system("cp -fRp $dir/controlpanel") == 0 or die "Problems copying dir +: $!\n";
    system returns the exit status of the program being run, and the programs conventionally return 0 (zero) on success.