in reply to Re: Re: Re: How to make perl accept symbol open/close bracket?
in thread How to make perl accept symbol open/close bracket?

Thanks for your guideline.
Here is the way that I tested. In unix command prompt.

# perl multi.pl a b ccc-ddd_eee\ > fff:ggg.hhh, iii(jjj)lllll /sbin/sh: Syntax error: `(' is not expected. #
  • Comment on Re: Re: Re: Re: How to make perl accept symbol open/close bracket?
  • Download Code

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: How to make perl accept symbol open/close bracket?
by cfreak (Chaplain) on Jun 30, 2003 at 17:13 UTC

    Your own error message is from your shell

    /sbin/sh:
    That's the program that produced the error message. Perl never sees the argument. The part before the ":" in your error message is always the calling program. If Perl was having a problem you would see 'perl' or '/usr/bin/perl' or somesuch there.

    You need this:
    #perl multi.pl "a b ccc-ddd_eee\ > fff:ggg.hhh iii(jjj)lllll"

    Or

    #perl multi.pl a\ b\ ccc-ddd_eee\\\n\ fff:ggg.hhh\ iii\(jjj\)lllll

    Note that I escaped the spaces too as I assume you want to pass your program just one argument, while the spaces create multiple arguments.

    Lobster Aliens Are attacking the world!