John Ackley wrote:
> thanks to all who replied
>
> down to this
>
> # perl -e "print unlink glob
> '/usr/local/billmax/html/images/day-0020a6-5a9bfc*';"
> 1
>
> but in script
>
> my $oldimage = "/usr/local/billmax/html/images/day-0020a6-5a9bfc*";
> my $files = unlink glob $oldimage;
>
> fails
and
perl -e '$oldimage =
"/usr/local/billmax/html/images/day-0020a6-5a9bfc*";$files = unlink glob
$oldimage;printf "Files %d\n",$files;'
Files 1
works
# cat test.pl
#! /usr/bin/perl -w
use strict;
my $oldimage = "/usr/loc
thanks to all who replied
down to this
# perl -e "print unlink glob
'/usr/local/billmax/html/images/day-0020a6-5a9bfc*';"
1
but in script
my $oldimage = "/usr/local/billmax/html/images/day-0020a6-5a9bfc*";
my $files = unlink glob $oldimage;
fails
--
To unsubscribe, e-mail: [EMAIL PROTECTED
On Sat, 2006-08-19 at 16:59 -0400, John Ackley wrote:
> Thanks
>
> in line comments
>
> Tom Phoenix wrote:
> > On 8/19/06, John Ackley <[EMAIL PROTECTED]> wrote:
> >
> >> `/bin/rm -f \"$oldimage\"`;
> >> `/bin/rm /tmp/errormessage`;
> >
> > Why not simply use Perl's unlink function?
>
> apparent
On Aug 19, 2006, at 10:59 PM, John Ackley wrote:
Thanks
in line comments
Tom Phoenix wrote:
On 8/19/06, John Ackley <[EMAIL PROTECTED]> wrote:
`/bin/rm -f \"$oldimage\"`;
`/bin/rm /tmp/errormessage`;
Why not simply use Perl's unlink function?
apparently unlink will not deal with wild c
Thanks
in line comments
Tom Phoenix wrote:
On 8/19/06, John Ackley <[EMAIL PROTECTED]> wrote:
`/bin/rm -f \"$oldimage\"`;
`/bin/rm /tmp/errormessage`;
Why not simply use Perl's unlink function?
apparently unlink will not deal with wild cards in $oldimage
(needed to clean up garbage)
seco
On 8/19/06, John Ackley <[EMAIL PROTECTED]> wrote:
`/bin/rm -f \"$oldimage\"`;
`/bin/rm /tmp/errormessage`;
Why not simply use Perl's unlink function?
`/usr/local/bin/gnuplot $gpfile 2>&1 >/tmp/errormessage` ;
Use backticks if you're interested in the output. But if you're not
looking at t
Cc:
Subject: Re: Backticks alternative?
> $exec = "ls -l";
> $src = syscall($exec);
>
> sub syscall{
>return `$_[0]`;
> }
>
> should work.
Sh
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 additiona
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 2>&1|")|| die "Could not open file handle\n";
while() {
print $_,"\n";
}
close(CMD) || die "Could
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 operat
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 s
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 = "
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 =
Try this
local *CMD;
$cmd = "dir";
open(CMD,"$cmd 2>&1|")|| die "Could not open file handle\n";
while() {
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,
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
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
[EMAIL PROTECTED] wrote:
this does have to run on multiple servers so that is a concern, but all
servers are identical in everyway
This is where Yoda sez: "So sure are you?"
--
_Sx_ http://youve-reached-the.endoftheinternet.org/ _
perldoc -qa.a | perl -lpe '($_)=m("(.*)")' | grep Martian
--
On Mar 23, 2004, at 9:12 AM, [EMAIL PROTECTED] wrote:
>> Hello,
>>
>> I have some code that is using backticks, executing commands on the
>> korn
>> shell.(if that matters). Most work as expected and i get the output
>> of the
>> shell command assigned to the variable left of the argument, like
> Hello,
>
> I have some code that is using backticks, executing commands on the korn
> shell.(if that matters). Most work as expected and i get the output
of the
> shell command assigned to the variable left of the argument, like with
this
> ls command and 'db2 connect' command.
>
> $is
On Mar 23, 2004, at 9:12 AM, [EMAIL PROTECTED] wrote:
Hello,
I have some code that is using backticks, executing commands on the
korn
shell.(if that matters). Most work as expected and i get the output
of the
shell command assigned to the variable left of the argument, like with
this
ls comma
A better way to get PATH would be:
$pat = $ENV{PATH};
(forgive me if this doesn't work in win32-perl, I'm a Unix hacker at heart
:)
--
How long will a floating point operation float?
Mark Veinot
Network Administrator
Linux Certified Professional
- Original Message -
From: "Veeraraju_M
On Mon, Jul 02, 2001 at 04:06:47PM -0300, Silvio Luis Leite Santana wrote:
> It seems the backtick operator calls the shell, otherwise
> it wouldn't be able to redirect output to file saida.
Backticks aren't the only thing that uses the shell, nor do they always use
the shell. A simple `pwd` won
23 matches
Mail list logo