RE: Can you print directly to the default printer?

2001-05-14 Thread King, Jason
RICHARD A. NAKROSHIS (Contractor) writes .. >I hate to ask dumb questions, but how do you print directly to the >default Windows printer? I've tried using a batch file to call my >ActivePerl 5.6 perl script, writing my output to a file, and then >printing that file, but the perl script doesn't f

Help with cgi-script

2001-05-14 Thread n6tadam
Dear List, I am trying to write a cgi-script that adds a new user to my linux box via a web based form. The trouble is, is how do I pass variables to the program "passwd"?? This is so that when the password is sent via the form, it erncrypts the password, and adds the user??? Has anyone got any

Re: Help with cgi-script

2001-05-14 Thread Collin Rogowski
You cannot call passwd with the password as a parameter. (btw. this is a feature, not a bug :-) Look at the Expect Module (available on CPAN). It lets you automate interactive programs (like passwd). hope that helps, cr On Mon, 14 May 2001 09:10:54 +0100, n6tadam said: > Dear List, > > I am

Java

2001-05-14 Thread justin todd
Hi All I am trying to use flash on pages that include Perl scripting. I have had a look at the code and I am not sure whether it is Java or JavaScript. Here is a example. function MM_swapImage() { //v3.0 var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i

Re: Java

2001-05-14 Thread Brett W. McCoy
On Mon, 14 May 2001, justin todd wrote: > I am trying to use flash on pages that include Perl scripting. I have > had a look at the code and I am not sure whether it is Java or > JavaScript. > > Here is a example. > > function MM_swapImage() { //v3.0 > var i,j=0,x,a=MM_swapImage.arguments; docu

Re: automatic cgi scripts?

2001-05-14 Thread Paul Cotter
My reply is slightly different to the others. I am going to define a cgi script as one that you send to a browser. If not, it is just a perl script and cron is what you need. If however you need information on a browser to be update then you can specify refresh in thdocument you send to the bro

Re: Sorting a file

2001-05-14 Thread Jeff Pinyan
On May 14, Paul Cotter said: >next if /^#?$/; # skip empty lines and comment lines No. I had a bad regex weekend (as Paul could personally attest to). The author asked the same question. next if /^(#|$)/; will work, as well next if /^#/ or /^$/; I'm sorry about the mixup. I had origi

Re: CR LF with UNIX and Windows (DOSish?)

2001-05-14 Thread Paul Cotter
But if 'you' are using seek why have carriage returns anyway? It's not usually a good idea to have paper control embedded in fixed length records. If the problem is to print it then that can be done with a four line perl script, which is probably less lines than the modification to support multipl

RE: CR LF with UNIX and Windows (DOSish?)

2001-05-14 Thread Brett McCoy
>-Original Message- >From: Paul Cotter [mailto:[EMAIL PROTECTED]] >Sent: Monday, May 14, 2001 10:25 AM >To: Mike Lacey; [EMAIL PROTECTED] >Cc: [EMAIL PROTECTED] >Subject: Re: CR LF with UNIX and Windows (DOSish?) > > >But if 'you' are using seek why have carriage returns anyway? It's not >

Re: CR LF with UNIX and Windows (DOSish?)

2001-05-14 Thread Paul
--- David Falck <[EMAIL PROTECTED]> wrote: > Problem: > I have a fixed length customer record. When I create the record, I > add \n. But my testing tells me that when I read (seek) the record > below, I have to add 2 for Windows or 1 for UNIX. > > # Customer file data - > $cst_template = > "A9A

Perl, Nice, and CPU Usage

2001-05-14 Thread John Peterson
> Hi: > > I'm working on Sun Solaris and I've written a Perl program that uses DBI > to access two Informix databases to generate a report. There are > approximately 150,000 records it must proccess to generate the report. > Everything seems to work perfectly and the program runs for approximate

RE: Perl, Nice, and CPU Usage

2001-05-14 Thread Brett McCoy
>-Original Message- >From: John Peterson [mailto:[EMAIL PROTECTED]] >Sent: Monday, May 14, 2001 11:30 AM >To: '[EMAIL PROTECTED]' >Subject: Perl, Nice, and CPU Usage > > >> My question: Is this normal? If I use a Nice command in my >Perl program >> and set my priority at a higher number wi

RE: Perl, Nice, and CPU Usage

2001-05-14 Thread John Peterson
> -Original Message- > From: John Peterson > Sent: Monday, May 14, 2001 9:59 AM > To: '[EMAIL PROTECTED]' > Subject: RE: Perl, Nice, and CPU Usage > > Because this is on a test box there is nothing else running at the time. > The intention is to have it be user requested through

[Off Topic]Could someone help?

2001-05-14 Thread RDWest
hi yall, sorry to be off topic here, but flock is what has led me to linux. i've been experimenting with perl scripts on win32 os. and as yall know, win32 doesn't support file locking. i need some help with linux-mandrake 8.0 so i can get back to playing with perl. is anyone on the lis

RE: Perl, Nice, and CPU Usage

2001-05-14 Thread John Peterson
Thanks for your help! I'll do a lot of testing. > -Original Message- > From: Brett McCoy [SMTP:[EMAIL PROTECTED]] > Sent: Monday, May 14, 2001 10:13 AM > To: 'John Peterson' > Subject: RE: Perl, Nice, and CPU Usage > > >-Original Message- > >From: John Peterson [mailto:[EM

Printing

2001-05-14 Thread justin todd
Hi. I am looking for a way to print just a certain in a browser. Is this possible? Kind Regards Justin

RE: Perl, Nice, and CPU Usage

2001-05-14 Thread blowther
Perhaps the perl benchmarking would help out with this unit testing. perldoc Benchmark -Original Message- From: John Peterson [mailto:[EMAIL PROTECTED]] Sent: Monday, May 14, 2001 10:11 AM To: '[EMAIL PROTECTED]'; [EMAIL PROTECTED] Subject: RE: Perl, Nice, and CPU Usage Thanks for your

DBI and MS Access????

2001-05-14 Thread Mark Martin
Hi all, I'm looking for the quick and painless (idiots guide) instructions to connect to an MS Access database running on NT from a Digital UNIX machine. Need to knows: What DBD:: ?? needs installing How should the database handle look seeing as how there is no instance for an Access DB : $d

FW: Perl, Nice, and CPU Usage

2001-05-14 Thread John Peterson
> Yes, that's what I thought, that it would go ahead and use whatever it > needed to and that wasn't a bad thing. I'm just so new at this that I > wanted to make sure I was on the right track. But I'm fine with it using > 100% of CPU. I just wasn't sure if that was a bad thing. > > I actually jus

Array Size Question(s)

2001-05-14 Thread Bryce Tate
Hi, I am fairly new to perl, and have a few questions about a small program I’m writing. This program is reading from a text file that is delimited by colons. Eg... Field One:Field Two:Field Three:Field Four I know the first couple of fields are specific and will always be there, but after that,

Reverse engineering html->cgi

2001-05-14 Thread Paul Cotter
Does a package exist that will read an HTML document and generate an Apache::CGI or Apache::Registry cgi script? Even better if it accepts an <--PerlinHtml> comment tag. Regards - Paul Cotter

Re: Array Size Question(s)

2001-05-14 Thread Paul Cotter
while($ansNum < $numOfAns) where $ansNum starts at zero and is incremented until it is at $numOfAns(from the split line above, it's value should represent the number of elements in @A). This all works, but I would like to improve it and make it so that the user making the text file doesn't have t

Re: Array Size Question(s)

2001-05-14 Thread Collin Rogowski
First part: You get the size of an array by using it in a scalar context. Sounds complicated? Scalar context means that the left side of an assignment is a scalar. So you just write: $size = @a; and you get the size of the array @a. Another method would be to get the index of the last element a

RE: Array Size Question(s)

2001-05-14 Thread Peter Cornelius
A cool control structure in perl is the for or foreac loop. With it you don't need to know the size of the array you can just for my $thing (@A) { #do stuff with $thing } If you're familiar with shell syntax this is kinda like the 'for i in list' construct. Books - You might check

Re: Breaking up a file.

2001-05-14 Thread Atul_Khot
my @sections = split /\n(?=[a-z])/i, $dat; I have a doubt here. perldoc -f split says, -- If the PATTERN contains parentheses, additional array elements are created from each matching substring in the delimiter. split(/([,-])/, "1-10,2

Re: Breaking up a file.

2001-05-14 Thread Timothy Kimball
: my @sections = split /\n(?=[a-z])/i, $dat; : I have a doubt here. perldoc -f split says, : -- : If the PATTERN contains parentheses, additional array : elements are created from each matching substring in the : delimiter. : : split(

Re: Printing

2001-05-14 Thread Paul
--- justin todd <[EMAIL PROTECTED]> wrote: > I am looking for a way to print just a certain in a browser. > Is this possible? Seems likely, but I think we'll need a little more info. =o) __ Do You Yahoo!? Yahoo! Auctions - buy the things you want

Perl Beginner

2001-05-14 Thread Edson Manners
I am having trouble finding a list of formatting characters that deal with the backslash and forward slash characters in Perl. For example... What does if ($line =~ /^$i\./) mean I understand everything except the characters ^$i\./ What is the significance of these characters? I would be muc

Re: Array Size Question(s)

2001-05-14 Thread Paul
--- Collin Rogowski <[EMAIL PROTECTED]> wrote: > You get the size of an array by using it in a scalar context. > $size = @a; This is entirely correct. But for those of you who prefer a more explicit syntax, you can put any expression into scalar context with the "scalar" keyword. For my own tast

RE: Array Size Question(s)

2001-05-14 Thread Paul
--- Peter Cornelius <[EMAIL PROTECTED]> wrote: > A cool control structure in perl is the for or foreac loop. With it > you don't need to know the size of the array you can just >for my $thing (@A) { > #do stuff with $thing >} This is very efficient; just keep in mind that $thing i

Re: Perl Beginner

2001-05-14 Thread Paul
--- Edson Manners <[EMAIL PROTECTED]> wrote: > I am having trouble finding a list of formatting characters that deal > with the backslash and forward slash characters in Perl. > For example... What does >if ($line =~ /^$i\./) > mean I understand everything except the characters ^$i\./ > W

flock

2001-05-14 Thread Brian Shoemaker
Starting very soon, we'll be changing from Linux to NT. Currently, at the beginning of programs I use the following use Fcntl qw(:flock); then later in the scripts I use flock(FILE, LOCK_EX); The Perl 5 book I have says flock function doesn't work in Windows systems. I don't want to create a lo

RE: flock

2001-05-14 Thread John Peterson
I'm just reading in the Perl DBI book about flock. It says it works in Windows NT/2000, just not on Windows 95/98. That's just what I read, haven't tested it. > -Original Message- > From: Brian Shoemaker [SMTP:[EMAIL PROTECTED]] > Sent: Monday, May 14, 2001 2:55 PM > To: [EMAIL PROTECTE

RE: flock

2001-05-14 Thread Brett McCoy
>-Original Message- >From: Brian Shoemaker [mailto:[EMAIL PROTECTED]] >Sent: Monday, May 14, 2001 4:55 PM >To: [EMAIL PROTECTED] >Subject: flock > > >Starting very soon, we'll be changing from Linux to NT. I am so sorry for you. :-) >Currently, at the beginning of programs I use the foll

How to read backwards in a file.

2001-05-14 Thread Gary Luther
I am learning Perl and loving it. Perl is cool...not as cool as APL but nonetheless cool. Here is my question. I have to read into a file for a particular string in a record. The "strings" occur in different records. I then call a subroutine and within the subroutine need to be able to r

Re: How to read backwards in a file.

2001-05-14 Thread Paul
--- Gary Luther <[EMAIL PROTECTED]> wrote: > I guess what I am asking is how in the Perl do you set the read > pointer?? Observe perldoc perlfunc. More specifically: perldoc -f tell perldoc -f seek Just store the address of the pointer after you hit a "node", then go back to the previous

Re: flock

2001-05-14 Thread Jeff Pinyan
On May 14, Brian Shoemaker said: >The Perl 5 book I have says flock function doesn't work in Windows systems. > >I don't want to create a lock file each time someone accesses a file and >then have to delete that lock. A rather clever way to emulate locking is to use mkdir() and rmdir(). Althoug

CR LF with UNIX and Windows (DOSish?)

2001-05-14 Thread chris brown
--- David Falck <[EMAIL PROTECTED]> wrote: >--snip-- I am pretty new at Perl so don't know the syntax to do this, but could you sidestep the issue and count the number of bytes in \n, then subtract as appropriate? Chris __ Do You Yahoo!? Yahoo! Au

Re: flock

2001-05-14 Thread Peter Scott
At 06:01 PM 5/14/01 -0400, Jeff Pinyan wrote: >On May 14, Brian Shoemaker said: > > >The Perl 5 book I have says flock function doesn't work in Windows systems. > > > >I don't want to create a lock file each time someone accesses a file and > >then have to delete that lock. > >A rather clever way

Re: flock

2001-05-14 Thread Jeff Pinyan
On May 14, Peter Scott said: >Ooh, that is clever. Has it been encapsulated in a CPAN module? No. It can break on NFS. >> 1 until mkdir "$_[0].lck", 0777; > >Perhaps sleep 1 until mkdir would be a little less stressful on the average >system :-) Feh. ;) -- Jeff "japhy" Pinyan [EM

the list archives ...

2001-05-14 Thread Ask Bjoern Hansen
... at http://archive.develooper.com/?M=D should now be updating again. :-) - ask -- ask bjoern hansen, http://ask.netcetera.dk/ !try; do();

DBI connecting to Informix DB

2001-05-14 Thread John Peterson
I've got a Perl script using DBI to connect to an Informix database on another server. These servers are identical as far as where Informix is, etc. My script works fine when I run it locally, but when I try to connect remotely I get the following error. DBI->connect failed: SQL: -2: Server

RE: CR LF with UNIX and Windows (DOSish?)

2001-05-14 Thread David Falck
Chris, I tested something similar to your suggestion. I created the customer record on my laptop's Windows98 OS, and also on my web site's UNIX OS. Then I read one record and without chomp-ing (removing the input record separator), got the length for the record. On both operating systems, the len

negative matching?

2001-05-14 Thread Noah Sussman
I am trying to write a simple script to insert ALT attributes into IMG tags that don't have them, leaving other IMG tags untouched. The problem is that I can't figure out how to tell Perl to search for strings beginning with "" AND not containing "ALT=" (and it has to do this over multiple lines

RE: negative matching?

2001-05-14 Thread Peter Cornelius
This seems to work for me as log as I leave out the 'undef $/;' Why do you want to slurp everything into $_ at once? -Original Message- From: Noah Sussman [mailto:[EMAIL PROTECTED]] Sent: Monday, May 14, 2001 4:29 PM To: [EMAIL PROTECTED] Subject: negative matching? I am trying to writ

RE: CR LF with UNIX and Windows (DOSish?)

2001-05-14 Thread King, Jason
David Falck writes .. >I tested something similar to your suggestion. I created the customer >record on my laptop's Windows98 OS, and also on my web site's UNIX OS. >Then I read one record and without chomp-ing (removing the input record >separator), got the length for the record. On both operati

RE: DBI and MS Access????

2001-05-14 Thread King, Jason
Mark Martin writes .. >I'm looking for the quick and painless (idiots guide) instructions to >connect to an MS Access database running on NT from a Digital >UNIX machine. > >Need to knows: > >What DBD:: ?? needs installing > >How should the database handle look seeing as how there is no >inst

RE: flock

2001-05-14 Thread King, Jason
Jeff Pinyan writes .. >On May 14, Brian Shoemaker said: > >>The Perl 5 book I have says flock function doesn't work in >Windows systems. >> >>I don't want to create a lock file each time someone accesses >a file and >>then have to delete that lock. > >A rather clever way to emulate locking is

RE: flock

2001-05-14 Thread King, Jason
Brian Shoemaker writes .. >Starting very soon, we'll be changing from Linux to NT. > >Currently, at the beginning of programs I use the following >use Fcntl qw(:flock); >then later in the scripts I use >flock(FILE, LOCK_EX); > >The Perl 5 book I have says flock function doesn't work in >Windows

Beginners Database Question

2001-05-14 Thread Eric B. Leslie
Hello, I'm experimenting with putting a db backend on everything. What I've learned I am able to make a perl script that can access it and manipulate data for it but there's one key item I'm stumped on. What I'm trying to do is have the main content of the website be pulled off my datab

RE: flock

2001-05-14 Thread Jeff Pinyan
On May 15, King, Jason said: >>A rather clever way to emulate locking is to use mkdir() and rmdir(). >> >>Although it requires you to create a lock file, it's atomic and safe. > >are you sure ? .. just because it constitutes one Perl statement doesn't >mean that it's atomic .. I suspect mkdir has

Re: negative matching?

2001-05-14 Thread Jeff Pinyan
On May 14, Noah Sussman said: >I am trying to write a simple script to insert ALT attributes into IMG tags >that don't have them, leaving other IMG tags untouched. > >The problem is that I can't figure out how to tell Perl to search for >strings beginning with "" AND not containing "ALT=" >(and i

Re: Beginners Database Question

2001-05-14 Thread Me
Take a look at http://www.masonhq.com/. > Hello, >I'm experimenting with putting a db backend on everything. What I've > learned I am able to make a perl script that can access it and > manipulate data for it but there's one key item I'm stumped on. What > I'm trying to do is have the mai

RE: Can you print directly to the default printer?

2001-05-14 Thread Amarnath Honnavalli Anantharamaiah
It is quite interesting. I am curious to know how do you print to a network printer ? Please excuse me if I am asking a dumb question. Amar -Original Message- From: King, Jason [mailto:[EMAIL PROTECTED]] Sent: Monday, May 14, 2001 8:32 AM To: [EMAIL PROTECTED] Subject:RE:

RE: flock

2001-05-14 Thread King, Jason
Jeff .. you wrote .. >On May 15, King, Jason said: > >>>A rather clever way to emulate locking is to use mkdir() and rmdir(). >>> >>>Although it requires you to create a lock file, it's atomic and safe. >> >>are you sure ? .. just because it constitutes one Perl >statement doesn't >>mean that i

RE: Can you print directly to the default printer?

2001-05-14 Thread King, Jason
Amarnath Honnavalli Anantharamaiah writes .. >It is quite interesting. I am curious to know how do you print to a >network printer ? Please excuse me if I am asking a dumb question. never had to .. if I had to I'd probably want to format the printed output a little better than ASCII can do .. s

Re: Beginners Database Question

2001-05-14 Thread Peter Scott
At 07:01 PM 5/14/01 -0700, Eric B. Leslie wrote: > I'm experimenting with putting a db backend on everything. What I've > learned I am able to make a perl script that can access it and manipulate > data for it but there's one key item I'm stumped on. What I'm trying to > do is have the main

RE: DBI and MS Access????

2001-05-14 Thread Peter Scott
>Mark Martin writes .. > > >I'm looking for the quick and painless (idiots guide) instructions to > >connect to an MS Access database running on NT from a Digital > >UNIX machine. > > > >Need to knows: > > > >What DBD:: ?? needs installing > > > >How should the database handle look seeing as how