CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner:
unlink error trying to remove files



Mar 26, 2015, 11:53 AM

Post #1 of 2 (7961 views)
unlink error trying to remove files Can't Post

Trying to remove files from a directory using:

remove() { 
printf "\n\n"
printf "Removing old files, please wait ";
use strict;
use warnings;
my $dir = "$ENV{HOME}'C:\Users\cmccabe\Desktop\annovar'";
unlink glob "$dir/out_position.txt";
unlink glob "$dir/out_parse.txt";
printf "\n Old files removed, Goodbye! \n\n"; sleep 2 && exit

but getting an error. I am using the perl command as part of a bash menu in cygwin. Thank you :).


use: command not found 
my: command not found

Unlink extra operand /out_position.txt
Unlink extra operand /out_parse.txt

Veteran / Moderator

Mar 26, 2015, 12:07 PM

Post #2 of 2 (7956 views)
Re: [cmccabe1] unlink error trying to remove files [In reply to] Can't Post

Obviously using perl code directly in a bash script isn't going to work. Bash doesn't now how to execute perl code, but it can execute a perl script.

And, why do you have a beginner level question in the intermediate section? I'm moving this thread for you.


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives