Hi All,

I need to pass the result of prepare statement as an argument to the
subroutine.


sub abc()
{
        my $self= shift;
        my($id,$title) = @_;
        my $sth1= $databasehandle->prepare("select file_path from xyz
where id='$id' and title like '$title'");
        my $res = $sth1->execute();

        my @row = $sth1->fetchrow_array;
        print @row;


        &deleteposter_file(@row);

}

#-----------------Deletes from the File system

sub delete_file()
{
        my $self = shift;
        my $file_path = @_;

# extract the file name
#       my @parts = split('\/',$file_path);
#       my $file =$parts[$#parts];
#       #unlink($file);
#       if( -e "file" ) {
#       system("rm $file_path");

        unlink($file_path);
}


abc is calling delete_file() . where it need to delete the file stored
at the location mentioned in file_path.

Its not giving me an error but its not deleting the files from the
location.

Any help.....

Thanks in advance.
Alma


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to