Re: "my", "strict", and function references

2001-07-28 Thread Walt Mankowski
On Sat, Jul 28, 2001 at 07:10:59PM -0700, Dan Grossman wrote: > I'm wondering why Perl doesn't complain about the following code: > > -- > #!/usr/bin/perl -w > use strict; > > my $funcRef = \&otherDummyFunc; > my $oneVar = &callTheReferredFunc(); > print $oneVar; > > sub dummyFunc { >

Re: Script for Sheduling jobs on NT

2001-07-28 Thread Walt Mankowski
On Sat, Jul 28, 2001 at 01:56:46PM +0200, Ackim Chisha wrote: > Does any one already have a perl script for NT that I could use to run like > a cron job in unix. Am writing a scrip that I need to have running every 5 > minuteseveryday. Or is there a way I can write my script so that it runs > eve

Re: last line

2001-07-27 Thread Walt Mankowski
COLLINEAU writes: > How can i do to delete the last line of a file ? >From perlfaq5... How do I change one line in a file/delete a line in a file/insert a line in the middle of a file/append to the beginning of a file? In the unique case of deleting lines at the end o

Re: Hi, what time() ^ $$ means?

2001-07-10 Thread Walt Mankowski
On Wed, Jul 11, 2001 at 12:34:37AM -0400, Walt Mankowski wrote: > On Tue, Jul 10, 2001 at 07:27:04PM -0700, Erik W wrote: > > $$<<15 ??? > > This shifts the value of $$ 15 bits to the left, which is the same as > multiplying $$ by 2**15. I forgot to reference the co

Re: Hi, what time() ^ $$ means?

2001-07-10 Thread Walt Mankowski
On Tue, Jul 10, 2001 at 07:27:04PM -0700, Erik W wrote: > Thanks a lot, then what << means? >From perldoc perlop... Binary "<<" returns the value of its left argument shifted left by the number of bits specified by the right argument. Arguments should be integers. (See also

Re: Hi, what time() ^ $$ means?

2001-07-10 Thread Walt Mankowski
On Tue, Jul 10, 2001 at 09:56:55PM -0400, Jeff 'japhy' Pinyan wrote: > Just so you know, you don't need to call srand() in modern versions of > Perl. Unless, of course, you want to seed the random number generator to a specific value. :-) Walt

Re: How to make a resource intensive script less intensive.

2001-07-08 Thread Walt Mankowski
On Sun, Jul 08, 2001 at 02:20:40PM -0400, Jim Conner wrote: > I am writing a script that is quite cool imo once I get it done. But > already I am seeing that it takes a ton of system resources. Simply put, > the script watches a log file (like tail -f) and then reacts to certain > things that

Re: syntax highlighting module

2001-07-07 Thread Walt Mankowski
On Fri, Jul 06, 2001 at 12:27:14PM +0500, Rizwan wrote: > Where can I find a systax highlighting module for perl in perl. > I want to call it from within the script and pass a perl script file to be > syntactically highlighted.. I haven't tried it, but if you want the output to be HTML you might

Re: syntax highlighting module

2001-07-07 Thread Walt Mankowski
On Fri, Jul 06, 2001 at 12:27:14PM +0500, Rizwan wrote: > Where can I find a systax highlighting module for perl in perl. > I want to call it from within the script and pass a perl script file to be > syntactically highlighted.. I haven't tried it, but if you want the output to be HTML you might

Re: problems with chmod

2001-07-07 Thread Walt Mankowski
On Sat, Jul 07, 2001 at 10:48:14AM -0500, [EMAIL PROTECTED] wrote: > #!/usr/bin/perl -w > > use strict; > > my $dir = "cody"; > mkdir("$dir",0770); > > > i am running this in my home directory on a linux machine, so i have full > rights. when i run this however, the permissions on the director

Re: Joining variables

2001-06-27 Thread Walt Mankowski
On Wed, Jun 27, 2001 at 02:07:22PM +0100, Pierre Smolarek wrote: > $newvar = $var1."-".$var2."-".$var3; or $newvar = "$var1-$var2-$var3";

Re: Date in NT?

2001-06-26 Thread Walt Mankowski
On Wed, Jun 27, 2001 at 12:23:36AM -0400, Jeff 'japhy' Pinyan wrote: > Or use the POSIX::strftime() function, which uses its own %X formats to > create a date string. Or the UnixDate() function in Date::Manip.pm, although that's almost certainly overkill for what you're doing here. Walt

Re: HELP! this has me rather ummm PISSED ;)

2001-06-26 Thread Walt Mankowski
On Tue, Jun 26, 2001 at 03:04:33PM -0400, Yacketta, Ronald wrote: > the following should > 1) suck in all the files in a dor > 2) split them into 3 arrays (logger files only) > 3) run a forked egrep on each array of files I don't understand why you're going to all the trouble of building three ar

Re: Date in NT?

2001-06-26 Thread Walt Mankowski
On Tue, Jun 26, 2001 at 10:53:12PM -0500, Steve Howard wrote: > I would suggest using the localtime function. That will work regardless of > OS. > > ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = > localtime(time); > ($mon, $year) = ($mon+1, $year+1900); That doesn't quite work,

Re: a trivial problem...

2001-06-03 Thread Walt Mankowski
On Sun, Jun 03, 2001 at 12:08:52AM -0500, Brent Alan Buckalew wrote: > Hello all, > > I've constructed a perl script to extract certain lines of data and print > them out and use them in a later analysis. The catch I've run into is > that the style I used for the first batch doesn't work for > t

Re: looping over an array of hashes

2001-06-01 Thread Walt Mankowski
On Fri, Jun 01, 2001 at 03:29:43PM -0700, Chuck Ivy wrote: > First post, quick question: > > I've got an array of hashes that I'm defining the most basic way I can... > > my $gSeasonID; > my @season_list = ''; > while (@fields = $sth->fetchrow_array) { > $gSeasonID = $fields[0]; > $s

Re: how to wait 50 second ?

2001-06-01 Thread Walt Mankowski
On Fri, Jun 01, 2001 at 01:53:17PM +0200, [EMAIL PROTECTED] wrote: > Is it possible to use a commando in Perl that will wait for example 50 > seconds an then will continue ? Yes -- sleep(50) See perldoc -f sleep for more information. Walt

Re: test for real number

2001-05-30 Thread Walt Mankowski
On Wed, May 30, 2001 at 01:56:40PM -0700, [EMAIL PROTECTED] wrote: > How do I test an input to see if it is a real number? $ perldoc -q float Found in /usr/local/lib/perl5/5.6.1/pod/perlfaq4.pod How do I determine whether a scalar is a number/whole/integer/float? Assuming that y

Re: qw

2001-05-30 Thread Walt Mankowski
On Wed, May 30, 2001 at 03:38:35PM -0500, Nichole Bialczyk wrote: > i'm trying to work my way throuh an existing script and it says > > @array = qw("stuff", "more stuff", "even more stuff"); > > what does the qw do? In your example, it's a broken way of trying to say: $array[0] = "stuff"; $arr

Re: Sleeping for less than a second

2001-05-30 Thread Walt Mankowski
On Wed, May 30, 2001 at 01:47:55PM -0400, Jeff Pinyan wrote: > =head1 Found in /usr/local/lib/perl5/5.00502/pod/perlfaq8.pod Looks like you're overdue for an upgrade... :-) Walt -- Walter C. Mankowski Senior Software EngineerMyxa Corporation phone: (610) 234-2626 fax: (610) 2

Re: Sleeping for less than a second

2001-05-30 Thread Walt Mankowski
On Wed, May 30, 2001 at 01:42:17PM -0400, Craig Moynes/Markham/IBM wrote: > Hi all, my DNS server is down so I can't check online. No need to check online. This answer is in the FAQ that comes with Perl. > Is there anyway to sleep for less than a second using the default > installation of perl

Re: Sockets help

2001-05-30 Thread Walt Mankowski
On Wed, May 30, 2001 at 09:47:51AM -0400, Jason wrote: > I need to write a program that will take a list of url's for pictures > and download them. I was reading up on sockets but i found them a bit > confusing. Some assistance with sockets would be very helpfull. Use LWP::Simple. It can alrea

Re: Simple question

2001-05-29 Thread Walt Mankowski
On Tue, May 29, 2001 at 05:25:18PM -0400, [EMAIL PROTECTED] wrote: > > > Hi All, > I am working on the following output. > > * /ebppvobstore/vobs/Core /ebppvobstore/vobs/aci.vbs public > * /ebppvobstore/vobs/UCMCQ /ebppvobstore/vobs/UCMCQ.vbs public (ucmvob) > /ebppvobstore/vobs/Comp_Ca

Re: How to delete an element in array?

2001-05-29 Thread Walt Mankowski
On Tue, May 29, 2001 at 11:59:18AM -0700, Randal L. Schwartz wrote: > > "Brett" == Brett W McCoy <[EMAIL PROTECTED]> writes: > > >> Uh, careful. This got added to 5.6.1 to support pseudo-hashes and is > >> probably coming back out when pseudo-hashes get removed in 5.10. > >> ("Death to pseud

Re: Regexp - missing matches

2001-05-25 Thread Walt Mankowski
On Fri, May 25, 2001 at 11:43:21AM -0400, Craig Moynes/Markham/IBM wrote: > I have the following regexp: > > @matches = $params{f} =~ /(%[aAbBcCdDehHIjmMnprStTuUVwWyY%])/g; > > If I have a script: > > [snip] > my @matches; > my ( %params ); > getopts('DRSa:f:s:d:r:b:w:n:h?', \%params); > > pri

Re: handling flat-file layouts -- pack or sprintf or something else?

2001-05-24 Thread Walt Mankowski
On Thu, May 24, 2001 at 10:58:38PM -0400, Stephen P. Potter wrote: > Lightning flashed, thunder crashed and chris brown <[EMAIL PROTECTED]> whispered: > | I would prefer to write each record using pack, but I > | can't see how to elegantly get pack to zero-fill > | without using sprintf. And I ki

Re: Sort

2001-05-24 Thread Walt Mankowski
On Thu, May 24, 2001 at 06:25:30PM -0500, Teresa Raymond wrote: > I would like to add sort to an existing script that was written by > someone else. I've taken an Intro to Perl class and a CGI-Perl > class. I can't understand the script AT ALL and at this point I've > written a bulletin board

Re: script that runs all the time to monitor log file

2001-05-24 Thread Walt Mankowski
On Thu, May 24, 2001 at 02:37:18PM -0400, Craig Moynes/Markham/IBM wrote: > > This is a problem with tail that I have run into as well. > > If the file size gets reset the stored location of EOF remains the same > which is a problem. As the file is written too the size is still below that > of w

Re: How to "touch" a file for testing -C

2001-05-24 Thread Walt Mankowski
On Thu, May 24, 2001 at 11:00:19AM -0700, Mark Folse wrote: > I was written a small application to check the date of the files to > process, and sleep until the new days's files arrived. My problem was > testing. Is there someway not in the man pages to "touch" a file so > that the return from -C