john wright wrote:
> Hi All,
Hello,
> i am getting error "The system cannot find the path specified" while running
> below lines code.
>
> $dirname = "util";
> $path = ` cd $dirname ; pwd`
> print ("$path");
>
> can anybody help me to get output of pwd in the variable $path.
use Cwd;
my $dir
john wright wrote:
>
> i am getting error "The system cannot find the path specified" while running
> below lines code.
>
> $dirname = "util"; $path = ` cd $dirname ; pwd` print ("$path");
>
> can anybody help me to get output of pwd in the variable $path.
Hi John
It's best to do things in Perl
Hi All,
i am getting error "The system cannot find the path specified" while running
below lines code.
$dirname = "util";
$path = ` cd $dirname ; pwd`
print ("$path");
can anybody help me to get output of pwd in the variable $path.
Thank
Hi Ron,
Thank you very very much,
-Mahdi.
Rob Dixon wrote:
Mahdi A Sbeih wrote:
>
> I am using the below code:
>
> $fmtFile = `$dpImportCmd`;
> ..
> ..
> unlink($fmtFile) || die "unable to remove $fmtFile\n";
>
>
> dpImportCmd, is a program that generates a text file, this text file
> name i
Mahdi A Sbeih wrote:
>
> I am using the below code:
>
> $fmtFile = `$dpImportCmd`;
> ..
> ..
> unlink($fmtFile) || die "unable to remove $fmtFile\n";
>
>
> dpImportCmd, is a program that generates a text file, this text file
> name is now in the variable: $fmtFile. Later in the program, I want to
I am using the below code:
$fmtFile = `$dpImportCmd`;
..
..
unlink($fmtFile) || die "unable to remove $fmtFile\n";
dpImportCmd, is a program that generates a text file, this text file
name is now in the variable: $fmtFile. Later in the program, I want to
delete this file, but it fails. I don'
On Fri, 02 Apr 2004 16:22:51 +0200
Martin Lercher <[EMAIL PROTECTED]> wrote:
> >ps uf
> 2740 pts/7S 0:00 \_ /usr/bin/perl ./t5.pl
> 2894 pts/7T 0:00 \_ ls
> 2895 pts/7Z 0:00 \_ [ls ]
Strange. It looks like ls has forked a copy of itself and is wai
Martin Lercher wrote:
#!/usr/bin/perl
for (my $j=0;$j<1;$j++) {
my $result = `ls` ;
print $result ;
}
>ps uf
2740 pts/7S 0:00 \_ /usr/bin/perl ./t5.pl
2894 pts/7T 0:00 \_ ls
2895 pts/7Z 0:00 \_ [ls ]
I don't think that is Perl; the O
Hi,
I'm trying to repeatedly call some external program from Perl using
backticks. This works fine for ~30 rounds, but then the program stops
doing anything, with a process hanging around (apparently Perl
ignores its dead child?). A simple example is this:
#!/usr/bin/perl
for (my $j
Thanks George,
I will try ...
José.
-Original Message-
From: George Schlossnagle [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 29, 2002 10:27 AM
To: NYIMI Jose (BMB)
Cc: [EMAIL PROTECTED]
Subject: Re: Avoid using backticks
You can use the File::Find module. It even has a find2perl
2 10:15 AM
To: [EMAIL PROTECTED]; NYIMI Jose (BMB)
Subject: Re: Avoid using backticks
You should be able to do it with
opendir (to open directories and browse the contents)
and
unlink (to delete files)
take a look at the man pages for those two to get you started, if you're still
struggling ju
You can use the File::Find module. It even has a find2perl utility for
taking the work of writing a matching subroutine out:
Then you get something like
#!/usr/local/bin/perl -w
use strict;
use FindBin qw{$Bin};
use File::Find;
find(\&wanted, $Bin);
sub wanted {
(my ($dev,$ino,$mode,$nl
You should be able to do it with
opendir (to open directories and browse the contents)
and
unlink (to delete files)
take a look at the man pages for those two to get you started, if
you're still struggling just ask again.
HTH
Nigel
>>> "NYIMI Jose (BMB)" <[EMAIL PROTECTED]> 07/29/02 08:37am
Hello,
I would like to clean up my logfile directory by removing files that are older than 7
days.
So I wrote something like:
/user/local/bin/perl -w
use strict;
use FindBin qw($Bin);
#
`find $Bin -mtime +7 -name '*.log' -exec rm {} \;`;
#
__END__
My question is: how can I use perl's synthax i
> "Timothy" == Timothy Kimball <[EMAIL PROTECTED]> writes:
Timothy> As for always getting that weird error message from $!, I always
Timothy> get "Illegal seek" on my machine.
You should never look at $! unless immediately following a *failed*
system-related call. A successful call doesn't
ris and Windows.)
Thanks again - I'd been struggling with this for ages. (And thanks to the
others who've replied as I've been typing this!)
Ron
-Original Message-
From: Peter Cornelius [mailto:[EMAIL PROTECTED]]
Sent: 23 May 2001 19:14
To: 'Mitchell, Ronald'; '[
Enter:
perldoc perlvar
and then look at the entries for $CHILD_ERROR ($?) and $ERRNO ($!).
There can be other issues about return values, but start with the above.
Ron Mitchell wrote:
: I want to check that a backtick command has executed OK. I thought I could
: do that by looking at the $! variable.
Check $? instead. This one's for pipes, backticks, & system() commands.
It's a fairly complex flag, with a lot of stuff in it, but briefly,
$? >> 8 contains t
>I want to check that a backtick command has executed OK. I thought I could
>do that by looking at the $! variable.
Check $?
This is Child exit status which is what you get when you spawn another
process with back ticks.
The $! is the ERRNO (or Error string depending on context) for the last
sy
Hi.
Can someone explain this to me?
I want to check that a backtick command has executed OK. I thought I could
do that by looking at the $! variable. But I find that if I do this for
example
$output = `pwd` ;
print "$output\n" ;
print "\$! = $!\n" ;
I get
/home/ron
$! = No such file or direc
20 matches
Mail list logo