in reply to Still having problems with user 'backup' script

If you use use strict;, you have to declare all variables with 'my', e.g.
#! /usr/bin/perl use strict; my $var; $var = 'Hello World'; print $var,"\n";


To copy files I would recommend to use File::Copy or File::NCopy

Replies are listed 'Best First'.
Re^2: Still having problems with user 'backup' script
by davorg (Chancellor) on Dec 02, 2004 at 11:44 UTC
    If you use use strict;, you have to declare all variables with 'my',

    That's a bit of an over-simplification. See the discussion of use strict 'vars' in perldoc strict.

    This generates a compile-time error if you access a variable that wasn't declared via our or use vars, localized via my(), or wasn't fully qualified.

    Using my is only one of a number of ways to satisfy use strict 'vars' - albeit the most common.

    --
    <http://www.dave.org.uk>

    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg