Re: What is ++ operation

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Quoted text here. Click to load it

... It's hard to know how to answer the question well -- not because
it's not well-known, but because it's in any textbook on the language

For the immediate question, if your system has "man perlop" available,
you can do
    /Auto-increment and Auto-decrement
and get an explanation.
reaches the same explanation.

"Increment" means "increase by one", and "decrement" means "decrease
by one".

But because it's a simple question (though hard to do a Web search for
"++", I agree): I think you should probably get a Perl book.
called "the Camel Book" due to the animal on the cover
is recommended by most as a good introduction.  You might read pages
in order to learn, or look in the index for a specific question.

Tim McDaniel,

Re: What is ++ operation

[ What is ++ operation]

See "perldoc perlop":
 Auto-increment and Auto-decrement
   "++" and "--" work as in C. That is, [...]


Re: What is ++ operation

On 1/15/2015 20:46, Tim McDaniel wrote:
Quoted text here. Click to load it

Also, the position indicates whether it's a pre-inc/dec or a post-inc/dec.
EG: ++$x or --$xx vs $x++ or $x--

Re: What is ++ operation

On Thu, 15 Jan 2015 22:09:45 -0600, Paul Gekakis wrote:

Quoted text here. Click to load it

That is easy to determine:

[mgogala@medo ~]$ perl -e '$i=1; print ++$i."\n";'
[mgogala@medo ~]$ perl -e '$i=1; print $i++."\n";print "$i\n";'

That's a very simple DIY method to answer your question.

Mladen Gogala
The Oracle Whisperer
Je suis Charlie

Site Timeline