scalar variable in system command function

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

I have an odd problem with the $file variable listed in the loop below
the syntax of unix split command is as follows:
Usage: split [OPTION] [INPUT [PREFIX]] and split will default to "x" as a

here is the output of this script (i ^c it)
found file rallen.tar.gz
error splitting file rallen.tar.gz
:2 at ./perl-ATSDailyback line 49.

it remembers the $file variable before and after the system command runs,
but it doesnt add "$file." as a prefix

any thoughts?
thanks in advance  


use strict;
use warnings;
use Sys::Hostname;
use POSIX qw/strftime/;

my $error ;
my @errors;
my @filestobackup;
#  Variables.  This section will need to be modified for each Cooperative.

my $host = hostname;
my $jobstart = localtime();
my $fileformat = strftime('contents-%Y-%m-%d_%H:%M:%S', localtime);
my $contentsfile = "/etc/backup/$fileformat";
my $errorfile = '/tmp/cpioerrors';
my @dirs = ('/working');
my $finderrors = '/tmp/finderrors';
my @largefiles;
#my @tapestat = `mt -f /dev/st0 status`;
#if (scalar(@tapestat) == 0)    {
#       print "No tape in drive or no tape device on server\n";
#       exit 0;

foreach my $backupdir (@dirs)   {
        @largefiles = `find . -follow -size +2147483648c -print
        foreach my $file (@largefiles)     {
                $file =~ s/\.\///;
                print "found file $file";
                system("split -d --bytes=2000000000 $file $file.") == 0 or die
"error splitting file $file:$?";
@filestobackup = `find $backupdir -follow -print 2> $finderrors`;

Site Timeline