Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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 having an uproarious good time at the Monastery: (6)
As of 2016-10-01 09:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (575 votes). Check out past polls.