Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Could you explain me the following statements.

I personally believe that if the above is a question, then it should end with a question mark. If it is a question, then the answer is yes! If you want me to also explain you "the following statements" then I'll do so only in the order given by:

perl -MList::Util=shuffle -E "say shuffle 1..5"

You have to work out which is which, so some work is left to you, since this is not a helpdesk:

  1. This is part of code assigning a string to a lexical variable which is declared in the same statement. But the string is not closed, which is the reason why it's only a portion of code - i.e. as such it is not valid Perl. The string also seems to contain code which resembles but is not Perl - it misses the correct statement separator and sports an unknown operator.
  2. Assignment of a variable's value to another variable. The variables have the same name but (supposedly) live in different packages. The package the variable being assigned to lives in has a name which follows the convention Perl assigns to pragmatas, but which also sound dubious in that role...
  3. A variable is assigned the full path to the program and then stripped of everything that precedes the last slash in it, including the latter.
  4. A sub is called on a sub which is called on a literal string and on a variable. Both subs are called the "old" way, which is nowadays deprecated.
  5. This is not valid Perl, but it would be if you remove a spurious slash. If you remove it, then a variable is assigned either the first command line argument or the first argument passed to a sub (depending on whether the expression is inside a sub or not) if the special variable $_ begins with a given string. (Upon assignement, if it takes place, either the @ARGV or @_ array gets shifted) But then it strongly smells like another error, and if it is then a tilde is missing somewhere to the effect that the assignement takes place if a generic variable, instead of $_, begins with that given string.
--
If you can't understand the incipit, then please check the IPB Campaign.

In reply to Re: Meanigs of Expressions by blazar
in thread Meanigs of Expressions by Ravindra

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (5)
As of 2024-04-25 08:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found