vrushali has asked for the wisdom of the Perl Monks concerning the following question:
sub new { my $proto = shift; my $class = ref($proto) || $proto; my $device = shift; my $alias = $device; if ($device =~ /^COM\d+$/io) { $device = '\\\\.\\' . $device; # required COM10 and beyond, done for all to facilitate testing } my @new_cmd = ($device); my $quiet = shift; if ($quiet) { push @new_cmd, 1; } my $self = $class->SUPER::new(@new_cmd); unless ($self) { return 0 if ($quiet); return; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Working of new subroutine
by Corion (Patriarch) on Jan 04, 2011 at 09:18 UTC | |
|
Re: Working of new subroutine
by Utilitarian (Vicar) on Jan 04, 2011 at 10:32 UTC |