... if there is quotes inside the job part, it will remove those quotes.

Command line arguments are processed first by the command line interpreter (CLI) of the OS you're using, the "shell', e.g., sh, bash, etc. (I'm assuming you're running under *nix). It is the OS CLI that's "removing" quotes before Perl ever sees the command line arguments. E.g., your command line might have been
    my_script.pl '--option1' '--option2' '--job' 'some_job.pl' '-option1' 'some_job2.pl -x abc' '-option2'
and the @ARGV dump from within Perl would have been exactly the same. (Update: For example, here's something from Windoze — I don't have access to *nix ATM:

Win8 Strawberry 5.8.9.5 (32) Sat 06/19/2021 14:21:47 C:\@Work\Perl\monks >perl -MData::Dump -e "print qq{>$_< } for @ARGV" -- foo bar "baz \"ba +ff\" zip" >foo< >bar< >baz "baff" zip< Win8 Strawberry 5.8.9.5 (32) Sat 06/19/2021 14:23:37 C:\@Work\Perl\monks >perl -MData::Dump -e "print qq{>$_< } for @ARGV" -- "foo" "bar" "baz +\"baff\" zip" >foo< >bar< >baz "baff" zip<
This even has escaped double-quotes embedded in one of the arguments. As you can see, the strings derived from the command line arguments are exactly the same within Perl.)

Why do you need to know if a command line argument was originally quoted or not? (Update: IOW, why not just assume that all the command line options were quoted. What difference would it make?) This sounds very much like an XY problem.

I want to get user's command and execute it at some point. It could have parameters and I don't want the user to insert it into file first.

I don't understand what you are trying to do here and what problem you're trying to overcome.


Give a man a fish:  <%-{-{-{-<


In reply to Re: @ARGV ignores quotes (updated) by AnomalousMonk
in thread @ARGV ignores quotes by ovedpo15

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.