I'm running Ubuntu 9.10, Eclipse 3.5.1.
I'm learning perl and I want to use eclipse as I worked as a java programmer for a few years and thats the IDE I know.
If I run this simple program from the command line it works fine, but if I run it from within Eclipse I get
Can't open *.pl: No such file or directory at /home/kieran/workspace/perldev/perl-grep.pl line 10.
Current directory is /home/kieran/workspace/perldev
my run config has perl-grep.pl and args new *.pl
as it runs from the command line ok I have to assume that this is a permissions issue perhaps?
I hope you help as I want to get on and work my way through other exercises in my perl book.
Heres my code, it looks for the word "new" in all perl programs in the current directory;
my $regex = shift @ARGV;
$dir = cwd();
print "Current directory is ".$dir."\n";
print "Regex is \n";
print if m/$regex/;
EPIC, unlike the shell, doesn't do any wildcard expansion on the command line arguments. So what your program receives as the argument is a literal "*.pl" string, which is obviously not a correct file name.
Thanks jploski, I appreciate that,
I'll just work out how to list all the *.pl files in the directory and do it that way instead.
Log in to post a comment.