witing to %ENV permanently

2001-11-19 Thread maarten hilgenga

Hi all,

When I try to change the value of the environmental variable DNM on a linux 
machine, DNM only changes when the script is running. Can anyone tell me how 
to change its value permanently?

Thanx

Maarten Hilgenga
 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: witing to %ENV permanently

2001-11-19 Thread nafiseh saberi

hi.
what is your purpose about DNM ??
___

 Nafiseh Saberi  .Iran.

- Original Message -
From: "maarten hilgenga" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, November 19, 2001 12:10 PM
Subject: witing to %ENV permanently


> Hi all,
>
> When I try to change the value of the environmental variable DNM on a
linux
> machine, DNM only changes when the script is running. Can anyone tell me
how
> to change its value permanently?
>
> Thanx
>
> Maarten Hilgenga
>
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: witing to %ENV permanently

2001-11-19 Thread maarten hilgenga


 hi,

 someone here works with Tecplot macros and needed something to return line
 x of a file. So I made a script that accepts x and prints the line on
 . Problem is that with these Tecplot macros we can run the script,
 but we can't get the return value of the script. We found a way to read
 environmental variables, so we thought let perl write to %ENV and read this
 ENV value afterwards with Tecplot. Oh, yeah DNM is just a variable we
 created to not interfere with the normal ENV.

 On Monday 19 November 2001 09:48, you wrote:
 > *This message was transferred with a trial version of CommuniGate(tm)
 > Pro* hi.
 > what is your purpose about DNM ??
 > ___
 >
 >  Nafiseh Saberi  .Iran.
 > 
 > - Original Message -
 > From: "maarten hilgenga" <[EMAIL PROTECTED]>
 > To: <[EMAIL PROTECTED]>
 > Sent: Monday, November 19, 2001 12:10 PM
 > Subject: witing to %ENV permanently
 >
 > > Hi all,
 > >
 > > When I try to change the value of the environmental variable DNM on a
 >
 > linux
 >
 > > machine, DNM only changes when the script is running. Can anyone tell
 > > me
 >
 > how
 >
 > > to change its value permanently?
 > >
 > > Thanx
 > >
 > > Maarten Hilgenga
 > >
 > >
 > >
 > > --
 > > To unsubscribe, e-mail: [EMAIL PROTECTED]
 > > For additional commands, e-mail: [EMAIL PROTECTED]
-- 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: pattern matching

2001-11-19 Thread David K. Wall

[EMAIL PROTECTED] (Andrea Holstein) wrote:

> Prasanthi Tenneti wrote: 
>> 
>> Iam a beginner in perl.I have one question, Iam trying to write one
>> prog,in which i have to search for one word in a file, If I found that
>> word,print next 4 lines. PLs help me,how to write code. 
> 
> open FILE, " while () {
>  print(,,,), last if /your_word/;
> }
> close FILE;

Did you test that?  

print ;

will print the rest of the file.

print() expects a list.  <> in list context returns rest of whatever file 
it's reading, one line per list element. 

The same question -- with a trivial difference -- was asked a few days 
ago.

use strict;
use warnings;
open FILE, ") {
next unless /your_word/;
$_ = , print for 1..4;
last;
}
close FILE, ") {
next unless /your_word/;
for (1..4) {
$_ = ;
print;
}
last;
}

-- 
David Wall - [EMAIL PROTECTED]
"When the end of the world comes, I want to be in Cincinnati. Everything
happens ten years later there." -- Mark Twain

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Win 98 SE; Apache; Perl; MySQL

2001-11-19 Thread Rob Benjamin

I'm trying to set up my Win98 SE system with Apache & Perl (already loaded)
and later MySQL to run as development/test before uploading to my ISP.

Is there a quick checklist to use to get Perl scripts to run under Apache
this way?

Bob Benjamin
[EMAIL PROTECTED]
So. Pasadena, CA



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: problem in the #/usr/local/bin line

2001-11-19 Thread N_Dinesh



Hi,

 Check MS documentation, on how to configure ".pl" cgi scripts in PWS. That
is all you require to do,
if you want to run perl cgi scripts. You dont require to mention #!/usr/bin/perl
line in perl cgi scripts in windows,



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: witing to %ENV permanently

2001-11-19 Thread Crowder, Rod

The environment var you set is only available to the perl program and any
child processes it produces. 
Try calling the Tecplot macros from within your perl program using system()
or the backtick method. 

HTH

Rod C

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Access the same hash in the parent and child process

2001-11-19 Thread Jenda Krynicky

From:   Garry Williams <[EMAIL PROTECTED]>
> On Sat, Nov 10, 2001 at 03:58:04PM -0800, Marcia Magna wrote:
> 
> > I have a program that needs to fork. The child process creates
> > values in a hash that must be seen by the parent process.
> > 
> > Is there anyway to do that ?
> 
> Short answer: No.  
> 
> When a process fork()s, a new process is created.  

Depends. On windows you only get a new thread, not a new 
process. And only if you exec() later a new process is created. 
This should not make much difference usualy ... except that 
currently not everything is thread safe so if you don't exec() and 
continue running the same code in both threads your script can 
crash. Plus you have to be carefull with some modules that keep 
some data outside the Perl space, since that data is NOT copied 
when you fork and may get deleted when one of the thread finishes.

> That means there is
> now a *copy* of all of the memory in the original process now in the
> new process.  So all Perl variables are *copied* to the new process.
> Since the new process is using a copy, no changes in the child process
> can be "seen" by the parent.  

Same in the thread "emulation" of fork(). Except if you use 
Thread::Shared. Not sure though what data types are supported at 
the moment, plus you'd have to install bleadperl (the development 
version of Perl)

> Long answer: 
> 
> Take a look at the perlipc manual page for various ways for processes
> to communicate with each other (including shared memory on *some*
> systems).  It's likely that there is another way to partition or
> factor your problem that does not involve complex inter-process
> communication.  

Yes, there are modules on CPAN that implement hashes shared 
between processes (so they might work with multiple threads as 
well. I did not try.)

Jenda

=== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==
There is a reason for living. There must be. I've seen it somewhere.
It's just that in the mess on my table ... and in my brain.
I can't find it.
--- me

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




File::Find

2001-11-19 Thread Jean-Paul Miéville

I don't understand the difference between these two functions: find and 
finddepth in module File::Find. I don't understand the explanation in 
perldoc. My experience shows that finddepth is about 50% faster than find. 
Why ? 

Thanks in advance, 

Jean-Paul 





___
http://inbox.excite.com



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




include a file

2001-11-19 Thread stefan r. ernst

hey there,

sorry for this question, but i'm not a perl programmer. =\

is there any similar function to php's "include()"?

i want to include an html file into the output the user will get when
opening the .pl

thanks in advance,

stefan.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Help with global match and replace

2001-11-19 Thread FLAHERTY, JIM-CONT

My script dumps file name into a mysql DB on redhat 7.1 linux . The problem
I have is sometime windows files has  a single quote  ( ' )  in the name. I
want to replace it with a space . I not strong on pattern matching in perl
yet


$thestring = "this isn't a good file name";



Help ,

thanks in advance 
Jim F 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Help with global match and replace

2001-11-19 Thread Martin Pfeffer

$thestring =~ s/'/ /g;
martin

FLAHERTY, JIM-CONT wrote:

> My script dumps file name into a mysql DB on redhat 7.1 linux . The problem
> I have is sometime windows files has  a single quote  ( ' )  in the name. I
> want to replace it with a space . I not strong on pattern matching in perl
> yet
> 
> 
> $thestring = "this isn't a good file name";
> 
> 
> 
> Help ,
> 
> thanks in advance 
> Jim F 
> 
> 



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: witing to %ENV permanently

2001-11-19 Thread Jonathan E. Paton

Hi,

Setting the enviroment variable is dependant on the shell
in use (sh/ksh/bash/csh etc).  I would hack it like (not
truely knowing sh syntax):

#!/bin/sh
set DVM = `./extract_line $1`

This is a simple wrapper, and may/may not work depending on
how lucky you are... I've definately not tested it... maybe
this is just random noise that looks like a solution...

Jonathan Paton



__
Do You Yahoo!?
Everything you'll ever need on one web page from News and Sport to Email and Music 
Charts
http://uk.my.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




sysread with binary data

2001-11-19 Thread Jason Ostrom

This should be a really simple problem that I am trying to tackle, but
I can't get around it right now.

I need help being able to read binary data from a network socket, like a byte
at a time.  Do you know how to do this?

I want to read the byte with sysread, and then copy it into an data
structure, such as an array, that can be printed to the screen or
inserted into a database.  I think sysread() is the way I need to go.

Any help greatly appreciated.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: stupid question

2001-11-19 Thread Bob Showalter

> -Original Message-
> From: Chris and Madonna Stalnaker [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, November 17, 2001 1:55 AM
> To: [EMAIL PROTECTED]
> Subject: stupid question
> 
> 
> I have to start somewhere,
> 
> This works:
> 
>   print "Enter your name: ";
>   $text = ;
>   print "\nHello $text\n";
>   print "Please enter your password: ";
>   $password = ;
> 
>   if ($password == 21)
>   {
>   print"Correct\n";
>   } 
>   else 
>   {
>   print "wrong\n";
>   }
> 
> This doesn't:
> 
>   print "Enter your name: ";
>   $text = ;
>   print "\nHello $text\n";
>   print "Please enter your password: ";
>   $password eq ;
> 
>   if ($password eq qwert)
>   {
>   print"Correct\n";
>   } 
>   else 
>   {
>   print "wrong\n";
>   }
> 
> Why?
> 
> if anyone replies Thank you, (flames expected!!)

You've gotten some pointers, but can I add my $0.02 for future reference
and for the benefit of other posters?

1. Please avoid the phrase "Doesn't work". Your script is syntactically
legal and runs without producing any error messages, so I we could claim
that it does indeed "work".

Instead *define* what "doesn't work" means. The best way, IMO, is to 
specify A) what the expected behavior is, and B) what the observed behavior 
is. So in this case you might say:

   "I expect to enter a user name and password, and then have the
   program print 'Correct' if I enter enter the password qwert.
   The program does prompt for user name and password, but always
   prints 'wrong', even if I enter the correct password, qwert.

2. Put the following lines at the top of *every* script unless you 
absolutely know what you're doing and have good reason to do otherwise:

   #!/usr/bin/perl -w
   use strict;

Doing so in this case would have highlighted the very things that make
your script "not work".

3. If you get warning messages that you don't understand, run your 
script like this:

   perl -Mdiagnostics myscript.pl

This will give you expanded descriptions to go along with warnings.

Good luck!

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: witing to %ENV permanently

2001-11-19 Thread Bob Showalter

Environments belong to *processes*, and each process has a separate set
of environent variables.

A change to %ENV changes the environment for that process. A copy of that
(changed) environment is inherited by any child processes created after
that point, but a process *cannot* directly modify the environment of its 
parent (or any other non-child process).

Since processes are transient, there is technically no such thing as 
"change it permanently". The best you can do is use a shell or other
initialization file (e.g. .bashrc) to provide a "permanent" initial value.

> -Original Message-
> From: maarten hilgenga [mailto:[EMAIL PROTECTED]]
> Sent: Monday, November 19, 2001 3:41 AM
> To: [EMAIL PROTECTED]
> Subject: witing to %ENV permanently
> 
> 
> Hi all,
> 
> When I try to change the value of the environmental variable 
> DNM on a linux 
> machine, DNM only changes when the script is running. Can 
> anyone tell me how 
> to change its value permanently?
> 
> Thanx
> 
> Maarten Hilgenga
>  
> 
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




[OT] Who's online, which is the best method?

2001-11-19 Thread Etienne Marcotte

What is the best method for a Who's online type of thing?

Users can either log in or be automatically logged in with a cookie on
the site.

How can I "see" when the user is "there" or "gone"

Am I better of reading a text file or a database table?
With a cron to update every x minutes the number/handles of the users?

I am really confused on how to do this..

Etienne

-- 
Etienne Marcotte
Specifications Management - Quality Control
Imperial Tobacco Ltd. - Montreal (Qc) Canada
514.932.6161 x.4001

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Help with global match and replace

2001-11-19 Thread David Wall


[Fixed Jeopardy quoting]

[EMAIL PROTECTED] (Martin Pfeffer) wrote on 19 Nov 2001:
> FLAHERTY, JIM-CONT wrote:
> 
>> My script dumps file name into a mysql DB on redhat 7.1 linux . The
>> problem I have is sometime windows files has  a single quote  ( ' ) 
>> in the name. I want to replace it with a space . I not strong on
>> pattern matching in perl yet 
>> 
>> 
>> $thestring = "this isn't a good file name";
>
> $thestring =~ s/'/ /g;

If you're simply replacing one set of characters with another, the 
preferred function (actually an operator) is tr///

$thestring =~ tr/'/ /;

If tr/// is a shovel, then s/// is a bulldozer.  

-- 
David Wall
[EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: include a file

2001-11-19 Thread Daniel Gardner

sre> sorry for this question, but i'm not a perl programmer. =\

sre> is there any similar function to php's "include()"?

sre> i want to include an html file into the output the user will get when
sre> opening the .pl


you could use a function something like:

sub echo_file {
  my ($filename) = @_;

  open my $fh, $filename;
  if (!$fh) {
print "Could not include $filename: $!";
return;
  }

  # slurp the whole file - don't try this with huge
  # files
  local $/ = undef;
  print <$fh>;
}


this doesn't work like the php include because it won't evaluate any
code that's in the other file, but if all you want to do is cat a file
containing html then this should be okay for you.


-- 
Best regards,
 Daniel


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: [OT] Who's online, which is the best method?

2001-11-19 Thread Daniel Gardner

EM> What is the best method for a Who's online type of thing?

EM> Users can either log in or be automatically logged in with a cookie on
EM> the site.

EM> How can I "see" when the user is "there" or "gone"

EM> Am I better of reading a text file or a database table?
EM> With a cron to update every x minutes the number/handles of the users?

the way i'd probably do it would be to update a database table every
time a user logged in. the table could have (username, last_access)

there is no real way with HTTP to see id a user is "there" or "gone",
the only way you can tell is if a user has not accessed any pages for
x minutes... say if they haven't accessed for 10 minutes they are
"gone".

so, on all of your pages have a function to update the "last access"
table, and when you want to see who is "there", do a select from the
table where last_access > 10 minutes ago

if you have only a few users then this will be okay, but if you have
lots of users then a cron job to delete records where the user
hasn't accessed for more than 10 minutes running once a day or
something would be good.

hope that gives you some idea of a way to start...


-- 
Best regards,
 Daniel


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: [OT] Who's online, which is the best method?

2001-11-19 Thread Etienne Marcotte

Thanks a lot, this is a pretty good way,

My site gets about 800-1000 unique users a day, but those unique users
are almost always the same coming back the next day. So maybe a cron job
once per week would be fine, well I'll monitor and reduce time if the
select becomes long.

Thanks again

Etienne

Daniel Gardner wrote:
> 
> EM> What is the best method for a Who's online type of thing?
> 
> EM> Users can either log in or be automatically logged in with a cookie on
> EM> the site.
> 
> EM> How can I "see" when the user is "there" or "gone"
> 
> EM> Am I better of reading a text file or a database table?
> EM> With a cron to update every x minutes the number/handles of the users?
> 
> the way i'd probably do it would be to update a database table every
> time a user logged in. the table could have (username, last_access)
> 
> there is no real way with HTTP to see id a user is "there" or "gone",
> the only way you can tell is if a user has not accessed any pages for
> x minutes... say if they haven't accessed for 10 minutes they are
> "gone".
> 
> so, on all of your pages have a function to update the "last access"
> table, and when you want to see who is "there", do a select from the
> table where last_access > 10 minutes ago
> 
> if you have only a few users then this will be okay, but if you have
> lots of users then a cron job to delete records where the user
> hasn't accessed for more than 10 minutes running once a day or
> something would be good.
> 
> hope that gives you some idea of a way to start...
> 
> --
> Best regards,
>  Daniel

-- 
Etienne Marcotte
Specifications Management - Quality Control
Imperial Tobacco Ltd. - Montreal (Qc) Canada
514.932.6161 x.4001

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Use of packages

2001-11-19 Thread Bruce Ferrell

I came up with this question while I was reading Paul Dubois book MySQL
and PERL for the Web.  I'm not sure I'm clear on a concept, so I'm
posting it here in pseudo perl hope of getting some clarity.

A package (module?) is created thusly:

#begin perl package
package packagename;

sub sub1 {
  perl code here
}

sub sub2 {
   more perl code
}
1; #return true
#end package

Now, I'm presenting two examples of how to use the package I just made
in an actual perl script.  The first I know to be correct, the second is
the one I'm unclear on:

#begin example 1
use packagename;

packagename::sub1();
packagename::sub2();
#end example 1

#begin example 2
use packagename();
sub1();
sub2();
#end example 2

No can someone explain to me what, if anything is incorrect about the
second example?  What I'm looking for is how sub-routines are used from
a used module without the module name prefix.

Thanks in advance,

Bruce

One day at a time... One second if that's what it takes

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Use of packages

2001-11-19 Thread Daniel Gardner

Monday, November 19, 2001, 4:41:21 PM, Bruce Ferrell wrote:

BF> #begin example 2
BF> use packagename();
BF> sub1();
BF> sub2();
BF> #end example 2

BF> No can someone explain to me what, if anything is incorrect about the
BF> second example?  What I'm looking for is how sub-routines are used from
BF> a used module without the module name prefix.

you want to look at the Exporter module. there's full details here [1],
but what it basically comes down to is:

  package packagename;
  require Exporter;
  @ISA = qw(Exporter);

  @EXPORT_OK = qw(sub1 sub2);

  sub sub1 {
 perl code here
  }

  sub sub2 {
 perl code here
  }

  1;
  
and then in your script:

  use packagename qw(sub1 sub2);

  sub1();
  sub2();


[1] http://www.perldoc.com/perl5.6.1/lib/Exporter.html

-- 
Best regards,
 Daniel


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: Use of packages

2001-11-19 Thread Bob Showalter

> -Original Message-
> From: Bruce Ferrell [mailto:[EMAIL PROTECTED]]
> Sent: Monday, November 19, 2001 11:41 AM
> To: [EMAIL PROTECTED]
> Subject: Use of packages 
> 
> 
> I came up with this question while I was reading Paul Dubois 
> book MySQL
> and PERL for the Web.  I'm not sure I'm clear on a concept, so I'm
> posting it here in pseudo perl hope of getting some clarity.
> 
> A package (module?) is created thusly:
> 
> #begin perl package
> package packagename;
> 
> sub sub1 {
>   perl code here
> }
> 
> sub sub2 {
>more perl code
> }
> 1; #return true
> #end package
> 
> Now, I'm presenting two examples of how to use the package I just made
> in an actual perl script.  The first I know to be correct, 
> the second is
> the one I'm unclear on:
> 
> #begin example 1
> use packagename;
> 
> packagename::sub1();
> packagename::sub2();
> #end example 1
> 
> #begin example 2
> use packagename();
> sub1();
> sub2();
> #end example 2
> 
> No can someone explain to me what, if anything is incorrect about the
> second example?  What I'm looking for is how sub-routines are 
> used from
> a used module without the module name prefix.

The latter requires using the "Exporter" feature whereby a package can
place aliases to its functions, variables, etc. in the calling package's
namespace. To enable this, you need the following:

In the module, include the following:

   require Exporter;
   our @ISA = qw(Exporter);
   our @EXPORT = qw(sub1 sub2);

In the main program, do:

   use packagename; # note no parens

The "use" statement will call packagename's import() method, which it
inherits from Exporter. This by default will create an alias in the calling
package for each symbol in @EXPORT().

Supplying parens on the use:

   use packagename ();

Will override this behavior and suppress the importing of symbols from
@EXPORT.

Note that using @EXPORT is somewhat frowned upon, since it causes packages
to "pollute" the namespace of the calling package. The more "polite" form
is to use @EXPORT_OK, which only imports symbols if they are explicitly
named in the use statement.

So you could say in the module:

   our @EXPORT = qw();  # export nothing by default
   our @EXPORT_OK = qw(sub1 sub2);  # but allow these to be exported

Then in the main program:

   use packagename qw(sub1 sub2);

See:

perldoc perlmod
perldoc Exporter
perldoc -f use



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




-onChange

2001-11-19 Thread Jerry Preston

Hi!

Trying to learn how to "-onChange", where can I find some good doc and
examples?

Thanks,

Jerry




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




sysread with binary data

2001-11-19 Thread Jason Ostrom

This should be a really simple problem that I am trying to tackle, but
I can't get around it right now.

I need help being able to read binary data from a network socket, like a byte
at a time.  Do you know how to do this?

I want to read the byte with sysread, and then copy it a byte at a
time into a datastructure, such as an array, that can be printed to the screen or
inserted into a database.  I think sysread() is the way I need to go.

Any help greatly appreciated.

-jason


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




ODBC or ADO or NO WAY

2001-11-19 Thread patrick

hey there !
after that first round of insight
i'm  back for more !

this time, i don't know what module
to use, to access a microsoft access database

preferably with recordset capabilities intact ?

^_^

i can do it !

thank you very very very much !

--
p a t r i c k  d u n i g a ng r a p h i c  a r t i s tw e b  d e v e
l o p e r
email : [EMAIL PROTECTED]
aol IM : theclutchbuster
--





-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




using perl-command line not working

2001-11-19 Thread Moulas, Lionel

Hi.
First post here, simple question.

Trying, under the msdos command line (WinNT, "cmd"), 
perl -e ' print "@INC"'

I get the message 
Can't find string terminator "'" anywhere before EOF at -e line 1.

I`m using Win NT, ActivePerl 5.6.1.629.
I haven`t used Perl for months, I feel I have a lot to cover again...Time to
put back my Perl cap.
Any suggestions welcome!
PS: yeah, I know about the Oreilly books. Got some. About 800 miles from my
current home, one of my problems. A bit late with my readings..

Have a good day!



*
The information in this internet E-mail is confidential and is intended 
solely for the addressee. Access, copying or re-use of information in it 
by anyone else is unauthorized. Any views or opinions presented are 
solely those of the author and do not necessarily represent those of
Credit Lyonnais or any of its affiliates. The information contained herein
is recorded for business purposes and use of services is monitored to
protect both the company and its individual users. If you are not the 
intended recipient please contact [EMAIL PROTECTED]
*



RE: using perl-command line not working

2001-11-19 Thread Bob Showalter

> -Original Message-
> From: Moulas, Lionel [mailto:[EMAIL PROTECTED]]
> Sent: Monday, November 19, 2001 12:15 PM
> To: '[EMAIL PROTECTED]'
> Subject: using perl-command line not working
> 
> 
> Hi.
> First post here, simple question.
> 
> Trying, under the msdos command line (WinNT, "cmd"), 
> perl -e ' print "@INC"'
> 
> I get the message 
> Can't find string terminator "'" anywhere before EOF at -e line 1.

Windoze has a brain-dead shell. Try something like this:

   perl -e "print qq[@INC]"

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: using perl-command line not working

2001-11-19 Thread Wagner-David

From msdos prompt, I get the same error. I tried:

perl -e "print @INC"

and it worked.  On ksh shell under w2k, your oneliner worked as it should. One 
of the Perl Guru's can give us the whys', but this is a work around.

Wags ;)

-Original Message-
From: Moulas, Lionel [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 19, 2001 09:15
To: '[EMAIL PROTECTED]'
Subject: using perl-command line not working


Hi.
First post here, simple question.

Trying, under the msdos command line (WinNT, "cmd"), 
perl -e ' print "@INC"'

I get the message 
Can't find string terminator "'" anywhere before EOF at -e line 1.

I`m using Win NT, ActivePerl 5.6.1.629.
I haven`t used Perl for months, I feel I have a lot to cover again...Time to
put back my Perl cap.
Any suggestions welcome!
PS: yeah, I know about the Oreilly books. Got some. About 800 miles from my
current home, one of my problems. A bit late with my readings..

Have a good day!



*
The information in this internet E-mail is confidential and is intended 
solely for the addressee. Access, copying or re-use of information in it 
by anyone else is unauthorized. Any views or opinions presented are 
solely those of the author and do not necessarily represent those of
Credit Lyonnais or any of its affiliates. The information contained herein
is recorded for business purposes and use of services is monitored to
protect both the company and its individual users. If you are not the 
intended recipient please contact [EMAIL PROTECTED]
*

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: stupid question

2001-11-19 Thread Michael D. Risser

On Saturday 17 November 2001 05:56 am, John W. Krahn rambled:
> Chris And Madonna Stalnaker wrote:
> > I have to start somewhere,
>
> When you read from STDIN on a terminal or console the line ends with a
> newline (\n) so you have to remove it.

Actually you don't HAVE to remove it, the vast majority of the time it is not 
wanted, so chomp() is used to remove it, but it is not strictly necessary. 
The presence or absence of the newline character would not affect whether or 
not the script itself works, but you may not end up with the values you 
expected.

> > This works:
> >
> > print "Enter your name: ";
> > $text = ;
>
> chomp( $text =  );
>
> > print "\nHello $text\n";
> > print "Please enter your password: ";
> > $password = ;
>
> chomp( $password =  );
>
> > if ($password == 21)
> > {
> > print"Correct\n";
> > }
> > else
> > {
> > print "wrong\n";
> > }
> >
> > This doesn't:
> >
> > print "Enter your name: ";
> > $text = ;
>
> chomp( $text =  );
>
> > print "\nHello $text\n";
> > print "Please enter your password: ";
> > $password eq ;

eq is a comparison (specifacally for strings/characters, use == for numeric 
values) operator, you probably wanted to assign  to $password, so this 
should have been written $password = 

> chomp( $password =  );
>
> > if ($password eq qwert)

Perl doesn't know what to do with qwert here since its not quoted i.e. 
'qwert' or "qwert" ;-)

> if ($password eq 'qwert')

Here eq is doing its job :-)

> > {
> > print"Correct\n";
> > }
> > else
> > {
> > print "wrong\n";
> > }
> >
> > Why?
> >
> > if anyone replies Thank you, (flames expected!!)
>
> You're welcome.
>
>
> John

-- 
Michael D. Risser
Software Engineer/Linux Administrator
=
Machine Vision Products, Inc.
www.visionpro.com
[EMAIL PROTECTED]
-BEGIN PGP PUBLIC KEY BLOCK-
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

mQGiBDuCrxARBADE9hdFrBY4oQG8dnGZo6HV1pPXdiS1yVhDA1Hp0nTcmhsAdBtu
udBPkwwrVKATJYWQsRYBwbjE9WhyeGKXW95BkeUfDQo6YJBGBaeZSnfJhugdnoEv
+UB3c7McRenM6dN0oeDBWhcylTMpdUEbM9BG3pHUrKIh/TECDESWsS2PRwCgkGMy
HTSPVa3xzwAyt4C5FPINSkcEALHAysCwpYou3n1BOjjIR/lc2Wg9jMDxCL5Kf5qh
JIfvPu5Ew/NjkcTtoUrF8Ag4++3/D9jaHpFiUvp5xKtd/CjI+zQmWYvan3Qa5D6D
ZXNAvQzDpHMQ0PNed4lD6+a2unfMI22yh57WZ51nKajSGi3kbRd+564ZdM3BC3tU
30eaA/9uwrGaTCKUpku9Q7xOXRUTQOzPKMuUkGrHK84Fea8BhRYm3P/im6+mgKPu
OeAZuxTX3KD8WyTz3wPc3C9RVkcOeii90r8AbztYFa3jq7ryAxXuIAJClDyvmVxz
0i0/QsUG7Qmh3bSqSEE8j0wS1d+oCK0vys/kzPQu4BlSIZYlArQ9TWljaGFlbCBE
LiBSaXNzZXIgKFNvZnR3YXJlIEVuZ2luZWVyKSA8bWljaGFlbEB2aXNpb25wcm8u
Y29tPohXBBMRAgAXBQI7gq8QBQsHCgMEAxUDAgMWAgECF4AACgkQ/ikO9QMSg3cj
CwCfUw/OvLdfH3J6wDkgJkgwIZdJgmgAn1PAfxKjgiFXcteIpUtN6s988k1CuQEN
BDuCrxIQBADw8yDbbWdO9pvyUpdWjWxTBBFo9eQexJFFap4b9KcpWDJWawZ6S/HU
Cn+7zfbFb43AZa21mlon/vr7nwvlll7P/fa9S4kvk5twM8PcwM9O9yVxhOZeInXR
NUBzqjpK8FfRZgt1TaOz/CpdacNAJ9i2cShvH6wcCbHxGL9rjAu+IwADBgQA0t8p
1ivBcABEmK4o+r5+uXZoQ4jUzDDN5bZmddQOQhyyMX/JUeBX7gxQ7r2cYJHIlcN+
FCeqUHLmgQ/Ky+gze61Yr+FeEBJ4EPklkHWu3RoS4aKlEtU688nm+8Mfph6nYl+n
HzmaZjf5hz/mqvs5bzBCrw+xSSjNhJBrmj8qzIqIRgQYEQIABgUCO4KvEgAKCRD+
KQ71AxKDd2/JAJ9vnTOSbmB2XceA4gBaOsZg06s5lQCfYfRtXoy/Mbw82eS19NE/
w9t+V8g=
=J9H/
-END PGP PUBLIC KEY BLOCK-

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Install DBD with CPAN

2001-11-19 Thread Michael D. Risser

On Saturday 17 November 2001 05:31 am, Rietsch Thierry rambled:
--SNIP--
> Failed to determine directory of mysql.h. Use
>
>   perl Makefile.PL --cflags=-I
>
> to set this directory. For details see the INSTALL.html file,
> section "C Compiler flags" or type
>
>   perl Makefile.PL --help
> Running make test
>   Make had some problems, maybe interrupted? Won't test
> Running make install
>   Make had some problems, maybe interrupted? Won't install
> --
>
> Did anybody now what i must do?
> System: OpenBSD 2.9
>
> Thanks Thierry

First you need to make sure you have MySQL installed, or at least the 
development libraries ;-) Makefile is searching for MySQL's 'main' header 
file. If you have MySQL installed then you need to chek for the location of 
mysql.h, Makefile is looking in standard places for it, so  your's is 
probably not in a standard place. 

How to fix this really depends on the platform you are running on. Under 
Linux you would want to edit /etc/ld.so.conf and add the path to MySQL's
lib directory then run /sbin/ldconfig.

Or you can edit Makefile.pl to point to the right place to look for MySQL.

There may be other ways, but these have worked for me ;-)
-- 
Michael D. Risser
Software Engineer/Linux Administrator
=
Machine Vision Products, Inc.
www.visionpro.com
[EMAIL PROTECTED]
-BEGIN PGP PUBLIC KEY BLOCK-
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

mQGiBDuCrxARBADE9hdFrBY4oQG8dnGZo6HV1pPXdiS1yVhDA1Hp0nTcmhsAdBtu
udBPkwwrVKATJYWQsRYBwbjE9WhyeGKXW95BkeUfDQo6YJBGBaeZSnfJhugdnoEv
+UB3c7McRenM6dN0oeDBWhcylTMpdUEbM9BG3pHUrKIh/TECDESWsS2PRwCgkGMy
HTSPVa3xzwAyt4C5FPINSkcEALHAysCwpYou3n1BOjjIR/lc2Wg9jMDxCL5Kf5qh
JIfvPu5Ew/NjkcTtoUrF8Ag4++3/D9jaHpFiUvp5xKtd/CjI+zQmWYvan3Qa5D6D
ZXNAvQzDpHMQ0PNed4lD6+a2unfMI22yh57WZ51nKajSGi3kbRd+564ZdM3BC3tU
30eaA/9uwrGaTCKUpku9Q7xOXRUTQOzPKMuUkGrHK84Fea8BhRYm3P/im6+mgKPu
OeAZuxTX3KD8WyTz3wPc3C9RVkcOeii90r8AbztYFa3jq7ryAxXuIAJClDyvmVxz
0i0/QsUG7Qmh3bSqSEE8j0wS1d+oCK0vys/kzPQu4BlSIZYlArQ9TWljaGFlbCBE
LiBSaXNzZXIgKFNvZnR3YXJlIEVuZ2luZWVyKSA8bWljaGFlbEB2aXNpb25wcm8u
Y29tPohXBBMRAgAXBQI7gq8QBQsHCgMEAxUDAgMWAgECF4AACgkQ/ikO9QMSg3cj
CwCfUw/OvLdfH3J6wDkgJkgwIZdJgmgAn1PAfxKjgiFXcteIpUtN6s988k1CuQEN
BDuCrxIQBADw8yDbbWdO9pvyUpdWjWxTBBFo9eQexJFFap4b9KcpWDJWawZ6S/HU
Cn+7zfbFb43AZa21mlon/vr7nwvlll7P/fa9S4kvk5twM8PcwM9O9yVxhOZeInXR
NUBzqjpK8FfRZgt1TaOz/CpdacNAJ9i2cShvH6wcCbHxGL9rjAu+IwADBgQA0t8p
1ivBcABEmK4o+r5+uXZoQ4jUzDDN5bZmddQOQhyyMX/JUeBX7gxQ7r2cYJHIlcN+
FCeqUHLmgQ/Ky+gze61Yr+FeEBJ4EPklkHWu3RoS4aKlEtU688nm+8Mfph6nYl+n
HzmaZjf5hz/mqvs5bzBCrw+xSSjNhJBrmj8qzIqIRgQYEQIABgUCO4KvEgAKCRD+
KQ71AxKDd2/JAJ9vnTOSbmB2XceA4gBaOsZg06s5lQCfYfRtXoy/Mbw82eS19NE/
w9t+V8g=
=J9H/
-END PGP PUBLIC KEY BLOCK-

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: File::Find

2001-11-19 Thread Peter Scott

At 06:05 AM 11/19/01 -0800, Jean-Paul Miéville wrote:
>I don't understand the difference between these two functions: find and
>finddepth in module File::Find. I don't understand the explanation in
>perldoc. My experience shows that finddepth is about 50% faster than find.
>Why ?

A depth-first search means that all subdirectories are visited before their 
parent directories.  There are advantages to this ordering for certain 
tasks.  Given this hierarchy:

$ ls -lR top
top:
total 4
drwxrwxr-x3 peterpeter4096 Nov 19 10:50 second
-rw-rw-r--1 peterpeter   0 Nov 19 10:50 topfile

top/second:
total 4
-rw-rw-r--1 peterpeter   0 Nov 19 10:50 secondfile
drwxrwxr-x2 peterpeter4096 Nov 19 10:50 third

top/second/third:
total 0
-rw-rw-r--1 peterpeter   0 Nov 19 10:50 thirdfile

Then here is the difference between the orderings: notice that while the 
subdirectories are processed before their parents with finddepth, the 
ordinary files are processed before the subdirectories.  It's never been a 
problem for me but somehow it seems wrong *shrug*:

$ perl -MFile::Find -le 'find(sub {print $File::Find::name}, "top")'
top
top/topfile
top/second
top/second/secondfile
top/second/third
top/second/third/thirdfile

$ perl -MFile::Find -le 'finddepth(sub {print $File::Find::name}, "top")'
top/topfile
top/second/secondfile
top/second/third/thirdfile
top/second/third
top/second
top

I don't honestly know why finddepth should be faster.
--
Peter Scott
Pacific Systems Design Technologies
http://www.perldebugged.com


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: -onChange

2001-11-19 Thread Jeff 'japhy' Pinyan

On Nov 19, Jerry Preston said:

>Trying to learn how to "-onChange", where can I find some good doc and
>examples?

You're barking up the wrong tree.  onChange is a javascript event.

-- 
Jeff "japhy" Pinyan  [EMAIL PROTECTED]  http://www.pobox.com/~japhy/
RPI Acacia brother #734   http://www.perlmonks.org/   http://www.cpan.org/
** Look for "Regular Expressions in Perl" published by Manning, in 2002 **


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




New Coder

2001-11-19 Thread bwhite

Hey Calvary;

I am a new programmer fresh out of logic and program development school.
Immediately I have been thrown into an environment where I have to learn 6
new computer languages...one of which is PERL. Where do I start? Thanks.

Neo-Genus Multimedia Studios
Boyd White
Database Engineer
[EMAIL PROTECTED]
(903)731-9644



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: New Coder

2001-11-19 Thread Etienne Marcotte

I'll be the first to answer before 10 give you the same answer: Books

www.oreilly.com -> Learning Perl, Programming Perl, Perl Cookbook.
On the net, there are many tutorials also, try google search "perl
tutorial"

But for me a book works better,

Etienne

[EMAIL PROTECTED] wrote:
> 
> Hey Calvary;
> 
> I am a new programmer fresh out of logic and program development school.
> Immediately I have been thrown into an environment where I have to learn 6
> new computer languages...one of which is PERL. Where do I start? Thanks.
> 
> Neo-Genus Multimedia Studios
> Boyd White
> Database Engineer
> [EMAIL PROTECTED]
> (903)731-9644
> 
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

-- 
Etienne Marcotte
Specifications Management - Quality Control
Imperial Tobacco Ltd. - Montreal (Qc) Canada
514.932.6161 x.4001

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: New Coder

2001-11-19 Thread Morbus Iff

 >I am a new programmer fresh out of logic and program development school.

Ever read Code Complete by Steve McConnell?
I'd place that first on your reading list.

 >Immediately I have been thrown into an environment where I have to learn 6
 >new computer languages...one of which is PERL. Where do I start? Thanks.

Learning Perl from O'Reilly. De facto.


--
Morbus Iff ( softcore vulcan porn rulez )
http://www.disobey.com/ && http://www.gamegrene.com/
please me: http://www.amazon.com/exec/obidos/wishlist/25USVJDH68554
icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: New Coder

2001-11-19 Thread Christopher Solomon

On Mon, 19 Nov 2001, Etienne Marcotte wrote:

> I'll be the first to answer before 10 give you the same answer: Books
> 
> www.oreilly.com -> Learning Perl, Programming Perl, Perl Cookbook.
> On the net, there are many tutorials also, try google search "perl
> tutorial"
> 

Oreilly books are very good for perl learning.  I would also recommend
Elements of Programming with Perl by Andrew Johnson.  But I agree, I would
start with Learning Perl, esp since there is a new edition out.



> But for me a book works better,
> 
> Etienne
> 
> [EMAIL PROTECTED] wrote:
> > 
> > Hey Calvary;
> > 
> > I am a new programmer fresh out of logic and program development school.
> > Immediately I have been thrown into an environment where I have to learn 6
> > new computer languages...one of which is PERL. Where do I start? Thanks.
> > 
> > Neo-Genus Multimedia Studios
> > Boyd White
> > Database Engineer
> > [EMAIL PROTECTED]
> > (903)731-9644
> > 
> > --
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: New Coder

2001-11-19 Thread Peter Scott

At 12:32 PM 11/19/01 -0600, [EMAIL PROTECTED] wrote:
>Hey Calvary;

Oblique reference to salvation? :-)

>I am a new programmer fresh out of logic and program development school.

Wow, this is relatively rare in my experience... that people are being 
trained in logic and program development, I mean.  If you don't mind, can 
you supply a few more details about what courses and where?  I'm serious, I 
get asked all the time where people can learn programming prerequisite skills.

>Immediately I have been thrown into an environment where I have to learn 6
>new computer languages...one of which is PERL. Where do I start? Thanks.

What are the other 5 languages?

As to where to start with Perl: 
http://www.amazon.com/exec/obidos/ASIN/0596001320

Order the thing FedEx if necessary and you're in a hurry, it'll pay off.
--
Peter Scott
Pacific Systems Design Technologies
http://www.perldebugged.com


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: New Coder

2001-11-19 Thread Peter Scott

At 01:48 PM 11/19/01 -0500, Morbus Iff wrote:
> >I am a new programmer fresh out of logic and program development school.
>
>Ever read Code Complete by Steve McConnell?
>I'd place that first on your reading list.

I'm still excited that the OP said he came from a school whose title 
implies that they taught the kinds of things that CC covers... I would like 
to know whether this was the case.

> >Immediately I have been thrown into an environment where I have to learn 6
> >new computer languages...one of which is PERL. Where do I start? Thanks.
>
>Learning Perl from O'Reilly. De facto.

ITYM de rigeur :-)
--
Peter Scott
Pacific Systems Design Technologies
http://www.perldebugged.com


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: New Coder

2001-11-19 Thread Etienne Marcotte

>From amazon:

Collectible - Items 1 to 1 of 1 

$45.00
Seller: arwen2001 
Rating:  
Ships from: CA, United
States 

Comments: Like New - Brandnew, excellent condition, and signed by both
Randal Schwartz & Tom Phoenix

hehehe, you can get a signed version too!!!

Etienne

Peter Scott wrote:
> 
> At 12:32 PM 11/19/01 -0600, [EMAIL PROTECTED] wrote:
> >Hey Calvary;
> 
> Oblique reference to salvation? :-)
> 
> >I am a new programmer fresh out of logic and program development school.
> 
> Wow, this is relatively rare in my experience... that people are being
> trained in logic and program development, I mean.  If you don't mind, can
> you supply a few more details about what courses and where?  I'm serious, I
> get asked all the time where people can learn programming prerequisite skills.
> 
> >Immediately I have been thrown into an environment where I have to learn 6
> >new computer languages...one of which is PERL. Where do I start? Thanks.
> 
> What are the other 5 languages?
> 
> As to where to start with Perl:
> http://www.amazon.com/exec/obidos/ASIN/0596001320
> 
> Order the thing FedEx if necessary and you're in a hurry, it'll pay off.
> --
> Peter Scott
> Pacific Systems Design Technologies
> http://www.perldebugged.com
> 
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

-- 
Etienne Marcotte
Specifications Management - Quality Control
Imperial Tobacco Ltd. - Montreal (Qc) Canada
514.932.6161 x.4001

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: New Coder

2001-11-19 Thread Morbus Iff

 >>Ever read Code Complete by Steve McConnell?
 >>I'd place that first on your reading list.
 >
 >I'm still excited that the OP said he came from a school whose title
 >implies that they taught the kinds of things that CC covers... I would like
 >to know whether this was the case.

I'd be interested to know too. We have "classes" that teach that around 
here, but they're rather moronic, ie. "when to use an unless and when to 
use a negating if". Not what I'd considered covered by CC ;) ...

 >ITYM de rigeur :-)

Acronym and foreign language. Brain ... shutting ... dow..~! 


--
Morbus Iff ( softcore vulcan porn rulez )
http://www.disobey.com/ && http://www.gamegrene.com/
please me: http://www.amazon.com/exec/obidos/wishlist/25USVJDH68554
icq: 2927491 / aim: akaMorbus / yahoo: morbus_iff / jabber.org: morbus




-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: recommended perl training in UK?

2001-11-19 Thread _brian_d_foy

In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
(Randal L. Schwartz) wrote:

> > "Chris" == Chris Ball <[EMAIL PROTECTED]> writes:

> Chris> [1]: http://www.stonehenge.com/ being the most obvious example.

> Both Tom Phoenix and I have been to London.  I'd be very happy to go
> back, and maybe even work with you a bit to compensate for the
> increased travel costs.

and New York isn't so far away either.  (but then, only if
Randal lets me ;)
-- 
brian d foy <[EMAIL PROTECTED]> - Perl services for hire
CGI Meta FAQ - http://www.perl.org/CGI_MetaFAQ.html
Troubleshooting CGI scripts - http://www.perl.org/troubleshooting_CGI.html

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: pattern matching

2001-11-19 Thread Prasanthi Tenneti


Hi,
Iam unable to debug this code.
pls help me.
here is the code :

open(FILE,"build.txt") ||die "cannot open \n";
print "select which build you want to enter\n";
$build=;
while()
{
if(/$build/)
{
print "you selected $build\n";
#here it should print next 3 0r 4 lines until space comes
}
else
{
print "$build is not found\n";
}
}

If build1 is found it should print next 3 lines (or till space comes)

for ex build.txt file :
build1
rpm_1;
rpm_2;
qwe_3;

build2
qwe-1;
asd_2;
asd_3;
-Original Message-
From: Prasanthi Tenneti [mailto:[EMAIL PROTECTED]]
Sent: 18 November, 2001 12:43
To: [EMAIL PROTECTED]
Subject: pattern matching


Hi,
Iam a beginner in perl.I have one question,
Iam trying to write one prog,in which i have to search for one word in a
file,
If I found that word,print next 4 lines.
PLs help me,how to write code.
cheers,
prasa.



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: capture strings with two non-identical capital letters in a row

2001-11-19 Thread birgit kellner


--On Sonntag, 18. November 2001 17:31 -0900 Michael Fowler 
<[EMAIL PROTECTED]> wrote:

> On Fri, Nov 16, 2001 at 10:39:57PM +0100, birgit kellner wrote:
>> How can I filter out strings which contain two (or three) non-identical
>> capital letters in a row?
>>
>> my $string1 = "ABCD";
>> my $string2 = "AbCd";
>> my $string3 = "AABcD";
>>
>> Get $string1, discard $string2 and $string2.
>
> The description of what you what and what strings you wish discarded don't
> match.  You say you want to filter out strings that contain two
> non-identical capital letters; that would discard $string1 and $string3.
> $string1 contains two non-identical capital letters, "AB"; $string3
> contains two non-identical capital letters, "AB"; and to filter is to
> remove.

Thanks to all who responded; indeed, "filter out" was supposed to mean the 
opposite of "discard", *and* on top of that there was a typo in $string3, 
so apologies for the confusion.

Best regards,

Birgit Kellner

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




CGI.pm problems continued

2001-11-19 Thread birgit kellner

I have tried the following code to read a query-string from a CGI request 
into a hash, taking into account (a) multiple select fields without knowing 
the field name, (b) getting rid of names without values, and thereby, 
hopefully, (c) allowing for user input alternately through a text field or 
a select list, (d) getting rid of select fields where no selection was 
made, in which case the value will be "---".

This is the code I used:

#!/usr/bin/perl
use CGI qw(:standard);
use CGI qw(:cgi-lib);
my $q = new CGI;
my %in = &parse_form;


sub parse_form {
my %in = $q->Vars;
foreach my $key (keys %in) {
unless ($in{$key}) { delete ($in{$key});}# get rid of empty values  
if ($in{$key} eq "---") { delete ($in{$key});}# get rid of unselected 
selects 
$in{$key} =~ s/\0/~~/g; #use "~~" as separator for multiple sepects
}
return (%in)
}

The problem is that the hash key/values which are empty are not deleted, 
nor are those pairs deleted where the value is "---". I'm puzzled because 
it works with the following code (which, however, does not decode multiple 
fields nor remove empty values):

sub parse_form {
my @names = $in->param;
foreach my $name ( @names ) {
if (param($name)) {
$in{$name} = $in->param($name);}
}
foreach my $key (keys %in) {
if ($in{$key} eq "---") { # if this is a select field with no value
delete ($in{$key});
}

return(%in);
}

Any ideas why the deletion doesn't work in the first "parse_form" 
subroutine?

Birgit Kellner


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




how can i set up a simple portal?

2001-11-19 Thread Noah

I want to make a CGI that grabs the top few headlines from major (or not)
news sites such as the new york times and cnn, and places them as hyperlinks
on my web page.  I know there is a lot of stuff out there to do this, but
I'm doing this as a learning excercise, so I'd like to know if anyone has
any ideas on doing this from scratch or knows of existing code which is very
simple.

Thanks,

Noah



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




RE: NT - piping input to my perl script

2001-11-19 Thread murphy, daniel (BMC Eng)

I thought I had been abandoned, but Andrea pulled thru for me. Thanks.

What hurts is that I had a similar problem about a month ago, and solved it
this way. The mind is the second thing to go



Dan Murphy   [EMAIL PROTECTED]   
EMC Corp.508-249-3322
Hopkinton, MA  01748

EMC²
where information lives



-Original Message-
From: Andrea Holstein [mailto:[EMAIL PROTECTED]]
Sent: Saturday, November 17, 2001 3:14 PM
To: [EMAIL PROTECTED]
Subject: Re: NT - piping input to my perl script


Daniel Murphy schrieb:
> 
> OK, I've been lurking long enough. Got what I think is a very simple
> question which may be more of an NT command shell question as it is a Perl
> question.
> 
> I have a very simple script (below) which reads data from STDIN and
converts
> the supposed EBCDIC hex data to readable text (yes, I'm a mainframer).
> This works fine when I run it normally from the command line and enter
data
> from the keyboard. So, if I enter 'c1c2c3c4' when prompted, it will print
> out 'ABCD'. Piece o' cake.
> 
> Now, I was hoping to pipe data to this script from the output of a
previous
> command. For example, from NT, you can say:
> 
> type testpgm.c | more
> 
> ...which will pipe the output (STDOUT) from 'type' to the input to 'more'
> (STDIN).
> 
> OK, so I try the same thing using my script by entering:
> 
> type ebcdic.data | hexeb.pl

A long time ago, I had i similar problem under NT.
I assume that perl files are assigned to start perl.exe.
So in reality NT starts first the assignment and the perl.
All in and output goes into this asssignment too.

What helped ?!

type ebcdic.data | perl hexeb.pl
   

Hope it helps you.

Best Wishes,
Andrea

PS: As you can see, Windows has it's own imagination of piping.
That's not bad, Windows is simply not an OS for people who want to work.
It's cool for playing :-))

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: how can i set up a simple portal?

2001-11-19 Thread Kevin Meltzer

Hi Noah,

Why not use RSS? My book has a chapter on using it, or to save money you can
look at that chapter online: http://perlcgi-book.com/sample/chapter16.pdf

A good past article from perl.com:
http://www.perl.com/pub/a/2000/01/rss.html

Also, the current article on perl.com:
http://www.perl.com/pub/a/2001/11/15/creatingrss.html 

You can find some RSS content here: http://www.xmltree.com/index.html

I also think cnn.com ha(s|d) a 'backdoor' with simple text for headlines. I don't
recall the URL, maybe someone else has it.

HTH,
Kevin

On Mon, Nov 19, 2001 at 06:36:04PM -0500, Noah ([EMAIL PROTECTED]) said 
something similar to:
> I want to make a CGI that grabs the top few headlines from major (or not)
> news sites such as the new york times and cnn, and places them as hyperlinks
> on my web page.  I know there is a lot of stuff out there to do this, but
> I'm doing this as a learning excercise, so I'd like to know if anyone has
> any ideas on doing this from scratch or knows of existing code which is very
> simple.
> 
> Thanks,
> 
> Noah
> 

-- 
[Writing CGI Applications with Perl - http://perlcgi-book.com]
Who are the brain police?
-- Frank Zappa

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: how can i set up a simple portal?

2001-11-19 Thread Curtis Poe


--- Kevin Meltzer <[EMAIL PROTECTED]> wrote:
> I also think cnn.com ha(s|d) a 'backdoor' with simple text for headlines. I don't
> recall the URL, maybe someone else has it.

It may be gone.  This *used* to be that backdoor:

http://www8.cnn.com/HLN/virtual/swf.headline.txt

Cheers,
Curtis "Ovid" Poe

=
Senior Programmer
Onsite! Technology (http://www.onsitetech.com/)
"Ovid" on http://www.perlmonks.org/

__
Do You Yahoo!?
Find the one for you at Yahoo! Personals
http://personals.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Unix passwd rules

2001-11-19 Thread Daniel Falkenberg

Hi all,

I understand this is a little off topic, but it essetially this question
has alot to do with Perl. My question is what are the curent rules for a
Unix passwd? i.e How many characters?  Also has any one had anything to
do with the module Unix::PasswdFile.

I have the following code that inserts a current user into /etc/passwd.
For some unknown reason the users password is not inserted into
/etc/shadow.

my $pw = new Unix::PasswdFile "/etc/passwd";
$pw->user("$new_user", $pw->encpass("$new_pass"), $pw->maxuid + 1,
45,
"$new_fname $new_lname", "/home/$new_user", "/bin/false");
$pw->passwd("$new_user", $pw->encpass("$new_pass"));
$pw->commit();
undef $pw;

Any ideas?

Thx,

Dan

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Daemons

2001-11-19 Thread Daniel Falkenberg

Hey all,

I am working with daemons at the moment.  What I want to know is...

1 - Is it possbile for my script to report a message everytime my
program dies.  My program currently runs as a daemon.  Sometimes I get
up in the morning and the program (Perl deamon) isn't running any more.

Thx,
Dan

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Unix passwd rules

2001-11-19 Thread Elaine -HFB- Ashton

Daniel Falkenberg [[EMAIL PROTECTED]] quoth:
*>
*>I understand this is a little off topic, but it essetially this question
*>has alot to do with Perl. My question is what are the curent rules for a
*>Unix passwd? i.e How many characters?  Also has any one had anything to
*>do with the module Unix::PasswdFile.

It varies by OS and by configuration.

*>I have the following code that inserts a current user into /etc/passwd.
*>For some unknown reason the users password is not inserted into
*>/etc/shadow.

Unix::PasswdFile only deals with /etc/passwd, not /etc/shadow.

e.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Off-Topic (200%) - Where are you from?

2001-11-19 Thread Randal L. Schwartz

> "Royce" == Royce Wells <[EMAIL PROTECTED]> writes:

Royce> memphis tn

Royce> 
Royce> The information transmitted is intended only for the person or entity to
Royce> which it is addressed and may contain confidential and/or privileged
Royce> material. Any review, retransmission, dissemination or other use of, or
Royce> taking of any action in reliance upon, this information by persons or
Royce> entities other than the intended recipient is prohibited. If you received
Royce> this in error, please contact the sender and delete the material from any
Royce> computer.

You have exceeded the 4-line .sig boilerplate limit with a worthless
unenforcable disclaimer.  Please remove this text from future postings
to this mailing list.  If you cannot do so for mail from your domain,
please get a freemail account and rejoin the list from there.

Especially considering that the content of your message is 10 characters
and your disclaimer is 514 characters... a blow-up of 52 times!

Disgusting.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: recommended perl training in UK?

2001-11-19 Thread Randal L. Schwartz

> "Chris" == Chris Ball <[EMAIL PROTECTED]> writes:

Chris> [1]: http://www.stonehenge.com/ being the most obvious example.

Both Tom Phoenix and I have been to London.  I'd be very happy to go
back, and maybe even work with you a bit to compensate for the
increased travel costs.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<[EMAIL PROTECTED]> http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]