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
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
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
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
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
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
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
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
>-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
>
--- 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
> 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
>-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
> -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
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
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
Hi.
I am looking for a way to print just a certain in a browser. Is
this possible?
Kind Regards
Justin
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
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
> 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
Hi, I am fairly new to perl, and have a few questions about a small
program Im 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,
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
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
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
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
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
: 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(
--- 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
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
--- 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
--- 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
--- 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
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
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
>-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
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
--- 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
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
--- 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
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
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
... at http://archive.develooper.com/?M=D should now be updating
again. :-)
- ask
--
ask bjoern hansen, http://ask.netcetera.dk/ !try; do();
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
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
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
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
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
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
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
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
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
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
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
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
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:
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
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
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
>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
58 matches
Mail list logo