LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   perl command line option question (https://www.linuxquestions.org/questions/programming-9/perl-command-line-option-question-42350/)

afshin 01-21-2003 08:16 PM

perl command line option question
 
I'm trying to execute commands using the "-e" command line option on a perl module, however the commands in question are "next" and "sort" which appear to be a reserved word in perl, thereby causing problems. For example, when I execute:

perl -MXmms -e sort

I get:

sort is now a reserved word at -e line 1.

Or if I execute:

perl -MXmms -e next

I get:

Can't "next" outside a loop block at -e line 1.

I've tried putting single- and double-quotes around the commands, but to no avail. How can I get around this problem without actually changing the source code?

Thanks.

Afshin

mire 01-22-2003 04:39 PM

if those subs are in that module and that module and you can call it non object-oriented way than just do Xmms::sort, Xmms::next and so on.

afshin 01-22-2003 08:16 PM

Thanks mire! That did it.


All times are GMT -5. The time now is 01:57 PM.