[Chicago-talk] Bareword found where operator expected

Richard Reina richard at rushlogistics.com
Mon Mar 8 05:27:50 PST 2010


I was hoping someone might help me figure out why this simple three line program won't work.

If I do:

#!/usr/bin/perl -w

use strict;
system("gnome-terminal -x perl -e 'print "Hello World\n"; sleep 4;'");

I get:

Bareword found where operator expected at test.pl line 5, near ""gnome-terminal -x perl -e 'print "Hello"
	(Missing operator before Hello?)
String found where operator expected at test.pl line 5, near "n"; sleep 4;'""
syntax error at test.pl line 5, near ""gnome-terminal -x perl -e 'print "Hello World"
Execution of test.pl aborted due to compilation errors.


What is especially confusing to me is that if I type in:

gnome-terminal -x perl -e 'print "Hello World\n"; sleep 4;

at the command line, it works.  I am running linux.

Any help would be greatly appreciated.

Richard


More information about the Chicago-talk mailing list