Re: script to create to create tar and place files in the appropriate folder

2011-05-31 Thread Agnello George
>push @files, @dirfiles; >} > >return { >src_uri => $src_uri, >dest_uri => $dest_uri, >files => \@files >}; > } > > sub prompt_to_continue > { >my ($instructions) = @_; >print Dumper $instructions; >print "Continue? (yes/no) "; >exit(1)

Re: script to create to create tar and place files in the appropriate folder

2011-05-31 Thread Uri Guttman
> "JWK" == John W Krahn writes: JWK> Uri Guttman wrote: >>> "JWK" == John W Krahn writes: >> >> that is called 4 arg substr and it is way underused in perl. this >> benchmark shows the significant speedup of about 2x: >> >> >> use Benchmark qw( cmpthese ) ; >> >>

Re: script to create to create tar and place files in the appropriate folder

2011-05-31 Thread John W. Krahn
Uri Guttman wrote: "JWK" == John W Krahn writes: JWK> Or as: JWK> $_ = "$directory/$_" for @dirfiles[ 1 .. $#dirfiles ]; just to show another way that is usually faster for prepending a string: substr( $_, 0, 0, "$directory/" ) for @dirfiles[ 1 .. $#dirfiles ]

Re: script to create to create tar and place files in the appropriate folder

2011-05-31 Thread Uri Guttman
> "BM" == Brandon McCaig writes: BM> On Tue, May 31, 2011 at 4:34 PM, Uri Guttman wrote: >> just to show another way that is usually faster for prepending a string: >> >>        substr( $_, 0, 0, "$directory/" ) for @dirfiles[ 1 .. $#dirfiles ]; >> >> that is called 4 arg subst

Re: script to create to create tar and place files in the appropriate folder

2011-05-31 Thread Brandon McCaig
On Tue, May 31, 2011 at 4:34 PM, Uri Guttman wrote: > just to show another way that is usually faster for prepending a string: > >        substr( $_, 0, 0, "$directory/" ) for @dirfiles[ 1 .. $#dirfiles ]; > > that is called 4 arg substr and it is way underused in perl. this > benchmark shows the

Re: script to create to create tar and place files in the appropriate folder

2011-05-31 Thread Brandon McCaig
On Tue, May 31, 2011 at 4:23 PM, John W. Krahn wrote: > Just a couple of comments on some of your code.  :) > *snip* >>     @lines = @lines[$start_line..$#lines]; > > You are copying almost all of @lines to @lines when you should be using > perl's built-in functions to just remove elements from @l

Re: script to create to create tar and place files in the appropriate folder

2011-05-31 Thread Uri Guttman
> "JWK" == John W Krahn writes: JWK> Or as: JWK>$_ = "$directory/$_" for @dirfiles[ 1 .. $#dirfiles ]; just to show another way that is usually faster for prepending a string: substr( $_, 0, 0, "$directory/" ) for @dirfiles[ 1 .. $#dirfiles ]; that is called 4

Re: script to create to create tar and place files in the appropriate folder

2011-05-31 Thread John W. Krahn
Brandon McCaig wrote: Hello, Just a couple of comments on some of your code. :) my $start_line = 2; unless($lines[1] =~ /^\s*$/) { warn "The second line isn't empty" ; $start_line--; } @lines = @lines[$start_line..$#lines]; You are copying a

Re: script to create to create tar and place files in the appropriate folder

2011-05-31 Thread Brandon McCaig
On Tue, May 31, 2011 at 2:15 AM, Agnello George wrote: > i am given ever day a list of files  which i wget  within a parent folder . > > my  team gives me    a structure where theses files are located *snip* > using the above data given to me  i check whether the files exist  and if > they do i do

Re: script to create to create tar and place files in the appropriate folder

2011-05-31 Thread Agnello George
> 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 g

Re: script to create to create tar and place files in the appropriate folder

2011-05-31 Thread Rob Dixon
On 31/05/2011 07:15, Agnello George wrote: HI i am given ever day a list of files which i wget within a parent folder . my team gives mea structure where theses files are located cat /home/upload_files1.txt download the files form wget http://localserver/website1 and

Re: script to create to create tar and place files in the appropriate folder

2011-05-31 Thread shawn wilson
On May 31, 2011 2:16 AM, "Agnello George" wrote: > > HI > > > i am given ever day a list of files which i wget within a parent folder . > > my team gives mea structure where theses files are located > > > cat /home/upload_files1.txt > download the files form wget http://loc

script to create to create tar and place files in the appropriate folder

2011-05-30 Thread Agnello George
HI i am given ever day a list of files which i wget within a parent folder . my team gives mea structure where theses files are located cat /home/upload_files1.txt download the files form wget http://localserver/website1 and upload on http://prodserver/weebsite1 index.