[Israel.pm] Testing problem
Mikhael Goikhman
migo at homemail.com
Mon Jan 5 06:40:54 PST 2004
On 05 Jan 2004 16:29:18 +0200, Thomas Maier wrote:
>
> Thanks, it's very nice, but IMO I can make it shorter by
> passing straight forward some faked 'command' instead of new
> subroutine
>
> sub method
> {
> my ($self, $fake_command, @param) = @_;
> $pid = open $fh,"-|","$fake_command @param";
> $x = do something with $fh;
> return $x;
> }
>
> But since it's only for testing purpose, I would like to avoid from
> passing additional parameters to this method. Any idea ?
You may use "true" as a fake command, this unix utility is designed for
such things, i.e. it accepts any arguments and any input and silently
ignores them. Similarly "false" does nothing too (except for returning 1
rather than 0). You may try "echo" as a fake command too.
Is this what you want?
Regards,
Mikhael.
--
perl -e 'print+chr(64+hex)for+split//,d9b815c07f9b8d1e'
More information about the Perl
mailing list