Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: @ARGV ignores quotes [ZERO WIDTH SPACE]

by kcott (Archbishop)
on Jun 19, 2021 at 23:28 UTC ( [id://11134046]=note: print w/replies, xml ) Need Help??


in reply to Re: @ARGV ignores quotes
in thread @ARGV ignores quotes

G'day hrcerq,

"I hope I'm not saying anything stupid, but is ​ a subroutine call?"

There's certainly nothing "stupid" in your question. I was going to comment on that directly myself before scrolling down and seeing your post.

The ​ is an HTML entity reference: a code which references a specific character. This is its decimal form. You may also see this in its hexadecimal form, ​, or as a named entity, ​. It is the Unicode® ZERO WIDTH SPACE (U+200B) character — the PDF code chart "General Punctuation Range: 2000–206F" has details; "Wikipedia: Zero-width space" has further discussion.

How that got into the presented code — perhaps an artefact of a word processor used to write the code; maybe copied from an email; or whatever — is immaterial. The fact that the OP didn't check the Preview before posting (also note the obvious, broken <{line-break}/code> end tag) is of much more concern to me: what other problems exist in the code (not shown) that the OP may not have bothered to check either.

"If so, isn't this notation deprecated?"

The notation is not so much "deprecated" as syntactically incorrect. Note that the following did not need the strict or warnings pragmata for the compilation to be aborted.

$ perl -e ' my $job_flag = 0; foreach my $i (0..$#ARGV) { &#8203;$opt{"job"} .= $ARGV[$i]." " if($job_flag); &#8203;$job_flag = 1 if($ARGV[$i] =~ /^(\-\-|\-)job$/); &#8203;undef $ARGV[$i] if($job_flag); } ' Number found where operator expected at -e line 4, near "&#8203" (Missing operator before 8203?) Number found where operator expected at -e line 5, near "&#8203" (Missing operator before 8203?) Number found where operator expected at -e line 6, near "&#8203" (Missing operator before 8203?) syntax error at -e line 4, near "&#8203" syntax error at -e line 5, near "&#8203" syntax error at -e line 6, near "&#8203" Execution of -e aborted due to compilation errors.

The OP did not run this code!

Updates: I had some issues with the title of this post; three versions tried; see "What are the formatting rules for the "Title" of posts?" for details. I'd also fixed a copy/paste error: the first line of the code I posted ($ perl -e ') was originally missing.

— Ken

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11134046]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2024-03-28 18:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found