> ls >> >> index.php 123.php dual.templ dual_2.templ go.php data.txt >> >> i need to create a tar of this in the same given format >> >> index.php >> dualfilder/dual.templ dual_2.templ >> go/go.php >> go/numbers/123.php >> data/data.php >> >> >> i cant seem to come up with a a logic on how to get this done .. can some >> one help me kick start a idea on how to preceded . >> > > From what you have written, it sounds like you have already got the > download part in place. (If not, or you would like to take a walk > through your code, then please post again.) > > You are best off using an established module to write the tar file > (indeed, unless you are already committed to it, you should use the Perl > LWP module over calls to wget) and Archive::Tar works just fine. > > For instance: > > use strict; > use warnings; > > use Archive::Tar; > > my @tarfiles; > > > # Download remote files and push them onto the @tarfiles array. > > Archive::Tar->create_archive('tarfile.tar', undef, @tarfiles) or die > Archive::Tar->error; > >
the difficult part is not taring the file but to recreate the folder structure in the same format when i wget all the files from the local server i get all of them under one folder /temp ls index.php dual.templ dual_2.templ go.php 123.php data.php but i need to tar it in such a way that the folder structure is preserved like this index.php dualfilder/dual.templ dualfilder/dual_2.templ go/go.php go/numbers/123.php data/data.php -- Regards Agnello D'souza