Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

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?

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (13)
As of 2016-07-01 14:05 GMT
Find Nodes?
    Voting Booth?
    What is your favorite alternate name for a (specific) keyboard key?

    Results (1 votes). Check out past polls.