Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: What should be returned in scalar context?

by jeffa (Bishop)
on Dec 02, 2003 at 13:13 UTC ( [id://311599]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    if ($results->isa('XML::XPath::NodeSet')) {
       return wantarray ? $results->get_nodelist : $results;
    #  return $results->get_nodelist;
    }
    
  2. or download this
    #!/usr/bin/perl -l
    
    ...
    my $iter = foo()->from_start();
    print ($iter->value),$iter->next until $iter->at_end;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-04-19 20:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found