Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Rethrowing with die $@ considered harmful (local $_ buggy)

by ikegami (Pope)
on Jul 18, 2006 at 06:05 UTC ( #561931=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub dequote {
       local $_ = @_ ? $_[0] : $_;
    ...
       s/\\(.)/$1/g;
       return $_;
    }
    
  2. or download this
    use strict;
    use warnings;
    ...
    
    print dequote, "\n"
       foreach $var;
    
  3. or download this
    STORE "John \"Foo\" Bar"
    FETCH
    ...
    FETCH
    STORE
    Use of uninitialized value in print at 561931.pl line 25.
    
  4. or download this
    use strict;
    use warnings;
    ...
    dequote('"John \"Foo\" Bar"');
    
    print(pos(), "\n");
    
  5. or download this
    2
    Use of uninitialized value in print at 561931.pl line 18.
    
  6. or download this
    2
    2
    
  7. or download this
    sub dequote {
      #local $_ = @_ ? $_[0] : $_;   # XXX
    ...
       s/\\(.)/$1/g;
       return $_;
    }
    
  8. or download this
    STORE "John \"Foo\" Bar"
    FETCH
    John "Foo" Bar
    
  9. or download this
    2
    2
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://561931]
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 2019-11-22 17:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (113 votes). Check out past polls.

    Notices?