Please put code or c-tags ( <c> and </c> ) around your code
The first line gets the name with which the script was started and throws away everything up to the last '/', i.e. any path components. s is a normal substitution regex, just with the delimiter '@' instead of '/'
The second line has a syntax error (was it .../^chipcore/;' ? Maybe a result of you not using code tags). If the string $_ starts with the word chipcore, $arg is set to 1 and the first value of @ARGV (or in a subroutine @_) is shifted off and put into $chipcore
Third and fifth line: Did you read the documentation of (probably) XML::utils ? If not, do it
The fourth line interpolates some values into a string that probably continues after that, because there is no ending delimiter
| [reply] [d/l] |
This is not a forum for getting other people to do your homework for you. | [reply] |
I would be very thankful if you format it a bit clearly! | [reply] |
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:
- 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.
- 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...
- 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.
- 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.
- 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.
| [reply] [d/l] [select] |