Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^5: lhs substr(): refs vs. scalars

by BrowserUk (Pope)
on Oct 09, 2005 at 04:33 UTC ( #498507=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    P:\test>c:\perl561\bin\perl5.6.1.exe \bin\p1.pl
    perl> $bigScalar = 'the quick brown fox jumps over the laxy dog';;
    ...
    dog
    dog
    dog
    
  2. or download this
    perl> $bigScalar = 'the quick brown fox jumps over the laxy dog';;
    
    ...
    the
    laxy
    dog
    
  3. or download this
    P:\test>c:\perl5.8.5\bin\perl5.8.5.exe \bin\p1.pl
    perl> $bigScalar = 'the quick brown fox jumps over the laxy dog';;
    ...
    r th
     la
    y do
    
  4. or download this
    perl> $s = 'abcde';;
    perl> $lv = \ substr $s, 1, 3;;
    ...
    perl> print $$lv;;
    123                   ## The lvref stil refers to a 3 char substring.
                          ## this could be adjusted to reflect the new len
    +gth.
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (2)
As of 2021-10-17 05:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (71 votes). Check out past polls.

    Notices?