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

Re: LVALUE refs

by xmath (Hermit)
on Feb 16, 2003 at 14:09 UTC ( [id://235725]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $x = \substr("blah", 1, 2);
    $y = \substr("florp", 1, 3);
    print "$$x $$y\n";
    
  2. or download this
    sub substrref { \substr($_[0], $_[1], $_[2]) }
    $x = substrref("blah", 1, 2);
    $y = substrref("florp", 1, 3);
    print "$$x $$y\n";
    
  3. or download this
    sub substrref { eval '\substr($_[0], $_[1], $_[2])' }
    $x = substrref("blah", 1, 2);
    $y = substrref("florp", 1, 3);
    print "$$x $$y\n";
    

Log In?
Username:
Password:

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

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

    No recent polls found