Lamby's second postulate is, of course, don't use Perl unless absolutely necessary. For example, this 41-line script can easily be written as:

#!/bin/sh
while [ -n "$1" ]; do
   curl -F upload=@"$1" http://192.168.0.251/
   shift
done

Recursive file adding then achieved using the GNU findutils. Relax, it's the UNIX way.

§

Tags: GNU/Linux
Planets: UWCS WUGLUG

§

Two comments

  1. Although I agree with what you're saying, I have to point out that you're being a little harsh calling it a 41 line script. I count 20 lines of code there. The rest is the GPL and whitespace!
    However, nice going on teh bash, bro! I've never really used cURL.

    Jonny Lamb

  2. hi i enjoyed the read

    Taliyah

Reply

§