On Sat, Dec 19, 2009 at 11:00:07AM -0500, Chris Dale wrote:
> On Sat, 19 Dec 2009, Alex Samad wrote:
> > I have a set of constants setup in my script
> >
> > RC_OK
> > ...
> > ...
> >
> > I use LWP::Simple which also uses RC_OK, and I get a main::RC_OK
> > redifinition
> >
> > is there some wa
On Sat, 19 Dec 2009, Alex Samad wrote:
> I have a set of constants setup in my script
>
> RC_OK
> ...
> ...
>
> I use LWP::Simple which also uses RC_OK, and I get a main::RC_OK
> redifinition
>
> is there some way around this with out renaming my constants.
You can suppress symbol importing,
How about setting it a "local" variable?
And I think that you'd better send such a question to a perl mailing list.
Alex Samad wrote:
> Hi
>
> I have a set of constants setup in my script
>
> RC_OK
> ...
> ...
>
> I use LWP::Simple which also uses RC_OK, and I get a main::RC_OK
> redifinition
>
Hi,
did you check this issue on Perl sites? Try to start with
www.cpan.org. BTW this is a very great site.
Good luck,
Gabor
2009/12/19 Alex Samad :
> Hi
>
> I have a set of constants setup in my script
>
> RC_OK
> ...
> ...
>
> I use LWP::Simple which also uses RC_OK, and I get a main::RC_OK
>
>> Do not reinvent wheel :). Use standart Perl modules.
>>
>> use File::Path;
>> rmtree([$dir]);
>>
>> See File::Path docs for more info.
>>
KGM> Correct me if I'm wrong, but this is what the OP *didn't* want to do
KGM> (taken from File::Path doc):
KGM> "All of the files and directories
KGM
Ilya Martynov wrote:
>
> >> > Here's one for some of the perl guys
> >> >
> >> > I want to delete a directory that will have files in it...
> >> > I don't know the name of the files there for wildcards might
> >> > be needed
> >> >
> >> > I understand that "rmdir" will wipe out an empt
>> > Here's one for some of the perl guys
>> >
>> > I want to delete a directory that will have files in it...
>> > I don't know the name of the files there for wildcards might
>> > be needed
>> >
>> > I understand that "rmdir" will wipe out an empty directory
>> > and "unlink" wil
> >From: "Mike Egglestone"<[EMAIL PROTECTED]>
> >To: "debian-user"
> >Subject: perl question
> >Date: Thu, Jul 18, 2002, 4:53 AM
> >
>
> > Hello...
> >
> > Here's one for some of the perl guys
> >
> > I want to delete a directory that will have files in it...
> > I don't know the name of the f
--- Mike Egglestone <[EMAIL PROTECTED]>
wrote:
> thanks for all the inputs !!!
Just condensing all the answers given
(more for myself)
>I'm really new to Perl and I'm guessing that
>I can't run shell commands within a perl script...
Check out system() and exec()...
thanks for all the inputs !!!
I ended up using the rmtree command...
I needed to execute this in Perl
because I have a web based emailer written in Perl...
One part of the program will create an upload directory for the
user ... however... I couldn't get a quota on it so I just delete
the
On Tue, 17 Jul 2001, Craig Dickson wrote:
> > What would be a nice command to remove a dirtory that had files in it?
> rm -rf directory
But if you don't want to spawn a sh.
Check all this as it is off the cuff and I would usually
use backticks or system to do this type of thing.
#!/usr/bin/per
Simply Speaking, This would have been done better with these
shell commands:
# cd /directory
# rm -rf *
# cd ..;
:)
rgrds,
Calvin "Lamer"
--
>From: "Mike Egglestone"<[EMAIL PROTECTED]>
>To: "debian-user"
>Subject: perl question
>Date: Thu, Jul 18, 2002, 4:53 AM
>
> Hello...
>
> Here's
On Wed, Jul 17, 2002 at 04:53:50PM -0400, Mike Egglestone wrote:
> What would be a nice command to remove a dirtory that had files in it?
> Even better what would be a nice command to delete all files
> in one directory... (leaving the directory intact)
#!/usr/bin/perl -w
use File::Path;
rmtre
On Wednesday 17 July 2002 03:53 pm, Mike Egglestone wrote:
> Hello...
>
> Here's one for some of the perl guys
>
> I want to delete a directory that will have files in it...
> I don't know the name of the files there for wildcards might
> be needed
>
> I understand that "rmdir" will wip
Mike Egglestone wrote:
> What would be a nice command to remove a dirtory that had files in it?
rm -rf directory
> Even better what would be a nice command to delete all files
> in one directory... (leaving the directory intact)
rm -rf directory/*
which will delete everything in a director
Quoting Manoj Srivastava ([EMAIL PROTECTED]):
> Hi,
> >>"Joey" == Joey Hess <[EMAIL PROTECTED]> writes:
>
> >> The following works under more shells (and also is a man page ;-)
> #!/usr/bin/perl -- # -*- Mode: Perl -*- #
> 'di';
> 'ig00';
>
> "true" || eval 'exec perl -S $0 $argv:q';
> eval
Hi,
>>"Joey" == Joey Hess <[EMAIL PROTECTED]> writes:
>> The following works under more shells (and also is a man page ;-)
#!/usr/bin/perl -- # -*- Mode: Perl -*- #
'di';
'ig00';
"true" || eval 'exec perl -S $0 $argv:q';
eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
& eval 'exec
Manoj Srivastava wrote:
> Joey> eval 'exec perl -S $0 ${1+"$@"}'
> Joey> if 0;
>
> The following works under more shells (and also is a man page ;-)
> #!/usr/bin/perl -- # -*- Mode: Perl -*- #
Yes, but it doesn't address the orginial problem: It will fail if perl is
no
Hi,
>>"Joey" == Joey Hess <[EMAIL PROTECTED]> writes:
Joey> eval 'exec perl -S $0 ${1+"$@"}'
Joey> if 0;
The following works under more shells (and also is a man page ;-)
I used to use this as a template perl script with built in man page
(this was before we had POD an
On 3 Sep, Hans van den Boogert wrote:
> I'm trying to learn some Perl. I found an on-line book which is Unix
> biased, but the scripts all start with #!/usr/local/bin/perl (which makes
> sense if you have compiled and installed it yourself). However, on my
> Debian system Perl was of course put i
Brad writes:
> One solution would be to write a makefile that detects the location
> of the perl binary and then prepends the proper shebang line to the
> beginning of your perl programs.
Another trick is this:
#! /usr/bin/env perl
print "Hello, world\n";
This depends on env being in /u
* Hans van den Boogert <[EMAIL PROTECTED]> writes:
> I'm trying to learn some Perl. I found an on-line book which is Unix
> biased, but the scripts all start with #!/usr/local/bin/perl (which makes
> sense if you have compiled and installed it yourself). However, on my
> Debian system Perl was of
Hans van den Boogert wrote:
> I'm trying to learn some Perl. I found an on-line book which is Unix
> biased, but the scripts all start with #!/usr/local/bin/perl (which makes
> sense if you have compiled and installed it yourself). However, on my
> Debian system Perl was of course put in /usr/bin/p
-BEGIN PGP SIGNED MESSAGE-
On Thu, 2 Sep 1999, Brian Servis wrote:
> *- On 2 Sep, Jonathan Markevich wrote about "Re: #!/Perl question"
> > On Fri, Sep 03, 1999 at 03:04:49AM +0800, Hans van den Boogert wrote:
> >> I'm trying to learn some Perl. I fo
*- On 2 Sep, Jonathan Markevich wrote about "Re: #!/Perl question"
> On Fri, Sep 03, 1999 at 03:04:49AM +0800, Hans van den Boogert wrote:
>> I'm trying to learn some Perl. I found an on-line book which is Unix
>> biased, but the scripts all start with #!/usr/local/
On Fri, Sep 03, 1999 at 03:04:49AM +0800, Hans van den Boogert wrote:
> I'm trying to learn some Perl. I found an on-line book which is Unix
> biased, but the scripts all start with #!/usr/local/bin/perl (which makes
> sense if you have compiled and installed it yourself). However, on my
> Debian s
26 matches
Mail list logo