Re: perl dbi insertid

2002-07-01 Thread Felix Geerinckx
on Mon, 01 Jul 2002 00:56:27 GMT, [EMAIL PROTECTED] (Donnie Jones) wrote: > I am using this command to get the latest value for the > auto_increment field in the mysql database: > > $field_insertid = $sth->{'insertid'}; > ###

Re: About Perl OO Orthodoxy

2002-07-01 Thread Felix Geerinckx
on Sun, 30 Jun 2002 19:58:09 GMT, [EMAIL PROTECTED] (Drieux) wrote: > so as not to conflate the usual 'religious wars' about > OO v. Proceduralism - forgive me - I needed some > "emotional reassurance" - I guess, that this was > consistent with the expectations and standards of > other OO coders.

RE: updating a file in place is almost working

2002-07-01 Thread Anders Holm
Hi. 1/ What platform are you on? 2/ Are you the System Administrator? 3/ There is on Solaris and Linux usually a script that would do log rotation. There would not be a need to take down the process, but rather do the following (assuming you have the rights): mv n = number 0-9. If file alre

RE: split

2002-07-01 Thread Nigel Peck
Ernie, I'm assuming that @offline is an array of lines, so: foreach $offline (@offline) { print MAIL "$offline\n"; $offline =~ m/(.{4}\..{4}\..{4})/; $nodes=`/home/etucker/jvlresolve.pl $1`; print MAIL "$nodes\n"; } Give it a try, I haven't tested it again, the /g modifier o

Re: calling shell script from perl

2002-07-01 Thread David vd Geer Inhuur tbv IPlib
Hi, To open a file for reading do : open(CRONJOB, "< /home/queue/test.sh"); @data = ; close(CRONJOB); print @data; To execute a file do : system("/home/queue/test.sh", $return); or: exec("/home/queue/test.sh"); Regs David > > Hi guys, > > I need to call shell executabl

RE: updating a file in place is almost working

2002-07-01 Thread Rice, Elizabeth A.
1) The platform is UNIX Systems Services on OS/390. 2) I'm one of the Systems Programmers. 3) We might be able to send a sighup to the process, but we can't mod it. There are no other log backup processes in place. I've heard about the logrotate script, but there was some other processing we want

RE: updating a file in place is almost working

2002-07-01 Thread Anders Holm
Hi Beth. Not sure how it is on the S/390 (nice box, BTW), but any usual logrotate script I've come across would send a SIGHUP to the appropriate process, yes. Check the cron jobs of the root user, and there should be a cron job for this. Then you could run another cron job to do the processing af

RE: Obtaining a slice of unique values from an array

2002-07-01 Thread Shishir K. Singh
>on Sun, 30 Jun 2002 12:08:23 GMT, Dan Fish wrote: > What is the most efficient (or at least AN efficient :-) way of > obtaining a slice from an array wherein the slice contains only > unique values found in the array? >See > perldoc -q duplicate -- >felix This is the example "d" cited

Re: About Perl OO Orthodoxy

2002-07-01 Thread drieux
On Monday, July 1, 2002, at 02:02 , Felix Geerinckx wrote: > on Sun, 30 Jun 2002 19:58:09 GMT, [EMAIL PROTECTED] (Drieux) wrote: > >> I guess, that this was >> consistent with the expectations and standards of >> other OO coders > > Have you already studied Conway's book? I presume you mean

Re: Obtaining a slice of unique values from an array

2002-07-01 Thread Sudarsan Raghavan
"Shishir K. Singh" wrote: > >on Sun, 30 Jun 2002 12:08:23 GMT, Dan Fish wrote: > > > What is the most efficient (or at least AN efficient :-) way of > > obtaining a slice from an array wherein the slice contains only > > unique values found in the array? > > >See > > perldoc -q duplicate >

RE: Obtaining a slice of unique values from an array

2002-07-01 Thread Felix Geerinckx
on Mon, 01 Jul 2002 13:45:30 GMT, [EMAIL PROTECTED] (Shishir K. Singh) wrote: > This is the example "d" cited in perldoc -q duplicate > d) A way to do (b) without any loops or greps: [line numbers added for reference] > 01undef %saw; > 02@saw{@in} = (); > 03@out = sor

creating module

2002-07-01 Thread anthony
Hi, is there a good website to create module if so can you refere me to it thanx anthony -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: How can I free allocated memory?

2002-07-01 Thread Jenda Krynicky
From: Robert Thompson <[EMAIL PROTECTED]> > Look out for a gotcha though: > > "A more serious concern is that unreachable memory with a non-zero > reference count will not normally get freed. Therefore, this is a bad > idea: > > { > my $a; > $a = \$a; > } > > Even thought $a should

make yp oneliner

2002-07-01 Thread David vd Geer Inhuur tbv IPlib
Hi, Does anyone know how to make it a one-liner ?? @regel = split(/ /, `ypmatch IPlib auto.setuser`); chomp @regel; If anyone has suggestion to use NIS within Perl that is welcome also (with examples :). Regs David -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mai

RE: make yp oneliner

2002-07-01 Thread Nikola Janceski
you should have seen this one coming. chomp( @regel = split(/ /, `ypmatch IPlib auto.setuser`) ); > -Original Message- > From: David vd Geer Inhuur tbv IPlib > [mailto:[EMAIL PROTECTED]] > Sent: Monday, July 01, 2002 10:25 AM > To: [EMAIL PROTECTED] > Subject: make yp oneliner > > > >

Need some help

2002-07-01 Thread Mariusz Wyrozebski
I'm very curious about little script, that works as "prep" in c/c++. The problem is: We have one file, which contains lines like - #include #include blah,blah,blah - in blah you have nomal c program. Everything I want is to change li

RE: make yp oneliner

2002-07-01 Thread David vd Geer Inhuur tbv IPlib
Yep, but perl doesn't want to : Can't modify split in chomp at ./1 line 3, near ") )" Execution of ./1 aborted due to compilation errors. -- #!/user/cadiclab/bin/perl -w chomp ( @regel = split(/ /, `ypmatch IPlib auto.setuser`) ); print "hhh${_}hhh \n "

RE: updating a file in place is almost working

2002-07-01 Thread Rice, Elizabeth A.
>any usual logrotate script I've come across would send a SIGHUP to the appropriate process Thanks for you input. I tried manually emulating the logrotate script by moving the log file and then sending the kill -HUP to the processes. Unfortunately only one of several processes writing to the sam

RE: Obtaining a slice of unique values from an array

2002-07-01 Thread Shishir K. Singh
Thanks Sudarshan, Felix!! This is one of the area that I never had to look. But as the saying goes...curiosity kills the crow...I am now all into it!! Thanks again!! -Original Message- From: Felix Geerinckx [mailto:[EMAIL PROTECTED]] Sent: Monday, July 01, 2002 10:02 AM To: [EMAI

Re: updating a file in place is almost working

2002-07-01 Thread drieux
On Monday, July 1, 2002, at 05:05 , Anders Holm wrote: > Here's an example of such a script, snipped from a SOLARIS box.. Should be > able to adapt this to your needs.. ;) the alternative of course is to implement the venerable syslogRoller into perl - and then open up the holy debate about whi

Re: creating module

2002-07-01 Thread drieux
On Monday, July 1, 2002, at 08:17 , anthony wrote: > Hi, > > is there a good website to create module if so can you refere me to it Have you started with the traditional perldoc perl and checked out the internal documentation of how to do this? perldoc perlsub perldoc

Re: make yp oneliner

2002-07-01 Thread Peter Scott
At 04:25 PM 7/1/02 +0200, David vd Geer Inhuur tbv IPlib wrote: >Hi, > >Does anyone know how to make it a one-liner ?? > >@regel = split(/ /, `ypmatch IPlib auto.setuser`); >chomp @regel; "One-liners" are allowed to contain multiple statements. Of course, there's always @regel = split(/ /, `y

Re: Need some help

2002-07-01 Thread Nigel Peck
Could you please make it clear what you want to do (unless I'm missing the point) when you say you want to change the #include lines to their entry. Do you meant you want to put the data from the file in instead of the #include line? >>> Mariusz Wyrozebski <[EMAIL PROTECTED]> 07/01/02 03:29pm >>

RE: Quick Question

2002-07-01 Thread William J Black
Hi All, I have an array of directory files and I want to search via the date the directory was created. Is there a function or dash option that handles this? Thanks, William Black Duke Energy 401 S. College St. Charlotte NC -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comman

RE: Quick Question

2002-07-01 Thread Nikola Janceski
well you can't have the creation time. The closest thing is the inode change time, (not sure about what causes this time to change). @sorted = sort { (stat($a))[10] <=> (stat($b))[10] } @arrayOfFullPathDirs; [untested] > -Original Message- > From: William J Black [mailto:[EMAIL PROTEC

Re: Quick Question

2002-07-01 Thread Andy Lester
> I have an array of directory files and I want to search via the date the > directory was created. Is there a function or dash option that handles > this? Yes, they're the unary file operators: http://www.perldoc.com/perl5.6.1/pod/func/X.html xoxo, Andy -- 'Andy Lester[EMAIL PROTEC

grab user to last modify file

2002-07-01 Thread Kipp, James
anyone know of a way to determine the user who last accessed or modified a file ? thanks -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: grab user to last modify file

2002-07-01 Thread Andy Lester
> anyone know of a way to determine the user who last accessed or modified a > file ? On which platform? xoxo, Andy -- 'Andy Lester[EMAIL PROTECTED] Programmer/author petdance.com Daddy parsley.org/quinn Jk'=~/.+/s;print((split//,$&) [unpac

RE: grab user to last modify file

2002-07-01 Thread Kipp, James
SunOS 5.8 Thanks > -Original Message- > From: Andy Lester [mailto:[EMAIL PROTECTED]] > Sent: Monday, July 01, 2002 12:40 PM > To: Kipp, James > Cc: '[EMAIL PROTECTED]' > Subject: Re: grab user to last modify file > > > > anyone know of a way to determine the user who last > accessed or

Re: Need some help

2002-07-01 Thread Mariusz Wyrozebski
You,re right! But I had some hours, so my solution is : - #!/usr/bin/perl $file = "$ARGV[0]"; open(HANDLE, '<' , "$file"); @lines=; foreach $line (@lines) { @test=split("#include",$line); print $test[0] ; @plik=split("#include <",$line); @plik1=split(">",$plik[1])

Re: grab user to last modify file

2002-07-01 Thread Andy Lester
> > > anyone know of a way to determine the user who last > > accessed or modified a > > > file ? In general, anything you want to know about a given file is available thru the stat() function. http://www.perldoc.com/perl5.6.1/pod/func/stat.html xoxo, Andy -- 'Andy Lester[EMAIL PROTEC

RE: grab user to last modify file

2002-07-01 Thread Kipp, James
> > > anyone know of a way to determine the user who last > > accessed or modified a > > > file ? > > In general, anything you want to know about a given file is available > thru the stat() function. > http://www.perldoc.com/perl5.6.1/pod/func/stat.html > anything BUT what i need above. --

Re: grab user to last modify file

2002-07-01 Thread Andy Lester
> > thru the stat() function. > > http://www.perldoc.com/perl5.6.1/pod/func/stat.html > > > > anything BUT what i need above. Sure, you want these two elements: 4 uid numeric user ID of file's owner 5 gid numeric group ID of file's owner alester@flr4[~/play]$ more owner !/usr/bi

RE: grab user to last modify file

2002-07-01 Thread Nikola Janceski
I have yet to learn who cometh and touched my files while I sleep. All OSes are equally bad a this. You only have owner of a file, and that's it! Lemme guess.. you have something chmod 777 and you want to know who changed the webpage main page to some porno pic? Best thing to do is setup groups

RE: grab user to last modify file

2002-07-01 Thread Kipp, James
> > > thru the stat() function. > > > http://www.perldoc.com/perl5.6.1/pod/func/stat.html > > > > > > > anything BUT what i need above. > > Sure, you want these two elements: > > 4 uid numeric user ID of file's owner > 5 gid numeric group ID of file's owner this only states the

RE: grab user to last modify file

2002-07-01 Thread Nikola Janceski
The only other method is to find the Modification time of the file, and check the login times and then go inny meany miney moe. > -Original Message- > From: Nikola Janceski > Sent: Monday, July 01, 2002 1:05 PM > To: 'Kipp, James'; '[EMAIL PROTECTED]' > Subject: RE: grab user to last mod

Re: grab user to last modify file

2002-07-01 Thread Andy Lester
> > 4 uid numeric user ID of file's owner > > 5 gid numeric group ID of file's owner > > this only states the current ID and GID OWNER, not last WHO last modified > the file Ah, that. You can't do that. Unix doesn't support that sort of thing. If you can't get it from, say, ls,

Quick Debug question

2002-07-01 Thread Nikola Janceski
I have my 2000+ line script cranking away for the past 3 hours. I am pretty sure that it's caught in an infinite loop somewhere. I have it running in debug mode (yes it should have been done 2 hours ago even in debug mode). I can stop the process, but I want to dump all the variable info to file,

Result of xmessage

2002-07-01 Thread Vitor Carlos Flausino
Hi, my perl code is as simple as #!/usr/bin/perl if (system ("xmessage -default No -nearmouse -buttons Yes:2,No:3 Do you realy want to run Daily TVG?") == 0){ } print $?; The result is 26112 when i press Yes and 25856 when I press No (). If I run from the command line, the result

RE: grab user to last modify file

2002-07-01 Thread Kipp, James
> > > The only other method is to find the Modification time of the > file, and > check the login times and then go inny meany miney moe. either that or grovel through the output of 'ps' or 'w' at the time it notices the file is accessed, of course then i will have another daemon to worry abou

RE: grab user to last modify file

2002-07-01 Thread Kipp, James
> I have yet to learn who cometh and touched my files while I > sleep. All OSes > are equally bad a this. i think it can be done in NT with AdminMisch module, but in *nix i have no idea > You only have owner of a file, and that's it! Lemme guess.. you have > something chmod 777 and you want

RE: grab user to last modify file

2002-07-01 Thread Kipp, James
> > You can't do that. Unix doesn't support that sort of thing. If you > can't get it from, say, ls, then Perl sure can't figure it > out, either. I thought that was the case, but figured somebody may have a done it. I guess i will have to go to plan b like this: 1. run as a deamon 2. monitor

RE: grab user to last modify file

2002-07-01 Thread Nikola Janceski
interesting file...What is it? why not give write permission to the directory, but no write to the file? Then if someone wants to modify it they MUST remove the file and create it themselves. Then your deamon can be run as root and always chmod the file to no-write. > -Original Message-

RE: updating a file in place is almost working

2002-07-01 Thread Rice, Elizabeth A.
Well, I think I figured it out. When I reviewed the examples in Perl Cookbook more closely I realized that the array has to be big enough to hold all the lines that go back into the existing file. If we run our script shortly after midnight, parsing for date, most of the lines will go to the .old

Monthly posting ststistics - June 2002

2002-07-01 Thread Felix Geerinckx
Monthly posting statistics for perl.beginners - June 2002. >From 2002-06-01 to 2002-06-30 there were 1895 articles posted (92208 lines) by 273 authors, giving an average 6.94 articles per author, and an average article length of 49 lpa. The average number of articles per day was 63. There were

Weekly posting statistics - 26/2002

2002-07-01 Thread Felix Geerinckx
Weekly posting statistics for perl.beginners - week 26 of 2002. >From Monday 2002-06-24 to Sunday 2002-06-30 there were 448 articles posted (21756 lines) by 119 authors, giving an average 3.76 articles per author, and an average article length of 49 lpa. The average number of articles per day w

Re: grab user to last modify file

2002-07-01 Thread drieux
On Monday, July 1, 2002, at 09:52 , Kipp, James wrote: anyone know of a way to determine the user who last accessed or modified a file ? >> >> In general, anything you want to know about a given file is available >> thru the stat() function. >> http://www.perldoc.com/perl5.6.1/po

RE: grab user to last modify file

2002-07-01 Thread Kipp, James
> > interesting file...What is it? the .profile and some others that our dept uses > > why not give write permission to the directory, but no write > to the file? > Then if someone wants to modify it they MUST remove the file > and create it > themselves. > Then your deamon can be run as r

RE: Quick Debug question

2002-07-01 Thread Nikola Janceski
I really need a clue on this one. I have tried 'X' with no args, and 'V' with no args but all I get is the %INC and %ENV and couple of other things, but all the variables that are declared in the main script are not list using this method. HELP?? > -Original Message- > From: Nikola J

COM PORT

2002-07-01 Thread mouse
Hi, How recive and send data to com port. thanx -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

printf question

2002-07-01 Thread Ned Cunningham
Hi, Can anyone tell me how to print the following data so that it rounds up even though it shouldn't $data = "3.424"; Printf WRFILE ("%11.2f", $data); My results are 3.42 I need it to round up even if it is only .001 ? TIA -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additio

RE: printf question

2002-07-01 Thread Nikola Janceski
I don't know what accuracy you need.. but: #my $data = "3.420"; my $data = "3.424"; $data = sprintf ("%11.3f", $data); $data = sprintf ("%11.2f", $data + scalar($data =~ /[1-9]$/) / 100 ); printf ("%11.2f\n", $data); > -Original Message- > From: Ned Cunningham [mailto:[EMAIL PROTECTED]]

Re: grab user to last modify file

2002-07-01 Thread Shawn
ok folks, this really was NOT worth this many emails... http://sabernet.home.attbi.com/papers/Solaris.html Someone turn up the content quality on this list back up to it's usually high level... On 07/01, Kipp, James said something like: > SunOS 5.8 > Thanks > > > -Original Message- > >

RE: printf question

2002-07-01 Thread Nikola Janceski
correction on my 4th line. $data = sprintf ("%11.2f", $data + (scalar($data =~ /[1-9]$/) && 0.005) ); > -Original Message- > From: Nikola Janceski [mailto:[EMAIL PROTECTED]] > Sent: Monday, July 01, 2002 2:55 PM > To: 'Ned Cunningham'; '[EMAIL PROTECTED]' > Subject: RE: printf question >

RE: printf question

2002-07-01 Thread Ned Cunningham
The first one worked great thankyou -Original Message- From: Nikola Janceski [mailto:[EMAIL PROTECTED]] Sent: Monday, July 01, 2002 3:10 PM To: Nikola Janceski; 'Ned Cunningham'; '[EMAIL PROTECTED]' Su

Net::IMAP

2002-07-01 Thread Mat Harris
Am i right in thinking that Net::IMAP is a relatively new module? I have been trying to use it and the documentation is really poor. Matthew Harrison Internet/Network Services Administrator www.genestate.com This e-mail (and any attachments) is confidential and may contain personal views whi

Re: printf question

2002-07-01 Thread Felix Geerinckx
on Mon, 01 Jul 2002 18:32:27 GMT, Ned Cunningham wrote: > Can anyone tell me how to print the following data so that it rounds > up even though it shouldn't > $data = "3.424"; > [...] > I need it to round up even if it is only .001 ? use strict; use POSIX qw(ceil); sub rou

RE: grab user to last modify file

2002-07-01 Thread Timothy Johnson
Nice link. Too bad I'm not authorized to view the page... -Original Message- From: Shawn [mailto:[EMAIL PROTECTED]] Sent: Monday, July 01, 2002 11:54 AM To: Kipp, James Cc: 'Andy Lester'; '[EMAIL PROTECTED]' Subject: Re: grab user to last modify file ok folks, this really was NOT wort

RE: printf question

2002-07-01 Thread Timothy Johnson
You could always try adding .999 to the value before sprintf()ing it... -Original Message- From: Ned Cunningham [mailto:[EMAIL PROTECTED]] Sent: Monday, July 01, 2002 11:32 AM To: '[EMAIL PROTECTED]' Subject: printf question Hi, Can anyone tell me how to print the following data so th

Re: Net::IMAP

2002-07-01 Thread Felix Geerinckx
on Mon, 01 Jul 2002 19:20:21 GMT, Mat Harris wrote: > Am i right in thinking that Net::IMAP is a relatively new module? > > I have been trying to use it and the documentation is really poor. You may have more luck with Net::IMAP::Simple, especially if you have been using Net::POP3. See

Re: printf question

2002-07-01 Thread Jeff 'japhy' Pinyan
On Jul 1, Ned Cunningham said: >Can anyone tell me how to print the following data so that it rounds up >even though it shouldn't Use the POSIX::ceil() function, instead of some crufty solution. use POSIX 'ceil'; printf WRFILE "%11.2f", ceil($data); -- Jeff "japhy" Pinyan [EMAIL

Re: printf question

2002-07-01 Thread Jeff 'japhy' Pinyan
On Jul 1, Jeff 'japhy' Pinyan said: >On Jul 1, Ned Cunningham said: > >>Can anyone tell me how to print the following data so that it rounds up >>even though it shouldn't > >Use the POSIX::ceil() function, instead of some crufty solution. > > use POSIX 'ceil'; > printf WRFILE "%11.2f", ceil

Re: Net::IMAP

2002-07-01 Thread Mat Harris
yes i have seen the simple version but the functionality seems minute in comparison At 19:29 01/07/2002 +, Felix Geerinckx wrote: >on Mon, 01 Jul 2002 19:20:21 GMT, Mat Harris wrote: > > > Am i right in thinking that Net::IMAP is a relatively new module? > > > > I have been trying to use it

df hang inside script

2002-07-01 Thread Deb
Hey Folks, Recently I had a problem where a *nix system NFS was hung on a server which had "gone away," but the client hadn't umounted the filesystem. Later, this caused a script in cron to fail, in that a df command inside the script never completed, and instead it "hung," causing the script to

Random images on bulletin boards

2002-07-01 Thread Troy May
Hello, I'm trying to make a random signature for use on bulletin boards. Images are fine, they are set sizes. But I'm trying to make it display Flash files also. These Flash files default to full-screen when there are no size limits set. I can't figure out how to adjust this script to display

Install Module Spreadsheet::WriteExcel

2002-07-01 Thread Mok T.Y.-r15382
I encountered difficulty in installing Module Spreadsheet::WriteExcel and desperately need your guidance. Below is what my system have displayed while using nmake15 utility. D:\perl\SPREAD~1.37>dir Volume in drive D has no label. Volume Serial Number is E4CE-279D Directory of D:\perl\SPR

Embperl and DBI on perl5.6

2002-07-01 Thread Anthony Dunne
Hi, real newbie here, I am trying to configure a website on Redhat7.3 with perl 5.6 and Apache. Both were installed in default locations during server install of Redhat7.3 The website needs HTML-Embperl and DBI and I have installed both of these from the rpm's. httpd.conf contains: SetEnv PERL5L