Re: avoid creating directories in a particular path

2002-09-03 Thread Dharmendra Rai
This will not work as it will also forbid creating new files(according to the question only sub-DIRS r not allowed) in that directory. There is no Unix-provided solution for this. One can write a function, which can be called first in any perl code (related to some task in that path) to ensure

Re: locking a file in linux

2002-09-03 Thread Ramprasad A Padmanabhan
Michael Fowler wrote: > On Mon, Sep 02, 2002 at 03:56:22PM +0530, Ramprasad A Padmanabhan wrote: > >>Hi All, >> I am writing an web application where multiple users may write into >>the same file concurrently. Also there is a probability that there may >>be an admin who has opened up the file

RE: avoid creating directories in a particular path

2002-09-03 Thread Sudarshan Raghavan
On Wed, 4 Sep 2002, Javeed SAR wrote: > This will not allow me to had files ?? Please reply to the list. If you are the owner of that directory, retain the write permission for yourself and disable it for everyone else. Is your question "users should be allowed to add files but not directo

Re: general confusion...

2002-09-03 Thread Dharmendra Rai
yeah u r right. - Get a bigger mailbox -- choose a size that fits your needs.

Re: avoid creating directories in a particular path

2002-09-03 Thread Sudarshan Raghavan
On Wed, 4 Sep 2002, Javeed SAR wrote: > Hi all, > > How should i avoid creating directories in a particular path? > For Eg under DSP directory i should not allow any directory to be created.. > Remove the write permission on this directory. -- To unsubscribe, e-mail: [EMAIL PROTECTED] F

avoid creating directories in a particular path

2002-09-03 Thread Javeed SAR
Hi all, How should i avoid creating directories in a particular path? For Eg under DSP directory i should not allow any directory to be created.. Regards Javeed

Re: problems with File::Find

2002-09-03 Thread Pam Derks
Thanks very much for the help! what I was stumbling on was... if File::Find give us directory/filename we still need to open up each file, and to do this we use open(FILE, $_) rather than trying read the name of a file, in which case $_ would neve give us the contents of that file many thank

Please~

2002-09-03 Thread tang karen
Dear Sir and Madam. Please don't send me any mail. Thank your! _ Join the world’s largest e-mail service with MSN Hotmail. http://www.hotmail.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [

Re: problems with File::Find

2002-09-03 Thread John W. Krahn
Pam Derks wrote: > > Hi, > > Newbie here...I'm trying to find the string "Take our survey" in all the files that >match this pattern, traversing multiple directories. When I run it I get no >filenames. I'm positive the string exists. Any ideas as to what I'm doing wrong. > > Thanks for any he

Re: problems with File::Find

2002-09-03 Thread Michael Fowler
On Tue, Sep 03, 2002 at 04:33:37PM -0700, Pam Derks wrote: [snip] > #!/usr/bin/perl > #process all files in directory www/htdocs > > use File::Find; > @ARGV = qw(/dept/unxmkt/www/htdocs) unless @ARGV; > find(\&find_it, @ARGV); > >sub find_it{ >foreach $_(@ARGV){ > wh

Re: locking a file in linux

2002-09-03 Thread Wiggins d'Anconia
This is an interesting proposed solution. But as the poster pointed out depends on whether they are *only* using vi, if that can be assured then you might consider using the method by which vi does its own checking on its own files. In other words check for a "..swp" or maybe a "..sw*" file i

problems with File::Find

2002-09-03 Thread Pam Derks
Hi, Newbie here...I'm trying to find the string "Take our survey" in all the files that match this pattern, traversing multiple directories. When I run it I get no filenames. I'm positive the string exists. Any ideas as to what I'm doing wrong. Thanks for any help, Pam Here's what I've got..

Re: can someone explain this?

2002-09-03 Thread david
that doesn't reveal what: $Explanation = < ) ); #-- Alignment data does. can you again provide some code above this line? it start to look like a real syntax error to me unles the whole subroutine is really inside a pod. what happen if you: perl -c david Prachi Shah wrote: > Here's what t

Re: can someone explain this?

2002-09-03 Thread Prachi Shah
Here's what the main function looks likeit has more subroutines below, but I guess this might be enough for you guys to look at. I also realise that there is a right curly parentheses at the end which does not have a starting left parentheses. So, maybe this code is full of syntax errors.

Re: Simple useradd script problem

2002-09-03 Thread david
John W. Krahn wrote: >> change: >> >> @users = ; >> >> to: >> >> chop(@users = ); > > > You should use chomp unless you are stuck in Perl4. > agree. chomp is safer(and faster than chop). david -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED

Re: can someone explain this?

2002-09-03 Thread david
the line by itself is a syntax error. could it actually be something inside of a pod like: =item $Explanation = < ) ); =cut that you are not aware of? anything between =item and =cut is ignored by Perl. or something like a here document as: ($Explanation =<); if you provide more lines abo

Re: can someone explain this?

2002-09-03 Thread John W. Krahn
Prachi Shah wrote: > > Hi! Hello, > I have this code written by someone and there's no documentation to it. I am > trying to figure what and how it works. There is this line right at the > beginning of the code that baffles me. Does someone have a clue as to what > this means? > > $Explanation

Re: Simple useradd script problem

2002-09-03 Thread John W. Krahn
David wrote: > > Darren Wanner wrote: > > > Simple add user script: > > > > #!/usr/bin/perl > > > > open(FILE,"users.log"); > > @users=; > > foreach $users (@users) { > > `useradd -g 201 -d /userhome/$users -m $users`; > > } > > print "done.\n"; > > change: > > @users = ; > > to: > > chop(@u

Re: Simple useradd script problem

2002-09-03 Thread Dave Arnold
In message <[EMAIL PROTECTED]> Darren Wanner <[EMAIL PROTECTED]> wrote: > > I'm trying to write a simple script that takes a list of users from a file > and creates a user account for them, using the useradd script. The system > I'm doing this on is Solaris 8. When I run the script I

Re: Simple useradd script problem

2002-09-03 Thread John W. Krahn
Darren Wanner wrote: > > I'm trying to write a simple script that takes a list of users from a file > and creates a user account for them, using the useradd script. The system > I'm doing this on is Solaris 8. When I run the script I get the following > error. It seems as if it's not accepting

Re: Simple useradd script problem

2002-09-03 Thread david
Darren Wanner wrote: > Simple add user script: > > #!/usr/bin/perl > > open(FILE,"users.log"); > @users=; > foreach $users (@users) { > `useradd -g 201 -d /userhome/$users -m $users`; > } > print "done.\n"; change: @users = ; to: chop(@users = ); and try again. david -- To unsubscribe,

can someone explain this?

2002-09-03 Thread Prachi Shah
Hi! I have this code written by someone and there's no documentation to it. I am trying to figure what and how it works. There is this line right at the beginning of the code that baffles me. Does someone have a clue as to what this means? $Explanation = < ) ); thanks, Prachi.

Simple useradd script problem

2002-09-03 Thread Darren Wanner
I'm trying to write a simple script that takes a list of users from a file and creates a user account for them, using the useradd script. The system I'm doing this on is Solaris 8. When I run the script I get the following error. It seems as if it's not accepting the variable in the command li

Re: shell command

2002-09-03 Thread eric-perl
On Tue, 3 Sep 2002, David T-G wrote: > % all im trying to do is run the shell command: > % > % convert -quality 40 image.jpg resampled_image.jpg > > Better yet, you should grab the PerlMagick module and just run the > commands from within your perl script and forget the system call (or > backti

Re: How to get Multi-Line file into $var?

2002-09-03 Thread Draco Paladin
James Edward Gray II <[EMAIL PROTECTED]> wrote: > This what you mean? > @one_line_per_index = ; > $multiple_lines = join '', @one_line_per_index; > On Tuesday, September 3, 2002, at 01:35 PM, Tim Musson wrote: >> sub GetBodyFromFile { >> my $file = $0; >> open (INFO, $file); >>

Re: How to get Multi-Line file into $var?

2002-09-03 Thread Tim Musson
Hey Bob, My MUA believes you used Internet Mail Service (5.5.2650.21) to write the following on Tuesday, September 3, 2002 at 2:56:13 PM. >>I need to read a file and put it in a $Variable (not @Array). BS> { local $/; $body = } Thanks all, this is what I was forgetting! -- [EMA

Re: locking a file in linux

2002-09-03 Thread Michael Fowler
On Mon, Sep 02, 2002 at 03:56:22PM +0530, Ramprasad A Padmanabhan wrote: > Hi All, > I am writing an web application where multiple users may write into > the same file concurrently. Also there is a probability that there may > be an admin who has opened up the file in 'vi' and editing the fil

RE: cookies and baking in general :)

2002-09-03 Thread Bob Showalter
> -Original Message- > From: david [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, September 03, 2002 2:51 PM > To: [EMAIL PROTECTED] > Subject: RE: cookies and baking in general :) > > > Bob Showalter wrote: > > >> -Original Message- > >> From: david [mailto:[EMAIL PROTECTED]] > >>

RE: cookies and baking in general :)

2002-09-03 Thread david
Bob Showalter wrote: >> -Original Message- >> From: david [mailto:[EMAIL PROTECTED]] >> Sent: Tuesday, September 03, 2002 1:24 PM >> To: [EMAIL PROTECTED] >> Subject: Re: cookies and baking in general :) >> >> >> there are >> cookie blocking >> software out there that sets between a use

RE: How to get Multi-Line file into $var?

2002-09-03 Thread Bob Showalter
> -Original Message- > From: Tim Musson [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, September 03, 2002 2:35 PM > To: [EMAIL PROTECTED] > Subject: How to get Multi-Line file into $var? > > > hey Perl people!, > >Can't seem to get my brain to work this afternoon... > >I need to r

RE: globally scoped variables changed

2002-09-03 Thread Nikola Janceski
thnx to all for the feedback. $! and $? is what I was looking for and anyothers which there aren't. Now I am on a mission to find a bug in XML::Simple related to rsh, system commands and lack of sanity. > -Original Message- > From: david [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, Septem

Re: How to get Multi-Line file into $var?

2002-09-03 Thread John W. Krahn
Tim Musson wrote: > > hey Perl people!, Hello, >Can't seem to get my brain to work this afternoon... > >I need to read a file and put it in a $Variable (not @Array). > > [snip] > > This next bit is my problem. I can use the $body in the bit below, > but not the @body. Looks like if

Re: globally scoped variables changed

2002-09-03 Thread david
backticks is simply an operator in Perl that tells Perl to run something and capture whatever that external program sends to standout. backticks itself doesn't set/unset/change/pupulate any variables(well except $!, $? etc when Perl is having problem running your program and trying to tell you t

Re: How to get Multi-Line file into $var?

2002-09-03 Thread James Edward Gray II
This what you mean? @one_line_per_index = ; $multiple_lines = join '', @one_line_per_index; On Tuesday, September 3, 2002, at 01:35 PM, Tim Musson wrote: > sub GetBodyFromFile { > my $file = $0; > open (INFO, $file); > @body = ; > close(INFO); > $body=" > 123456

child processes dying...

2002-09-03 Thread Chad Kellerman
Hello Everyone, I got a script that spawns off a few children. But for some reason before the children are finished doing what they are suppose to do they die. code: use POSIX "sys_wait_h"; my $child_limit = 1; my $child_pids = 0; $SIG{CHLD} = \&CHILD_COUNT; FORK: {

How to get Multi-Line file into $var?

2002-09-03 Thread Tim Musson
hey Perl people!, Can't seem to get my brain to work this afternoon... I need to read a file and put it in a $Variable (not @Array). What I am doing is a bit of code to run a SMTP mail sender (yes, I know Net::SMTP works great, but this is how the customer want's it). So I ha

Re: locking a file in linux

2002-09-03 Thread david
the tricky part is the "admin who has opened up the file in 'vi' and editing the file". this kind of manually open editing behavior is hard to track for the locking module that you just mention. the following provides you with a simple(not perfect at all and it's slow) method and it searches you

Re: finding invalide options in getopt

2002-09-03 Thread david
an invalid option is one that you don't expect the user to enter or one that is actually not in a valid form? consider the following(foo.pl): #!/usr/bin/perl -w use strict; use Getopt:Long; $SIG{__WARN__} = sub { print "WARNING WARNING\n"; }; sub process{ print "BAD: ",shift,"\n"; } my

RE: cookies and baking in general :)

2002-09-03 Thread Bob Showalter
> -Original Message- > From: david [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, September 03, 2002 1:24 PM > To: [EMAIL PROTECTED] > Subject: Re: cookies and baking in general :) > > > there are > cookie blocking > software out there that sets between a user's browser and > your cgi sc

I am confused with looping to stop repeat accurances of a entryies ina log for a report

2002-09-03 Thread FLAHERTY, JIM-CONT
I am trying to parse a squid log file to let It management know where people are browsing too. my plan block diagram goes a follows 1. open log 2. seperate by IP address , list only one at a time no repeats of the same IP address 3. list only one instance of a visited site , per IP address 4

Re: cookies and baking in general :)

2002-09-03 Thread david
depends on the needs of your application. generally, don't rely on the user to use your page in a certain order. instead assume that he/she will use your page in random order. the problem of force user to use your page in a certain order is not very reliable. a user can always have multiple wi

Re: globally scoped variables changed

2002-09-03 Thread Jeff 'japhy' Pinyan
On Sep 3, Nikola Janceski said: >The point is a backtick execution. ie. my @output = `some command that spews >output`; > >QUESTION: What are all the possible globally scoped variables that backticks >can possible set/unset/change/populate? As far as I can tell, $! and $? are the only ones I see

Re: Closures / Memory Usage

2002-09-03 Thread david
closures are a great idea to generate similar functions on the fly. one thing you should keep in mind is that when Perl search for variable, subroutine etc, it always search the lexical namespace before it search the symble table. consider the following: $h->{'process'}->{'image'} = 1; $h->{'p

Re: general confusion...

2002-09-03 Thread drieux
On Tuesday, September 3, 2002, at 08:26 , Andrew Metcalfe wrote: [..] > Once I understood what => and -> were doing, it all made perfect sense... [..] thanks for reminding those who have forgotten that while "=>" may appear to be what in perl is ">=" { greater than or equal } it is really a "thi

RE: Text-Mode Module for perl?

2002-09-03 Thread Bob Showalter
> -Original Message- > From: Balint, Jess [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, September 03, 2002 12:58 PM > To: '[EMAIL PROTECTED]' > Subject: Text-Mode Module for perl? > > > Hello all. I am looking for something similar to the curses/ncurses C > library as a module for perl. An

Text-Mode Module for perl?

2002-09-03 Thread Balint, Jess
Hello all. I am looking for something similar to the curses/ncurses C library as a module for perl. Any suggestions, greatly appreciated. Thanks.. Jess -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

globally scoped variables changed

2002-09-03 Thread Nikola Janceski
I am trying to pin point some error I am getting with a module (from some old post that one person responded to). I have narrowed it down some point elsewhere in MY programming. The point is a backtick execution. ie. my @output = `some command that spews output`; QUESTION: What are all the poss

RE: AW: Perl 5.8.0

2002-09-03 Thread Jason Frisvold
Oh, I am happy with 5.6.1 ... Use it all over the place ... But ... Threading ... Real, honest threading? That would be something wonderful... Any idea if there's a shared memory module for the threading? I believe the problem I ran into last time I tried this was that most of the modules we

RE: general confusion...

2002-09-03 Thread Andrew Metcalfe
Thanks everyone for the help. Once I understood what => and -> were doing, it all made perfect sense... I actually wasn't debugging, but enhancing a perl based open source app for our specific needs. Thanks, _Am > -Original Message- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTE

Re: general confusion...

2002-09-03 Thread shawn_milochik
I am a beginner, so list members -- correct me if I'm wrong here, but I think that the mathematical symbols (<>=) will only work with variables containing numbers. For strings, you have to use gt, lt, le, eq. Hope this is helpful. Shawn

Re: perl ssh

2002-09-03 Thread drieux
On Wednesday, September 4, 2002, at 04:35 , Sudarshan Raghavan wrote: > On Tue, 3 Sep 2002, Chad Kellerman wrote: [..] >> my $ssh; >> eval { >> alarm 10; >> $ssh = Net::SSH::Perl->new($host_ip, >> identity_files =>["$id_key

Re: Installing GD library

2002-09-03 Thread zentara
On Mon, 2 Sep 2002 11:21:07 -0700, [EMAIL PROTECTED] (Ebaad Ahmed) wrote: ># ./loads.cgi >Can't locate GD.pm in @INC (@INC contains: > >I can tell that it is looking for the GD.pm but since I have installed all >the packages then why is it complaining about it or is there some thing else >I need

Re: Read, Write and Append -- is there more?

2002-09-03 Thread Felix Geerinckx
on Tue, 03 Sep 2002 13:11:47 GMT, [EMAIL PROTECTED] (James Edward Gray II) wrote: > This is the easiest way, in my opinion. It'll work on files > passes as command line arguments. Beware the replacing though, > files will be modified in place and data may be lost! > > #!/usr/bin/perl -pi The

Re: perl ssh

2002-09-03 Thread Sudarshan Raghavan
On Tue, 3 Sep 2002, Chad Kellerman wrote: > Hey guys, > > Having an issue with Net::SSH:Perl and eval. > > Is there another way to write this? Or am I just missing something? > > my $ssh; > eval { > alarm 10; > $ssh = Net::SSH::Perl->new($

Re: shell command

2002-09-03 Thread David T-G
Jo -- ...and then tux said... % % hey all, sorry if im asking a silly or stupid question, but i just CANT % seem to find anything on google/in books on how to do this, its slowly % make me go bald.. You need the camel book, then. % % all im trying to do is run the shell command: % % conver

perl ssh

2002-09-03 Thread Chad Kellerman
Hey guys, Having an issue with Net::SSH:Perl and eval. Is there another way to write this? Or am I just missing something? my $ssh; eval { alarm 10; $ssh = Net::SSH::Perl->new($host_ip, identity_files =>["$id_key_fn"

Re: AW: Perl 5.8.0

2002-09-03 Thread David T-G
Jason, et al -- ...and then Angerstein said... % % full 64Bit support Also full threading, I hear, though I think that those two are the real meat of the upgrade. When I asked this question recently it basically boiled down to "if you're happy with 5.6.1 then just stick with it" and that's wha

Re: Read, Write and Append -- is there more?

2002-09-03 Thread James Edward Gray II
This is the easiest way, in my opinion. It'll work on files passes as command line arguments. Beware the replacing though, files will be modified in place and data may be lost! #!/usr/bin/perl -pi s/leftmargin="0".*bgcolor="#3c3939"//g; s/bgcolor="\#5A5D4E"/class="topOfPic"/ig; On Monday, S

Re: general confusion...

2002-09-03 Thread Janek Schleicher
Andrew Metcalfe wrote at Mon, 02 Sep 2002 20:28:43 +0200: > I'm a MS and Java developer, trying to debug some perl code. Perl is *very* different to Java. Better start with a Perl tutorial. Please look also first to the excellent answer of Jeff, as I won't re-explain what Jeff already has done.

Re: shell command

2002-09-03 Thread Janek Schleicher
Ashutosh Jog wrote at Mon, 02 Sep 2002 17:46:25 +0200: > Have you tried > > system (convert -quality 40 image.jpg resampled_image.jpg); Looks like a quoting is forgotten :-) system qw(convert -quality 40 image.jpg resampled_image.jpg); ^^ Cheerio, Janek -- To unsubscribe, e-mail:

Re: CGI+Compiled Program

2002-09-03 Thread Dharmendra Rai
The file generated by 'perlcc' does the same task as the perl file. In the program where you are requesting the service, change the name from perl file(which was earlier to 'perlcc') to the generated binary file. - Get a bigger mailbox -- choose a size that fi

CGI+Compiled Program

2002-09-03 Thread [EMAIL PROTECTED]
Hi ALL. How to run compiled program in cgi module??? I compile the program using: perlcc -o test test.pl and copy to /cgi-bin and run instead ?? - My program requires a perl module from apache to run in cgi mode?, or the perlcc build all libraries on compiled program? thanx for help... Pl

Re: Read, Write and Append -- is there more?

2002-09-03 Thread John W. Krahn
Tim Booher wrote: > > Hello, I am currently frustrated trying to do a simple find and replace > on a file, but the three open options: Read, Write and Append don't seem > to give me what I want. For example, Read, works on the finding, but > nothing will replace. Write erases all the files and le

Re: Read, Write and Append -- is there more?

2002-09-03 Thread Sudarshan Raghavan
On Mon, 2 Sep 2002, Tim Booher wrote: > Hello, I am currently frustrated trying to do a simple find and replace > on a file, but the three open options: Read, Write and Append don't seem > to give me what I want. For example, Read, works on the finding, but > nothing will replace. Write erases al

RE: Read, Write and Append -- is there more?

2002-09-03 Thread Timothy Johnson
My thought is this: that's just the way the filesystem works. You really only have two options: you can create a temporary file or you can store the contents of the file in memory. Then when you have finished changing the file you can write the new file to the old file's place. It sounds at f

Read, Write and Append -- is there more?

2002-09-03 Thread Tim Booher
Hello, I am currently frustrated trying to do a simple find and replace on a file, but the three open options: Read, Write and Append don't seem to give me what I want. For example, Read, works on the finding, but nothing will replace. Write erases all the files and leaves me with blank files and