Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation

Re^8: Pointers and References

by Leudwinus (Scribe)
on Nov 25, 2020 at 15:33 UTC ( #11124201=note: print w/replies, xml ) Need Help??

in reply to Re^7: Pointers and References
in thread Pointers and References

That's because 1,2,3 are literals which are read only. Use variables (sic) and you can change them in the loop. ;)

It took me a few times to understand this line based on the examples given further below but now this makes sense!

Replies are listed 'Best First'.
Re^9: Pointers and References
by LanX (Sage) on Nov 25, 2020 at 16:14 UTC
      So $x = 42 is as useful as 1 = 42

      I don't understand this statement. I can see where an expression like $x = 42 might be useful, but 1 = 42 can't possibly be useful because it won't compile.

      Update: Or do you mean "if $x is aliased to a literal value (e.g., 1), $x = 42 is equivalent to 1 = 42"? (Update: And specifically WRT to the for-loop here? I didn't look back far enough. :)

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

        > And specifically WRT to the for-loop here?

        yes, sorry I'm getting lazy these days.

        I have the feeling I'm heavily repeating myself over and over.

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        Wikisyntax for the Monastery

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (1)
As of 2023-06-06 02:24 GMT
Find Nodes?
    Voting Booth?
    How often do you go to conferences?

    Results (26 votes). Check out past polls.