Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

(tye)Re: ref, no, maybe?

by tye (Sage)
on Jan 11, 2001 at 05:00 UTC ( [id://51042]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
            if ( ref( $value ) ) {                   # <- that's a ref!
                # We have multiple values for this key
    ...
                $value = uri_escape( $value, $cgi_chars );
                $query_string .= "$key=$value&";
            }
    
  2. or download this
            if ( ! ref( $value ) ) {
                $value = uri_escape( $value, $cgi_chars );
    ...
                    $query_string .= "$key=$array_value&";
                }
            }
    
  3. or download this
        if(  UNIVERSAL::isa( $r, "ARRAY" )  ) {
            # access @$r here
        } elsif(  UNIVERSAL::isa( $r, "HASH" )  ) {
            # access %$r here
    
  4. or download this
        if(  ref($r)  &&  "$r" =~ /(^|=)HASH/  ) {
    
  5. or download this
    sub method {
        my $self= shift;
        die "Invalid object" unless ref($self) eq "My::Package";
    
  6. or download this
        die "Invalid object" unless UNIVERSAL::isa( $self, __PACKAGE__ );
    # or
        die "Invalid object" unless eval { $self->isa(__PACKAGE__) };
    
  7. or download this
    if(  ref($r)  &&  "$r" =~ /=/  )
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-25 04:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found