Re: perl question

2009-12-19 Thread Alex Samad
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

Re: perl question

2009-12-19 Thread Chris Dale
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,

Re: perl question

2009-12-19 Thread Niu Kun
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 >

Re: perl question

2009-12-19 Thread Gabor Urban
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 >

Re: perl question

2001-07-25 Thread Ilya Martynov
>> 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

Re: perl question

2001-07-23 Thread Keith G. Murphy
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

Re: perl question

2001-07-23 Thread Ilya Martynov
>> > 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

Re: perl question

2001-07-19 Thread will trillich
> >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

Re: Perl Question Recap

2001-07-18 Thread Hamma Scott
--- 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()...

Re: Perl Question Recap

2001-07-18 Thread Mike Egglestone
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

Re: perl question

2001-07-18 Thread Rob Ransbottom
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

Re: perl question

2001-07-17 Thread Calvin Chong
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

Re: perl question

2001-07-17 Thread Joost Kooij
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

Re: perl question

2001-07-17 Thread Bud Rogers
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

Re: perl question

2001-07-17 Thread Craig Dickson
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

Re: #!/Perl question

1999-09-17 Thread David Wright
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

Re: #!/Perl question

1999-09-06 Thread Manoj Srivastava
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

Re: #!/Perl question

1999-09-03 Thread Joey Hess
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

Re: #!/Perl question

1999-09-03 Thread Manoj Srivastava
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

Re: #!/Perl question

1999-09-03 Thread d1temp
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

Re: #!/Perl question

1999-09-03 Thread Richard Kettlewell
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

Re: #!/Perl question

1999-09-03 Thread Colin Marquardt
* 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

Re: #!/Perl question

1999-09-03 Thread Joey Hess
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

Re: #!/Perl question

1999-09-03 Thread Brad
-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

Re: #!/Perl question

1999-09-02 Thread Brian Servis
*- 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/

Re: #!/Perl question

1999-09-02 Thread Jonathan Markevich
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