Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: lhs substr(): refs vs. scalars

by BrowserUk (Pope)
on Oct 08, 2005 at 17:06 UTC ( #498434=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @decoded = unpack '...', substr $bigscalar, $offset, $size;
    
    ...
    
    # or
    substr( $bigscalar, $offset, $size ) = pack '...', @newValues;
    
  2. or download this
    my $replacement = pack '...', @newValues;
    
    substr( $bigScalar, $offset, length $replacement ) = $replacement;
    
  3. or download this
    ## Create a scalar
    perl> $bigScalar = 'the quick brown fox jumps over the laxy dog';;
    ...
    ## The typo is now corrected.
    perl> print $bigScalar;;
    the quick brown fox jumps over the lazy dog
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://498434]
help
Chatterbox?
[LanX]: it's up to the Supreme commander
[GotToBTru]: we don't have one of those ;)
[LanX]: commander in chief whatever
Discipulus fears to ears this in German..
[LanX]: missing for month
[LanX]: D : Oberbefehlshaber
[GotToBTru]: yeah, thats the story I remember. some card the President is supposed to carry around at all times

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (9)
As of 2017-01-20 12:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (174 votes). Check out past polls.