PRELOADING IMAGES FOR A WEB SITE

2001-07-10 Thread Morgan Mackenzie
PERL newbie here! I am using Javascript to preload my images for a web site I am working on. If I can use PERL for everything, I would love too. Any thoughts where I can get information on how to do this (if it's possible. . . what am I saying, w/ PERL everything is possible). Morgan

FW: REGEX

2001-07-10 Thread Govinderjit Dhinsa
> Thank you for your reply. I made the changes you suggested, however some > of them did not work, these where the following results; > > # while (defined($line=)){ *produced only line 1* > # while(){ *produced NO lines* > # print SORTCODE @fields[0..33,2

Re:Inetd and restart

2001-07-10 Thread Jorge Goncalvez
Hi, I have this code written in Perl to restart inetd but nothing happens. sub restart_serv { $PROG = "c:/cygwin/usr/sbin/inetd.exe"; $SIG{HUP} = \&phenix; sub phenix { exec($PROG) or die " can't restart : $!\n"; } } th

RE:How to start a daemon

2001-07-10 Thread Jorge Goncalvez
Hi I am under Windows 98 with the cygwin environment and I would like to know how we can start and restart a daemon with perl.

RE: \r

2001-07-10 Thread Govinderjit Dhinsa
I have a input file which is a fixed line file (all along one line, no " \n or \r "). ## Q. How would I separate each data type, to do the following; At @fields 490, insert \r (carriage return). So I want the input

RE: Need help with errors - strict the problem?

2001-07-10 Thread mark crowe (JIC)
Craig 'my' doesn't initialise a variable, it just declares it. The variable still needs a value assigned to it. If it was a problem with 'strict' you would get an error along the lines of 'Global symbol "$value" requires explicit package name at line n' at compile time (ie the program wouldn't ev

Directories

2001-07-10 Thread Porter, Chris
Calling perl gurus, Hello, help please!!! Looking to delete empty directories, I have a script for that but if the directories have files in them, it dies. Either can I add some type of script to delete them also or can I just avoid them all together and just delete the empty ones. Any help w

RE: newbie whitespace question

2001-07-10 Thread Aaron Craig
At 15:49 09.07.2001 -0700, Wagner-David wrote: > Change:if ( /^Kilobytes:(.*)$/ ) to if ( /^Kilobytes:\s*(\d*)$/ ) > > where $1 will have your count without leading spaces. You may want >a test to verify that you did get a hit on digits. > >Wags ;) > That only works if the text followi

Re: PRELOADING IMAGES FOR A WEB SITE

2001-07-10 Thread Aaron Craig
At 01:13 10.07.2001 -0700, Morgan Mackenzie wrote: >PERL newbie here! > >I am using Javascript to preload my images for a web site I am working on. >If I can use PERL for everything, I would love too. Any thoughts where I >can get information on how to do this (if it's possible. . . what am I >sa

RE: newbie whitespace question

2001-07-10 Thread Aaron Craig
>At 15:49 09.07.2001 -0700, Wagner-David wrote: >> Change:if ( /^Kilobytes:(.*)$/ ) to if ( /^Kilobytes:\s*(\d*)$/ ) >> >> where $1 will have your count without leading spaces. You may want >>a test to verify that you did get a hit on digits. >> >>Wags ;) > >That only works if the text

FW: Running out of memory

2001-07-10 Thread Blader Robert G DLVA
I have a program that reads through a log file (from a firewall actually) and generates a few statistics from it. Problem is that is uses a ton of memory. I had to add a lot (500MB) of swap to a Linux box with 128 MB to begin with. BTW - Nothing else is running. I commented out everyt

Newbie Deleting Table Records Problem

2001-07-10 Thread Mark Martin
Hi, not having much luck with the following my $sql = qq{delete from table where field = something}or warn ; my $sth1 = $dbh->prepare ($sql1) or warn ...; $sth1->execute() or warn ..; while (@row1 = $sth1->fetchrow) { print" @row1 records were d

Re: Perl & Getversion

2001-07-10 Thread Jorge Goncalvez
Hi, there is an equivalent of the C getversion in Perl because I am making a program which could work in Win Nt and Win 98 with different implementations for the OS. Thanks.

STDIN and STDOUT

2001-07-10 Thread Bob Mangold
Hello, I sent an email yesterday, but never heard anything. Maybe it was the word 'php' in the subject, but let me just simplify and ask another way. Is there a way to automatically direct all STDERR output to STDOUT. A module I have installed automatically creates STDERR output, but I want that

Re: Newbie Deleting Table Records Problem

2001-07-10 Thread jcowan
Hello, A delete doesn't return any rows with is why your fetchrow isn't able to return any data and you never get inside the while loop. I'm assuming that you want to do the delete and then show the user what it is that they just blew away. If this is the case, ou'd probably be better off ch

RE: Running out of memory

2001-07-10 Thread John Edwards
IIRC open ( FWLOG, "./logfile.010626"); while() { # Reads one line at a time into memory ... } @data = ; # Reads the whole file into memory You are replicating the second case, by reading the file a line at a time, then splitting into an array, you are creating a massive array which will be me

Re: STDIN and STDOUT

2001-07-10 Thread Rashid Faraby
Try BEGIN { open (STDERR, ">c:/temp/error.txt"); } To capture STDERR in temporary text file. I always use this in my scripts for debugging purposes. It usually helps ;-} Rashid -Original Message- From: Bob Mangold <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Date: Tue, 10 Jul 2001 0

Re: STDIN and STDOUT

2001-07-10 Thread Robert Aspinall
Hello, open (STDERR, ">&STDOUT"); I think that'll do the trick. If it doesn't.. remove the &, and it will. (Sorry, I'm not at a perl enabled machine right now :) ) Robert Aspinall Support Engineer V-ONE Corporation [EMAIL PROTECTED] - Original Message - From: "Bob Mangold" <[EMAIL PRO

Re: REGEX[2]

2001-07-10 Thread Robert Aspinall
Try it this way.. see the code below. open ISCD,"; #This gets ISCD closed and safely out of harms way. close (ISCD); open NEW,">.pl"; foreach $line (@temparray){ chomp $line; @fields = split //, $line; printf NEW '%1.1s' x 44, @fields[0..33,290..299]; } close NEW; ex

Re: STDIN and STDOUT

2001-07-10 Thread Craig Moynes/Markham/IBM
>Hello, >I sent an email yesterday, but never heard anything. Maybe it was the word >'php' in the subject, but let me just simplify and ask another way. >Is there a way to automatically direct all STDERR output to STDOUT. A module I >have installed automatically creates STDERR output, but I want t

SMTP - outgoing email - Now Working

2001-07-10 Thread Stewart Watkiss
Thanks to everyone that replied to my question. I have now got this working using the Mail::Sendmail module. I was aware of this module, but I had misunderstood how it worked. I thought that it needed sendmail (the UNIX mail daemon) to be running locally (it's default setting), however I now kno

Re: STDIN and STDOUT

2001-07-10 Thread Rashid Faraby
Try BEGIN { open (STDERR, ">c:/temp/error.txt"); } To capture STDERR in temporary text file. I always use this in my scripts for debugging purposes. It usually helps ;-} Rashid -Original Message- From: Bob Mangold <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Date: Tue, 10 Jul 2001 0

Re: Directories

2001-07-10 Thread Craig Moynes/Markham/IBM
> Calling perl gurus, > Hello, help please!!! Looking to delete empty directories, I have a script > for that but if the directories have files in them, it dies. Either can I > add some type of script to delete them also or can I just avoid them all > together and just delete the empty ones. A

Re: Perl & Getversion

2001-07-10 Thread Jos I. Boumans
in your %ENV should be the information of what OS you run try this statement: for (sort keys %ENV) { print "$_ is $ENV{$_}\n" } for my win2k machine it says: OS is Windows_NT if you're looking for the perlversion it's stored in the $] variable... hth, Jos Boumans > Hi, there is an equivalen

Perl-case statement, and module syntax error

2001-07-10 Thread Sparkle Williams
I'm having two problems 1) Is there an equivalent of the case function in Perl? 2)I'm also getting a syntax error for the following part of my program that I'm attempting to run on my Unix system. I get a syntax error message for 'new($url, ', 'login($username, 'cwd($ftp_home), ', and 'get($fil

RE: Some body help!

2001-07-10 Thread Govinderjit Dhinsa
> I have a input file which is a fixed line file (all along one line, no " > \n or \r "). > ## > Q. How would I separate each data type, to do the following; > > At @fields 490, insert \r (carriage return). > > So I want the input file, to look l

Re: timer/display

2001-07-10 Thread Tyler Longren
I've been playing with this spinning wheel thing. I've read through this thread: I don't know why this doesn't work: #!/usr/bin/perl -w use strict; $| = 1; use Time::HiRes qw(usleep); my @windmill=("\\", "|", "/", "-"); for(my $

Re: timer/display

2001-07-10 Thread Chas Owens
Try print "$windmill[$_ % 4]\r" instead. On 10 Jul 2001 09:04:18 -0500, Tyler Longren wrote: > I've been playing with this spinning wheel thing. I've read through this > thread: > > > I don't know why this doesn't work: > >

RE: \r

2001-07-10 Thread Paul
--- Govinderjit Dhinsa <[EMAIL PROTECTED]> wrote: > I have a input file which is a fixed line file (all along one line, > no " \n or \r "). > ## > Q. How would I separate each data type, to do the following; > > At @fields

Re: timer/display

2001-07-10 Thread Jeff 'japhy' Pinyan
On Jul 10, Tyler Longren said: >#!/usr/bin/perl -w >use strict; >$| = 1; >use Time::HiRes qw(usleep); >my @windmill=("\\", "|", "/", "-"); >for(my $i=0; $i <= 1; $i++) { >print "$windmill[$_ & 3]\r"; >usleep(5); >} > >I get this error: >Use of uninitialized value in bitwis

Re: timer/display

2001-07-10 Thread Tyler Longren
I have tried that. Here's the error I get from that: Use of uninitialized value in modulus (%) at ./test.pl line 7. Tyler - Original Message - From: "Chas Owens" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, July 10, 2001 9:19 AM Subject: Re: timer/display > Try > > print

Re: timer/display

2001-07-10 Thread Tyler Longren
this for loop works: for(my $i=0; $i <= 1; $i++) { print "$windmill[$i % 4]\r"; usleep(5); } I changed the $_ to $i... Tyler - Original Message - From: "Jeff 'japhy' Pinyan" <[EMAIL PROTECTED]> To: "Tyler Longren" <[EMAIL PROTECTED]> Cc: <[EMAIL PROTECTED]> Sent

Re:Perl $ GetVersion

2001-07-10 Thread Jorge Goncalvez
Hi Jos, in my %ENV there isn't my OS I tested it. I tried this sub restart_serv { my $OS = Win32::API::GetVersion(); $dwVersion = GetVersion(); if(!$dwVersion < 0x8000) # windows 98 not windows NT #for (sort keys %ENV) { prin

Re: STDIN and STDOUT

2001-07-10 Thread Chas Owens
On 10 Jul 2001 04:45:56 -0700, Bob Mangold wrote: > Hello, > > I sent an email yesterday, but never heard anything. Maybe it was the word > 'php' in the subject, but let me just simplify and ask another way. > > Is there a way to automatically direct all STDERR output to STDOUT. A module I > hav

Re: timer/display

2001-07-10 Thread Jos I. Boumans
quick glance tells me you should be using $i iinstead of $_ - Original Message - From: "Tyler Longren" <[EMAIL PROTECTED]> To: "Chas Owens" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Tuesday, July 10, 2001 4:11 PM Subject: Re: timer/display > I have tried that. Here's the error I g

Re: STDIN and STDOUT

2001-07-10 Thread Paul
--- Bob Mangold <[EMAIL PROTECTED]> wrote: > Hello, > > I sent an email yesterday, but never heard anything. Maybe it was the > word 'php' in the subject, but let me just simplify and ask another > way. > > Is there a way to automatically direct all STDERR output to STDOUT. A > module I have in

A simple question

2001-07-10 Thread Jie Meng
Dear all, I plan to write a simple remote connection script, and then "ls" the content of the current directory, input like telnet hostname username password ls I use the following script: system ("telnet hostname"); = "username\n"; = "password\n"; system ("ls"); It failed in the syntax.

Re: Perl-case statement, and module syntax error

2001-07-10 Thread Jason Purdy
Just got the answer to #1 for you: check out 'switch' - documented in the 'perlsyn' perldoc. There is no 'case' or 'switch' function, but you can emulate it with a block & exit routine, as documented. Jason - Original Message - From: "Sparkle Williams" <[EMAIL PROTECTED]> To: <[EMAIL PR

Re: A simple question

2001-07-10 Thread Craig S Monroe
Jie, I am not an expert, but since participating in this wonderful list, it has been inferred that one should shy away from system commands when perl actually has modules that are designed for the desired goal. I would check out IO::Socket or Net::Telnet. Craig [EMAIL PROTECTED] Pager Numeric: 1

Re: STDIN and STDOUT

2001-07-10 Thread Bob Mangold
> Does anybody know why he shouldn't do the following? > > *STDERR = *STDOUT; > This is what I orignally tried, and is didn't really work. I think my problem lies in the fact that I am hoping to make the change in a module that I am 'use'ing. So I tried all of the suggestions, but it seemed tha

Re: STDIN and STDOUT

2001-07-10 Thread Paul
--- Bob Mangold <[EMAIL PROTECTED]> wrote: > > Does anybody know why he shouldn't do the following? > > > > *STDERR = *STDOUT; > > > > This is what I orignally tried, and is didn't really work. I think my > problem lies in the fact that I am hoping to make the change in a > module that I am 'u

Re: A simple question

2001-07-10 Thread Luke Bakken
Use rsh or ssh - system "rsh -l $username $hostname ls"; for the above to wrk without a password, your client machine's hostname must be in $username's .rhosts file. Better yet, use ssh with RSA or DSA authentication - then you won't be exposing your password in plaintext. There's also a Net::

Shared memory

2001-07-10 Thread Rolf Banting
A question on shared memory on Solaris 2.6. The scenario is that I want to share data between a C-prog and a perl prog. I can create a segment fine from perl using either the shmget or IPC::ShareLite methods and a test C-prog is happily writing data to the segment. Likewise I can get another C-p

Re: perl / php question

2001-07-10 Thread M.W. Koskamp
- Original Message - From: Bob Mangold <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, July 09, 2001 7:43 PM Subject: perl / php question > Hello, > > I'm not sure if anyone here can help me with this, but at least some direction > in where to to look would be great. > > I'm u

Help: Searching an array question++

2001-07-10 Thread Bob Bondi
Yep, another newbie at Perl. I have come to a wall. What I need to do is open a file, find a value in the file and substitute a value. I've gotten to the point of what to do with an open file. I have been trying the @array = statement. I then wanted to verify the contents of the array and tried p

Re: A simple question

2001-07-10 Thread M.W. Koskamp
- Original Message - From: Jie Meng <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, July 10, 2001 5:02 PM Subject: A simple question Dear all, I plan to write a simple remote connection script, and then "ls" the content of the current directory, input like telnet hostname u

Re: Help: Searching an array question++

2001-07-10 Thread Aaron Craig
At 08:32 10.07.2001 -0700, Bob Bondi wrote: >Yep, another newbie at Perl. I have come to a wall. What I need to do is >open a file, find a value in the file and substitute a value. >I've gotten to the point of what to do with an open file. I have been trying >the @array = statement. >I then wante

Re: A simple question

2001-07-10 Thread Craig Moynes/Markham/IBM
From: Jie Meng <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, July 10, 2001 5:02 PM Subject: A simple question > > Dear all, > > I plan to write a simple remote connection script, and then "ls" the content > > of the current directory, input like > > telnet hostname > > username > >

RE: Shared memory

2001-07-10 Thread Rolf Banting
I'm an idiot. Although I am writing for example 10 1 1 3 3 277 1 1 3 3 277 1 1 3 3 277 ... etc into the memory segment as ints from my C-prog I was expecting perl's shmread to automagically convert this int data into a string. The answer is to use 'unpack' For instance : $num_recs = unpack "i"

Re: STDIN and STDOUT

2001-07-10 Thread Bob Mangold
> Are you sure it's STDERR? Some write directly to ther terminal > screen... > I checked through the module code and it definitely says 'print STDERR ...'. > What is this module? The module is 'bioperl' (used for genetic analysis). __ Do You Ya

Re: STDIN and STDOUT

2001-07-10 Thread Paul
--- Bob Mangold <[EMAIL PROTECTED]> wrote: > > Are you sure it's STDERR? Some write directly to ther terminal > > screen... > > I checked through the module code and it definitely says 'print > STDERR ...'. Well, unless they've done some shinanigans further up the code, that's pretty conclusive

Having a difficult time with uninitialized values...

2001-07-10 Thread Craig S Monroe
I wanted to start out by saying thanks to all who have helped me in the past... I am having difficulty with the uninitialized value errors... I tested the following on its own: #! d:\perl\bin -w ### # # Author: Craig Monroe

glob-copying vs. dup'ing

2001-07-10 Thread Paul
Okay, we recently had a discussion of open THIS, ">&THAT" and *THIS = *THAT Doesn anybody know the difference? Especially if you use STDERR and STDOUT instead of THIS and THAT? Just trying to understand the underlying behavior. = And on a seperate note, if Perl6 isn't going to u

(solution) Re: STDIN and STDOUT

2001-07-10 Thread Bob Mangold
As mentioned eariler... --- Craig Moynes/Markham/IBM <[EMAIL PROTECTED]> wrote: You mentioned in the earlier email that you were calling your perl script via 'exec' (as I remember). Could you not use something like exec(' myperl.pl 2>&1 ' ) ? ok, this works, but what the heck is it doing. i've

How to start with Perl :)

2001-07-10 Thread David van-der-Geer - Sun Holland - ENS_PSC - System Analyst
Hello, Here is a very stupid question. It is related to Perl so I hope I may ask. Whenever I try to action a perl-script out of an HTML submition I only get to see plain text. So Apache is not recognizing the .pl or .cgi extension. Can anyone tell me what I should put in the httpd.conf-file ?

Re: (solution) Re: STDIN and STDOUT

2001-07-10 Thread Paul
--- Bob Mangold <[EMAIL PROTECTED]> wrote: > As mentioned eariler... > > --- Craig Moynes/Markham/IBM <[EMAIL PROTECTED]> wrote: > You mentioned in the earlier email that you were calling your perl > script > via 'exec' (as I remember). > Could you not use something like > exec(' myperl.pl 2>&1

Re: (solution) Re: STDIN and STDOUT

2001-07-10 Thread Paul
--- Paul <[EMAIL PROTECTED]> wrote: > > --- Bob Mangold <[EMAIL PROTECTED]> wrote: > > As mentioned eariler... > > > > --- Craig Moynes/Markham/IBM <[EMAIL PROTECTED]> wrote: > > You mentioned in the earlier email that you were calling your perl > > script > > via 'exec' (as I remember). > > Co

Code review

2001-07-10 Thread Yacketta, Ronald
Folks, I would like to have some code I am currently working on reviewed by some of the more experienced Perl users on this list. If this is ok, please let me know and I will provide an URL to the script in an effort to keep list spam to a minimum Regards, Ron

passing arguments

2001-07-10 Thread P. Schaub
Hi List, I am calling a perl script within another perl script. What is the best way to pass arguments to the second one ? Is it possible to pass arrays and hashs (or at least refs) ? So far I am calling the second script like @result=`script2.pl $arg1 $arg2 $arg3` but I guess this is quite ugly.

Re: passing arguments

2001-07-10 Thread Chas Owens
On 10 Jul 2001 20:24:45 +0200, P. Schaub wrote: > Hi List, > > I am calling a perl script within another perl script. > What is the best way to pass arguments to the second one ? > Is it possible to pass arrays and hashs (or at least refs) ? > So far I am calling the second script like > @result=

Re: Code review

2001-07-10 Thread Casey West
On Tue, Jul 10, 2001 at 01:41:15PM -0400, Yacketta, Ronald wrote: : Folks, : : I would like to have some code I am currently working on reviewed by some of : the more experienced : Perl users on this list. If this is ok, please let me know and I will : provide an URL : to the script in an effort

Re: Directories

2001-07-10 Thread Michael Fowler
On Tue, Jul 10, 2001 at 09:02:21AM -0400, Craig Moynes/Markham/IBM wrote: > I am having some difficulty understanding your question. > If you just want to modify this script so that it does not die if the > directory contains files change the following: > > [snip] > >if ((-d $Name) and ($Name

Re: passing arguments

2001-07-10 Thread Paul
--- "P. Schaub" <[EMAIL PROTECTED]> wrote: > I am calling a perl script within another perl script. Have you looked into require() and do()? > What is the best way to pass arguments to the second one ? Depends on what you want, what it does, and how it's written. > Is it possible to pass arra

Re: Perl-case statement, and module syntax error

2001-07-10 Thread Michael Fowler
On Tue, Jul 10, 2001 at 09:43:26AM -0400, Sparkle Williams wrote: > I'm having two problems > 1) Is there an equivalent of the case function in Perl? perldoc -q switch, or http://www.perldoc.com/perl5.6/pod/perlfaq7.html#How%20do%20I%20create%20a%20switch%20or%20case%20statement%3f > $ftp = Ne

RE: Code review

2001-07-10 Thread Yacketta, Ronald
> Code review is fine by me, however, I think the reviewers should > probably send to you privatley. > > Casey West I will ensure that I note that on the page

Re: Perl-case statement, and module syntax error

2001-07-10 Thread Paul
--- Michael Fowler <[EMAIL PROTECTED]> wrote: > On Tue, Jul 10, 2001 at 09:43:26AM -0400, Sparkle Williams wrote: > > I'm having two problems > > 1) Is there an equivalent of the case function in Perl? > > perldoc -q switch, or Check out Damian Conway's Switch module. http://search.cpan.org/doc

Re: FW: Running out of memory

2001-07-10 Thread Michael Fowler
On Tue, Jul 10, 2001 at 07:18:22AM -0400, Blader Robert G DLVA wrote: > open ( FWLOG, "./logfile.010626"); > > while ( $LINE = ) { > > chomp ($LINE); > @fw_log = split (/;/, $LINE); > > } If this is the only code you're using that has the problem you describe, and you didn't

Re: Running out of memory

2001-07-10 Thread Michael Fowler
On Tue, Jul 10, 2001 at 01:35:05PM +0100, John Edwards wrote: > open ( FWLOG, "./logfile.010626"); > > while() { # Reads one line at a time into memory > ... > } > > @data = ; # Reads the whole file into memory > > You are replicating the second case, by reading the file a line at a time, > the

Re: glob-copying vs. dup'ing

2001-07-10 Thread Michael Fowler
On Tue, Jul 10, 2001 at 10:19:43AM -0700, Paul wrote: >open THIS, ">&THAT" This dups (see man 2 dup) fileno(THAT) and opens it with the filehandle THIS. The THIS and THAT filehandles now refer to the same file descriptor, and thus the same underlying file. >*THIS = *THAT This aliases

Re: (solution) Re: STDIN and STDOUT

2001-07-10 Thread Michael Fowler
On Tue, Jul 10, 2001 at 10:28:14AM -0700, Paul wrote: > > --- Paul <[EMAIL PROTECTED]> wrote: > > > > --- Bob Mangold <[EMAIL PROTECTED]> wrote: > > > exec(' myperl.pl 2>&1 ' ) ? > > > > > > ok, this works, but what the heck is it doing. i've never seen that > > > syntax. > > > > lol -- it's no

FW: FW: Running out of memory

2001-07-10 Thread Blader Robert G DLVA
Thanks to everyone that responded. Adding a "my" before the line that did the split and stored the result in an array - @fw_logs = split(/;/, $LINE); seemed to make all the difference. I'm not certain I understand why - if anyone can shed light on that I'd appreciate it. for that ma

RE: Code review

2001-07-10 Thread Blader Robert G DLVA
Just a suggestion - Would it be possible/practical to compile a summary of some of the suggestions that you receive? Rob Blader Information System Assurance Office, CD2S Naval Surface Warfare Center (540)653-7270 [EMAIL PROTECTED] > -Original Message- > From: Yacketta, Ronald [mailto

RE: Code review

2001-07-10 Thread Yacketta, Ronald
will do... > -Original Message- > From: Blader Robert G DLVA [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, July 10, 2001 15:23 > To: 'Yacketta, Ronald' > Cc: Beginners (E-mail) > Subject: RE: Code review > > > Just a suggestion - Would it be possible/practical to compile > a summary of >

Re: glob-copying vs. dup'ing

2001-07-10 Thread Paul
--- Michael Fowler <[EMAIL PROTECTED]> wrote: > On Tue, Jul 10, 2001 at 10:19:43AM -0700, Paul wrote: > >open THIS, ">&THAT" > > This dups (see man 2 dup) fileno(THAT) and opens it with the > filehandle THIS. The THIS and THAT filehandles now refer to the same > file descriptor, and thus th

Re: (solution) Re: STDIN and STDOUT

2001-07-10 Thread Paul
--- Michael Fowler <[EMAIL PROTECTED]> wrote: > On Tue, Jul 10, 2001 at 10:28:14AM -0700, Paul wrote: > > > > --- Paul <[EMAIL PROTECTED]> wrote: > > > > > > --- Bob Mangold <[EMAIL PROTECTED]> wrote: > > > > exec(' myperl.pl 2>&1 ' ) ? > > > > > > > > ok, this works, but what the heck is it do

Re: glob-copying vs. dup'ing

2001-07-10 Thread Michael Fowler
On Tue, Jul 10, 2001 at 12:32:16PM -0700, Paul wrote: > > --- Michael Fowler <[EMAIL PROTECTED]> wrote: > > On Tue, Jul 10, 2001 at 10:19:43AM -0700, Paul wrote: > > >open THIS, ">&THAT" > > > > This dups (see man 2 dup) fileno(THAT) and opens it with the > > filehandle THIS. The THIS and T

multiprocessors and perl

2001-07-10 Thread Bob Mangold
I'm about to upgrade to a dual processor sunblade 1000 at work (absolute overkill), but before doing so I'm trying to figure out what I'm going to have to do to exploit both processors. - Do I need to install perl with any special options? - Will I need to start writing my scripts differently to

creating new config file based on array

2001-07-10 Thread Messervy, Joe M
Hello, I have several files in a directory, and I need to create a config file for each one of them. I already have a standard config file, but it must be modified for each of the files in the directory (hope this makes sense). Here is what I have: #!/usr/bin/perl -w use File::Copy; opendir

Re: creating new config file based on array

2001-07-10 Thread Jeff 'japhy' Pinyan
On Jul 10, Messervy, Joe M said: >#!/usr/bin/perl -w > >use File::Copy; > >opendir MYDIR, "." or die "egad!: $!"; >@allfiles = grep !/^\.\.?$/, readdir MYDIR; >closedir MYDIR; > >foreach $allfiles (@allfiles) { >copy("config", "config.$allfiles"); >eval "s//mydirectorystucture/log//mydirectorystu

Re: "the right way"

2001-07-10 Thread Matija Papec
Jeff 'japhy' Pinyan <[EMAIL PROTECTED]> wrote: > # a flip-flop > $x = 1; > $x = !$x; # now $x is '' (which can be treated like 0) > $x = !$x; # now $x is 1 > > # another flip-flop > $x = 1; > $x = 1 - $x; # now $x is 0 > $x = 1 - $x; # now $x is 1 > >Those are the typical flip-flops I'

Re: "the right way"

2001-07-10 Thread Matija Papec
Paul <[EMAIL PROTECTED]> wrote: >When it matters is when the visual appearance of your script is notably >altered. Sometimes the postfix is neater -- personally, I don't like >opening and closing a block on the same line in an if, but that's just >me... and I *do* do it when I have a conditional e

Multi-Threading?!?

2001-07-10 Thread Michael Lambert
Hi all, I'm fairly new to this list, so I'm not sure if this is really the right place to ask a question of this nature, but I shall ask anyway in the hope that it is. I am trying to write a small script that will run a variable number of other scripts at the same time. I believe this will requ

Re: "the right way"

2001-07-10 Thread Michael Fowler
On Tue, Jul 10, 2001 at 11:01:51PM +0200, Matija Papec wrote: > Btw, when we talk about structures is there something like switch in perl > which could replace following code? > > $x==1 and $y = 1; > $x==2 and $y = 2; > $x==3 and $y = 3; You don't need switch to replace this code: $y = $x;

FTP perl script

2001-07-10 Thread Jean-Pascal Dezalay
I wrote a perl script to make a FTP connection to a remote machine like this # #!/usr/local/bin/perl open (FTP, " | ftp -v -n remote.comp.fr"); print FTP, "user username passwd\n"; print FTP, "bin\n"; print FTP, "prompt\n"; print FTP

Re: "the right way"

2001-07-10 Thread Peter Scott
At 11:01 PM 7/10/01 +0200, Matija Papec wrote: >Btw, when we talk about structures is there something like switch in perl >which could replace following code? > >$x==1 and $y = 1; >$x==2 and $y = 2; >$x==3 and $y = 3; There are at least 22 ways of doing it (according to a Tom Christiansen FMTYEW

Re: Multi-Threading?!?

2001-07-10 Thread Paul Johnson
On Tue, Jul 10, 2001 at 07:21:43PM +1000, Michael Lambert wrote: > Hi all, > > I'm fairly new to this list, so I'm not sure if this is really the right > place to ask a question of this nature, but I shall ask anyway in the hope > that it is. Seems fine to me. > I am trying to write a small scr

use of the word "cookie"

2001-07-10 Thread Grossner, Tim X. (AIT)
Is there some special function within perl that would dissallow the work "cookie" from being used? I am using a script written to connect to a group of Cisco routers and am not able to get perl to login using the "cookie" as the password. If I change the pass on the router to something else, say "

Re: Perl-case statement, and module syntax error

2001-07-10 Thread Chas Owens
Damian Conway has written a module that simulates a switch for Perl. http://search.cpan.org/doc/DCONWAY/Switch-2.03/Switch.pm";> SYNOPSIS use Switch; switch ($val) { case 1 { print "number 1" } case "a"{ print "string a" } case [1..10,42] { print "number

Re: FTP perl script

2001-07-10 Thread Peter Scott
At 06:14 PM 7/10/01 +0200, Jean-Pascal Dezalay wrote: >I wrote a perl script to make a FTP connection to a remote machine like this > ># >#!/usr/local/bin/perl >open (FTP, " | ftp -v -n remote.comp.fr"); >print FTP, "user username pas

A IPC::Shareable query

2001-07-10 Thread Vidyut Chavan
Hi All, I am using Perl and Perl/Tk to develop a small software installer. I will be starting one perl script from another. The calling program has the User interface with TK, and one of the widgets is a progressbar. This bar must get updated based on the value of a variable. Now, in the program

Re: "the right way"

2001-07-10 Thread Paul
--- Matija Papec <[EMAIL PROTECTED]> wrote: > Btw, when we talk about structures is there something like switch in > perl which could replace following code? > > $x==1 and $y = 1; > $x==2 and $y = 2; > $x==3 and $y = 3; I mentioned Damian Conway's Switch.pm earlier today: use Switch; my $x

Re: Multi-Threading?!?

2001-07-10 Thread Jos I. Boumans
Depending on what you need and what kind of scripts we're tlaking you might want to concider using POE, that's perls object environment.. it's not true multi-threading, but it's timeslicing (multi threading is still experimental and not too reliable i'm afraid - might change from 5.8 up wards). A

OT: Need Help with chmod and unix permissions

2001-07-10 Thread ehughes
Hello All, This is OFF-TOPIC! It has nothing to do with Perl, unless someone has a Perl solution that is. If you are not into Unix and sysadmin stuff, please delete this and go on. I need help in coming up with a chmod command that will end up like this: -r-sr-xr-t I need to set the sticky bit

Re: OT: Need Help with chmod and unix permissions - NEVER MIND!

2001-07-10 Thread ehughes
Sorry folks, I found the relevant section in my manual. I should have looked harder. Sorry to trouble you with an OT subject. Elton = NOVA 505 W. Olive Ave. Suite 550 Elton Hughes (I

Visualizing of data (Diagram)

2001-07-10 Thread matthschulz
Is there a modul out there which makes diagrams which can be actualized? I want to use it for displaying data from a multimeter and a AD-Modul. Thanks Matth

split log file

2001-07-10 Thread Katie Elliott
Hi, I am trying to split apart a log file. However, it doesn't seem to be working. Can anyone give me some help? I am still trying to figure out how split works. It seems to work up to the browser, but after that I seem to be having trouble. Thanks in advance, Katie --- ipaddr -

Re: Re-inventing wheels (WAS re: Required Fields Module)

2001-07-10 Thread Brett W. McCoy
> >CGI.pm isn't the only solution to creating dynamic web pages with Perl. > >Text::Template is another alternative, as are embedded Perl > >implementations like Apache::ASP, Mason, or even PerlScript (for IIS). > > None of which is crossplatform (Windows / Mac / Linux) > or installable by a user

Re: Re-inventing wheels (WAS re: Required Fields Module)

2001-07-10 Thread Morbus Iff
>> >CGI.pm isn't the only solution to creating dynamic web pages with Perl. >> >Text::Template is another alternative, as are embedded Perl >> >implementations like Apache::ASP, Mason, or even PerlScript (for IIS). >> >> None of which is crossplatform (Windows / Mac / Linux) >> or installable by a

Hi, what time() ^ $$ means?

2001-07-10 Thread Erik W
Hi gurus, I have a dumb question, when I read the book, I saw they generate and seed by using time() ^ $$ What ^ and $$ mean here? ^ bit xor? $$ logic and? Thanks in advance! __ Do You Yahoo!? Get personalized email addresses from Yahoo!

Re: Re-inventing wheels (WAS re: Required Fields Module)

2001-07-10 Thread Brett W. McCoy
On Tue, 10 Jul 2001, Morbus Iff wrote: > >Text::Template is installable as a regular module and is cross-platform. > > Hmm... My reasoning for saying it wasn't was because CPAN says it failed > the Win32 build. Have you used it before? Anything to say concerning memory > usage? It's small enough

  1   2   >