The filename of any file dragged onto a droplet is stored in @ARGV, so all
you need to do is
$filename = $ARGV[0];
open(FILE, $filename) or die $!;
while(<FILE>) {
.....
}
> hi
> is it possible in macperl to save a basic script as a droplet and when i
> drag a txt-file over the droplet the file will be read as input,
> somthing like this (were the droplet itself should detect the file input)
>
> open (FILE, <STDIN>) or die $!;
> while (<FILE>) {
> s/a/abc/g;
> print;
> }
>
>
> thanks
> allan
- [MacPerl] droplet - input allan
- Re: [MacPerl] droplet - input Adam Witney
- Re: [MacPerl] droplet - input Bart Lateur
- Re: [MacPerl] droplet - input Bill Becker
- Re: [MacPerl] droplet - input Bart Lateur
