Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Re: Re: Interchanging hash values

by BrowserUk (Patriarch)
on Apr 20, 2003 at 00:50 UTC ( [id://251749]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $s = 'the quick brown fox';
    substr($s, 10, 0) = 'light-';          # result: 'the quick light-brow
    +n fox'
    substr($s, -3, 0) = 'female ';         # result: 'the quick light-brow
    +n female fox'
    substr($s,  0, 0) = 'I saw ';          # result: 'I saw the quick ligh
    +t-brown female fox'
    substr($s, -0, 0) = ' cross the road'; # ' cross the road.I saw the qu
    +ick light brown female fox' :(
    
  2. or download this
    sub insert_end_relative{
        my ($string, $pos, $insert) = @_;
    ...
        ? substr($string, -$pos, 0) = $insert 
            : $string .= $insert;
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2024-04-25 13:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found