On Fri, Aug 24, 2001 at 12:48:02PM +0530, Veeraraju_Mareddi wrote:
> system ("$netsvc $host /query \"$service\"") == 0 and warn "+error $!" ;
Are you certain this is correct? System commands generally return a true
value on error, and a false value (0) on success. Here you're going to warn
if, and only if, the return value is 0. It looks like you mixed two idioms:
The idiomatic way of checking for an error return by system is:
system(...) and die("system failed...");
It looks like you mixed that with the following:
system(...) == 0 or die("system failed...");
> But I want this OUTPUT to be sent in a mail, either by sending it in a
> Attachment or As a text in Mail.
>
> Please suggest me how to redirect this output a FILE or MAIL.
The pipe form of open, open(FILE, "command |"), works on Windows in newer
versions of Perl. I would suggest using that if it's available to you.
The only other alternative I can think of is the one you're asking about,
redirecting to a file. As far as I know, this is done with the '>'
operator, e.g. "command > file". Keep in mind this is implemented by your
command shell, not Perl.
Michael
--
Administrator www.shoebox.net
Programmer, System Administrator www.gallanttech.com
--
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]