#!/usr/bin/perl use strict; use warnings; use CGI; MYLOOP: for(0..10){ $_ % 2 or test(CGI->new, 'header') and next; print $_,"\n"; } sub test{ my ($obj,$method) = @_; no strict 'refs'; print $obj->$method(); }