Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: $1, etc. are not just strings

by ikegami (Pope)
on Jan 04, 2007 at 16:49 UTC ( #592985=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub func {
       'b' =~ /(.)/;
    ...
    
    'a' =~ /(.)/;  func($1);    # Prints "b"
    'a' =~ /(.)/;  func("$1");  # Prints "a"
    
  2. or download this
    sub func {
       eval { die "bar\n" };
    ...
    
    eval { die "foo\n" };  func($@);    # Prints "bar"
    eval { die "foo\n" };  func("$@");  # Prints "foo"
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2014-12-27 02:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls