On Monday 05 July 2004 21:28, gohaku wrote:
Hi everyone,
Hello,
After using backticks to retrieve executable output,
I would like to know if there is a backtick alternative.
For example, to get a File Listing on a Unix-based system,
I will do the usual:
$exec = ls -l;
$src = `$exec`;
On Tue, 6 Jul 2004 00:28:57 -0400, gohaku [EMAIL PROTECTED] wrote:
Hi everyone,
After using backticks to retrieve executable output,
I would like to know if there is a backtick alternative.
For example, to get a File Listing on a Unix-based system,
I will do the usual:
$exec = ls -l;
Suresh Pasupula wrote:
Gohaku wrote:
After using backticks to retrieve executable output,
I would like to know if there is a backtick alternative.
You can use in the following way:
$exec = ls -l;
$src = system($exec);
Please read perldoc -f system to find out why you typically can
*not* use
Tim Johnson wrote:
Gohaku wrote:
After using backticks to retrieve executable output, I would like
to know if there is a backtick alternative.
If you want the exact same function as the backticks, why not just
make a small subroutine?
Maybe because it's unnecessary, since there already is an
Prasanna Kothari wrote:
Gohaku wrote:
After using backticks to retrieve executable output,
I would like to know if there is a backtick alternative.
Try this
local *CMD;
$cmd = dir;
open(CMD,$cmd 21|)|| die Could not open file handle\n;
while(CMD) {
print $_,\n;
}
close(CMD) || die Could not
Gunnar Hjalmarsson wrote:
Hmm.. Is there any situation when it's motivated to do that instead
of using backticks (or the qr// operator)?
Sorry.. I meant the qx// operator.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
:
Subject: Re: Backticks alternative?
snip
$exec = ls -l;
$src = syscall($exec);
sub syscall{
return `$_[0]`;
}
should work.
Should it? Did you try it? syscall() is a built
You can use in the following way:
$exec = ls -l;
$src = system($exec);
-Original Message-
From: gohaku [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 06, 2004 9:59 AM
To: Perl Beginners
Subject: Backticks alternative?
Hi everyone,
After using backticks to retrieve executable output,
I
If you want the exact same function as the backticks, why not just make a small
subroutine?
#
$exec = ls -l;
$src = syscall($exec);
sub syscall{
return `$_[0]`;
}
#
should work.
-Original Message-
From: gohaku [mailto:[EMAIL
Try this
local *CMD;
$cmd = dir;
open(CMD,$cmd 21|)|| die Could not open file handle\n;
while(CMD) {
print $_,\n;
}
close(CMD) || die Could not close $cmd $!\n;
The program is printing to STDOUT.
--Prasanna
gohaku wrote:
Hi everyone,
After using backticks to retrieve executable output,
I would
10 matches
Mail list logo