Eh: AS400 and Comsoft

2003-07-31 Thread Dennis Stout
Somebody is not using a very friendly mailinglist client.  It's pretending
this is a newsgroup, which is tricking things up...



 Sure its possible. Just go to CPAN, install the interfaces to each type of
 storage system, and then in your program connect to each data source. You
 said you will be connecting to 3 data sources, so you will have 3 objects
 representing each connection.

3?  I don't know math very well but..

An existing MySQL server, 2 new SQL servers (unknown exactly what kind of SQL
server, but the core of SQL is simply SQL..), an LDAP server, an Oracle DB,
some Comsoft thing which turns out might be an acient COBOL program, and a 25
year old IBM AS400 system and who knows what kind of db software IBM stuck on
that.  Everyone around me seems to think AS400 _is_ the database.  Bah  I
think anyone with any kind of an administrative password to the thing is
probably retired and dead now.

 There are already interfaces to the most common SQL databases. Theres also a
 perl LDAP interface. You may have to build your own interfaces for the
 Comsoft and AS/400 applications if you must access them with perl. The way
 you do this is by creating perl wrappers to the C api that comes with your
 data stores.

I don't know how to program in C.  Maybe now is a good time to learn, since my
deadline is hte 22nd of August :)

 see: perldoc perlxstut

Reading it as soon as I finsih this email.  Thanks!

 I would create a custom object that stores each object as a property. This
 will make managing the connection objects easier.

If it were up to me, I would be investing heavily in Vaseline corporation
because I know exactly where this new ticket system is going to end up

Dennis


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



Re: MVC - the 'meme drift'

2003-07-31 Thread Ovid
--- drieux [EMAIL PROTECTED] wrote:
 But I am s not sure that the history will help the discussion,
 in part, since the 'meme' has drifted and gained a sense of
 orthodoxy all out of proportion to the underlying argument
 as you note with:

drieux,

Design Patterns were originally a tool to provide a common language.  If the current 
discussion
of MVC differs significantly from the original (historical) implementation of MVC as 
described by
the Gang of Four, then we're going to have a problem if programmers do not understand 
this
distinction because a common vocabulary no longer exists.
 
In other words, we can't use common terms if we don't realize that our definitions 
differ.  For
example, arguing over whether or not change is important is pretty silly if I don't 
realize that
I am talking about a verb and the other person is talking about a noun :)

Which brings me to my next point:

 Unfortunately, at this point in history, I fear you are being
 a bit optomistic that Design Patterns were intent upon
 providing a common 'vocabulary'

(Disclaimer:  like so many others who cite the Alexander book, I've not actually read 
it.  I'm
referring to the description by M. J. Dominus.  I trust that he knows what he's 
talking about.)

Design Patterns first appeared in a book by Christopher Alexander (though I don't 
believe he used
the phrase Design Patterns).  This book was named Pattern Languages and it was 
about providing
a common language for basic architectural designs
(http://perl.plover.com/yak/design/samples/slide011.html).

Did the Gang of Four intend to borrow the concept of naming, or did they decide that 
Design
Patterns were these concrete things to be handed down and slavishly worshipped?  
Here's part of
how *they* describe Design Patterns:

  A design pattern systematically names, motivates, and explains a 
  general design that addresses  a recurring design problem in object-
  oriented systems.

In short:  GoF patterns provide a common vocabulary, just as the original Alexander 
book intended.
 Mind you, some think that the intention of the GoF was simply to hand out code 
samples and say
you must do it this way.  If you read DP, the authors make it clear that there are 
good and bad
points to every pattern.  The point of the book was to give some good strategies for 
problems and
give names to those strategies.  Today, I can quite comfortably suggest to a 
programmer use a
factory pattern and they'll slap their forehead when they realize how it solves their 
problem.  I
do not have to hand them code and say do this.  Naturally, this presupposes that the 
programmer
knows what a factory is.

But what happens when I say use an MVC pattern?  The programmer might say but I'm 
writing a CGI
script and I don't have multiple Views and Controllers that need to by synchronized 
and updated. 
If I didn't know the problem space that MVC was applied to in the book I might be 
scratching my
head over that one.

For some interesting thoughts, go read Dominus' presentation on the topic
(http://perl.plover.com/yak/design/).

I, however, am pretty much done here.  I have work to do :)

Cheers,
Ovid

=
Silence is Evilhttp://users.easystreet.com/ovid/philosophy/indexdecency.htm
Ovid   http://www.perlmonks.org/index.pl?node_id=17000
Web Programming with Perl  http://users.easystreet.com/ovid/cgi_course/

__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



Help Re-writing my if statement

2003-07-31 Thread Johnstone, Colin
Gidday All,

I would like to write this if statement better by combining the two
elsif conditions.

if( !check_url ){
  print 'p class=bodytextThe Referrer
b'.$ENV{'HTTP_REFERER'}.'/b is not allowed to access this
cgi-script!/p';
}
elsif( !check_email( $data{'toAddress'} ) ){
  print 'p class=bodytextAn email cannot be sent ' .
$data{'toAddress'} .' is not a valid email address./p';
}
elsif( !check_emailDomain( $data{'toAddress'} ) ){
  print 'p class=bodytextAn email cannot be sent ' .
$data{'toAddress'} .' is not a valid email address./p';
}
else{

}

I tried this with no success

if( !check_url ){
  print 'p class=bodytextThe Referrer
b'.$ENV{'HTTP_REFERER'}.'/b is not allowed to access this
cgi-script!/p';
}
elsif( !check_email( $data{'toAddress'} )  !check_emailDomain(
$data{'toAddress'} )  ){
  print 'p class=bodytextAn email cannot be sent ' .
$data{'toAddress'} .' is not a valid email address./p';
}
else{

}

Thanking you in anticipation

Colin Johnstone
**
This message is intended for the addressee named and may contain
privileged information or confidential information or both. If you
are not the intended recipient please delete it and notify the sender.
**

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



Re: Script for random images -- problem

2003-07-31 Thread Oliver Schnarchendorf
On Thu, 31 Jul 2003 17:58:43 -0500, David Gilden wrote:
 $PICTURE_PATH = path_translated();
 $PICTURE_URL = path_info();
 chdir $PICTURE_PATH
 or die Couldn't chdir to pictures directory: $!;
Hello David,

'perldoc CGI', '/path_translated' did return the following information:

path_translated()
   As per path_info() but returns the additional path
   information translated into a physical path, e.g.
   /usr/local/etc/httpd/htdocs/additional/stuff.

   The Microsoft IIS is broken with respect to the trans-
   lated path as well.

This means that everything will be returned INCLUDING the filename of 
your script

To solve this problem you just might want to delete everything after 
the last slash as in so:

substr $picture_path, rindex $picture_path, '/';

More information about the function used can be found by using

perldoc -f rindex
perldoc -f substr

in the terminal/shell.

BTW. It's also okay to print your variables to the screen or a log 
file, so that you can see what value is actually reached into chdir.

thanks
/oliver/


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



Re: [solved but..] Push first 9 elements

2003-07-31 Thread Pablo Fischer
Thanks Steve!

 for (whatever) {
   push @lista_final, splice(@correos_p, 0, 8);
   push @lista_final, splice(@correos_h, 0, 8);
   push @lista_final, splice(@correos_y, 0, 8);
   # etc...
 }
Thanks! Now my 'for' works very fast. Howerver, I could like to know..

for($i=0; $i($#archivo-2); $i++) {
  push @lista_final, splice(@correos_p, 0, 8);
  push @lista_final, splice(@correos_h, 0, 8);
  push @lista_final, splice(@correos_y, 0, 8);
  push @lista_final, splice(@correos_l, 0, 8);
  push @lista_final, splice(@correos_t, 0, 8);
  push @lista_final, splice(@correos_s, 0, 8);
  push @lista_final, splice(@correos_o, 0, 8);
}

However, Im using 8, cause I need to take 9 elements. But I would like to add 
them in this way:

1 of this, 1 of B, 1 of C, to complete 9 (1 element of the 7 arrays). But in 
this for Im adding them as:

9 of A, 9 of B, 9 of C, 9 of B

So, how can I start selecting one of each one? and complete 9, and again.. and 
again..

Thanks!
-- 
Pablo Fischer Sandoval ([EMAIL PROTECTED])
http://www.pablo.com.mx
http://www.debianmexico.org
GPG FingerTip: 3D49 4CB8 8951 F2CA 8131  AF7C D1B9 1FB9 6B11 810C
Firma URL: http://www.pablo.com.mx/firmagpg.txt

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



can't open dbm file - no space left on device

2003-07-31 Thread Katy Brownfield
I'm modifying an existing script that has been moved to a new domain and a 
new ISP. It opens a DBM file like this

dbmopen %fileinfo, ../data/fileinfo, 0644
   or die cannot open fileinfo: $!\n;
This fails intermittently with

[Thu Jul 31 00:46:16 2003]  [error] [client 53.259.56.55] cannot open 
fileinfo: No space left on device, referer: https://.

No filesystem was full when I checked, while the error was happening, but 
the tech support folks at the ISP found that /var was 100% full earlier 
today, cleared some space, tested the script when it wasn't failing and 
pronounced the problem solved. My skepticism was justified, because now 
it's happening again.

Is it likely that DBM puts temporary files in /var/tmp? The DBM file 
contains only a little test data. Could the device in the error message be 
something other than a filesystem? A red herring?

Could this have anything to do with something that's under my control?

I'd appreciate any insights.

Katy



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


Re: Can't figure out this warning.

2003-07-31 Thread Sudarshan Raghavan
Sachin Hegde wrote:

Hi,
There is this warning which I can't remove :
Illegal hexadecimal digit '
' ignored at test.pl line 131, FH line 23. 


It is the newline at the end



test.pl is the name of the program while FH is a file handle(read 
only). Part of my code is:

129 $ln = FH;
130 @flds = split(/ /,$ln); 


Change this to
@flds = split (' ', $ln);
perldoc -f split #Read about the difference between split (' ', ...) and 
split (/ /, ...)

131 if($flds[5] =~ /[a-zA-Z]+/)# Check for a hex number
132 {
133 $mtype = hex($flds[5]);
134 }
135 else
136 {
137   $mtype = $flds[5] + 0;
138 }
FH is a file handle for a text file whose contents are like:

3 CSVC -1 10 8 26
3 DRS -1 10 8 27
3 PAM -1 10 8 28
3 GRA -1 10 8 29
3 CQM -1 10 8 2A
3 CQR -1 10 8 2B
sincerely,
Sachin
_
Cool new emoticons. Lots of colour! 
http://server1.msn.co.in/sp03/messengerpromo/index.asp On MSN 
Messenger V6.0




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


Re: [solved but..] Push first 9 elements

2003-07-31 Thread Pablo Fischer
Ohh I found

Just to change the 8 to 1, and Im going to use one of each one, not 9 by 9.

for($i=0; $i($#archivo-2); $i++) {
  push @lista_final, splice(@correos_p, 0, 1);
  push @lista_final, splice(@correos_h, 0, 1);
  push @lista_final, splice(@correos_y, 0, 1);
  push @lista_final, splice(@correos_l, 0, 1);
  push @lista_final, splice(@correos_t, 0, 1);
  push @lista_final, splice(@correos_s, 0, 1);
  push @lista_final, splice(@correos_o, 0, 1);
}

Thanks!
Pablo
-- 
Pablo Fischer Sandoval ([EMAIL PROTECTED])
http://www.pablo.com.mx
http://www.debianmexico.org
GPG FingerTip: 3D49 4CB8 8951 F2CA 8131  AF7C D1B9 1FB9 6B11 810C
Firma URL: http://www.pablo.com.mx/firmagpg.txt

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



RE: perl/Tk

2003-07-31 Thread EUROSPACE SZARINDAR
Hi Frank, 

You should install it using the given install scripts, not doing it by hand.


Like other perl modules you should do:
perl Makefile.PL ; make ; make test; make install

Afterwards, everything will be copied at the right place and correctly
declared.

Michel


-Message d'origine-
De: Frank B. Ehrenfried [mailto:[EMAIL PROTECTED]
Date: jeudi 31 juillet 2003 00:34
À: perl group
Objet: perl/Tk


I have downloaded the perl/tk module Tk804.02 from CPAN.ORG.  I've unzipped
and untarred it and placed it and it sub-directories uner /.  But my perl
script can not find it.  I get the response Cann't locate Tk.pm in @INC.
What to do?

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



Re: perl/Tk

2003-07-31 Thread Janek Schleicher
Frank B. Ehrenfried wrote at Wed, 30 Jul 2003 15:34:01 -0700:

 I have downloaded the perl/tk module Tk804.02 from CPAN.ORG.  I've
 unzipped and untarred it and placed it and it sub-directories uner /. 
 But my perl script can not find it.  I get the response Cann't locate
 Tk.pm in @INC.  What to do?

Have you read
perldoc -q install
and
perldoc perlmodinstall


Greetings,
Janek

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



Re: [solved but..] Push first 9 elements

2003-07-31 Thread John W. Krahn
Pablo Fischer wrote:
 
 Ohh I found
 
 Just to change the 8 to 1, and Im going to use one of each one, not 9 by 9.
 
 for($i=0; $i($#archivo-2); $i++) {
   push @lista_final, splice(@correos_p, 0, 1);
   push @lista_final, splice(@correos_h, 0, 1);
   push @lista_final, splice(@correos_y, 0, 1);
   push @lista_final, splice(@correos_l, 0, 1);
   push @lista_final, splice(@correos_t, 0, 1);
   push @lista_final, splice(@correos_s, 0, 1);
   push @lista_final, splice(@correos_o, 0, 1);
 }

If you are just removing one element then you can use shift instead. 
And you are not really using $i it seems.

for ( 0 .. @archivo - 4 ) {
  push @lista_final, shift @correos_p;
  push @lista_final, shift @correos_h;
  push @lista_final, shift @correos_y;
  push @lista_final, shift @correos_l;
  push @lista_final, shift @correos_t;
  push @lista_final, shift @correos_s;
  push @lista_final, shift @correos_o;
}



John
-- 
use Perl;
program
fulfillment

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



Re: Can't figure out this warning.

2003-07-31 Thread Rob Dixon
Sudarshan Raghavan wrote:
 Sachin Hegde wrote:

  Hi,
  There is this warning which I can't remove :
 
  Illegal hexadecimal digit '
  ' ignored at test.pl line 131, FH line 23.


 It is the newline at the end

 
 
  test.pl is the name of the program while FH is a file handle(read
  only). Part of my code is:
 
  129 $ln = FH;
  130 @flds = split(/ /,$ln);


 Change this to
 @flds = split (' ', $ln);
 perldoc -f split #Read about the difference between split (' ', ...) and
 split (/ /, ...)

 
  131 if($flds[5] =~ /[a-zA-Z]+/)# Check for a hex number
  132 {
  133 $mtype = hex($flds[5]);
  134 }

Also your check for a hex number is wrong - it will be successful if the
string contains at least one alpha character. Change this for

  if ($flds[5] =~ /^[a-z0-9]+$/)

or

  if ($flds[5] =~ /^[[:xdigit:]]+$/)

or

  if ($flds[5] !~ /[^[:xdigit:]]/)

Cheers,

Rob







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



Re: Printing an Array

2003-07-31 Thread Rob Dixon
Josimar Nunes De Oliveira wrote:
 Hi,
 Pablo, you should write this at line of IF command:
 if($count0  $count$#archivo) {
 I hope you get the right thing you want.

Hi Pablo.

Josimar's right, and it also looks like you're not
using 'strict'? You may prefer the following, which
avoids the $count variable altogether, and uses
the IO::Handle module to avoid the cryptic $|=1

Cheers,

Rob


  use strict;
  use warnings;

  my @archivo;

  use IO::Handle;
  autoflush STDOUT;

  foreach my $i (@archivo[1 .. $#archivo-1]) {

my ($correo, $clave, $nombre, $registro, $id, $sexo, $password) = split(/\|/, $i);
my ($user, $host) = split(/\@/, $correo);

print $host, \n;

sleep 1;
  }




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



Need help on modules

2003-07-31 Thread Pandey Rajeev-A19514
Hi,

I want to create a module, say ABC.pm.
I dont want to build and install the module.

I want to use a function xyz() of the module ABC in some other script.
AND, I want to call the function as 
xyz();
instead of
ABC::xyz();

Can anyone tell me how to do that without installing the module ?
Is it sufficient to push the Module path in @INC ?

Regards
Rajeev

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



Re: Need help on modules

2003-07-31 Thread Sudarshan Raghavan
Pandey Rajeev-A19514 wrote:

Hi,

I want to create a module, say ABC.pm.
I dont want to build and install the module.
Not sure what you mean by this.

I want to use a function xyz() of the module ABC in some other script.
AND, I want to call the function as 
xyz();
instead of
ABC::xyz();

This is possible as long your script has this statement
use ABC;
If ABC always exports xyz, you don't have to do anything extra. If you 
have to explicitly ask for xyz from ABC, change the use statement to
use ABC qw(xyz);

perldoc perlmod
perldoc perlmodlib
Look for information about @EXPORT and @EXPORT_OK


Can anyone tell me how to do that without installing the module ?

Clarification needed?

Is it sufficient to push the Module path in @INC ?

The module must be installed somewhere before you can push the module 
dir into @INC and use it.

Regards
Rajeev
 



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


Re: I'm a Nebie to PERL

2003-07-31 Thread Rob Dixon
Li Ngok Lam wrote:
 - Original Message -
 From: Rob Dixon [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, July 31, 2003 5:44 AM
 Subject: Re: I'm a Nebie to PERL


 [snap]
It ran and just listed the contents of the helloworld.pl file.  PERL ran but
the .pl program didn't.
   
Any idea how to get this to work?
   
  
   First, your Perl is not a complete version of Perl. You just have the
   compiler of Perl.
 
  You can't install 'just the compiler'. The compiler and interpreter are
  inseperably joined at the hip.

 Sorry, I am just trying to focusing on the missing parts, something like
 how to run a perl script without installing Perl... That's not a complete
 Perl.

I've since realised that you meant  'just the compiler/interpreter' without
the standard modules, in which case my comment is wrong. My apologies.

 
   You almostly missed some very important modules such as strict, warnings,
   CGI..etc.
 
  I doubt that strict.pm or warnings.pm would be missing, and there's no indication
  of that from what Kenneth says. Besides, CGI is of very little importance outside
  the web hosting world.

 Hmm.. I have Oracle 9.2 too, and I found there no else more modules are
 bundled.

Well if you have the same Oracle installed then you know a lot more than I do! And it 
also
explains why you were suggesting that Kenneth's installation had no starndard stuff. 
But I'm
still surprised if even strict.pm isn't there. Have you done a search for a file 
called 'strict*'
under the /perl directory? If there are no supporting files then what on earth does 
Oracle
install Perl for? It's almost useless for writing programs!

 
   And second, your Perl is out of dated. for Win32 OS, Perl is up to 5.8.0
   now. So go to
   http://www.activestate.com/Products/Download/Register.plex?id=ActivePerl
   to download the newest, complete version of Perl.
 
  Several installations of V4.1 are working fine. Also, reinstalling a later
  version of Perl in a different place (or even the same place) may well upset
  Oracle.
 

 My opinion is on the Hello World level. The point is no more Oracle, or
 Apache or whatever, but Perl herself. If the simplest perl line can't run
 correctly,
 Whatelse could be on the furture ? Again, that's my opinion. =)

Yes, precisely. And any version of Perl should be able to run a 'Hello World'
program. I was worried that a second installation may upset something
that's currently running. (I like 'Perl herself' by the way!  It seems very
appropriate that Perl is a lady - I'm sure Larry would approve!)

   If you use all default settings of Perl, your Perl is installed at C:\Perl.
   Also, some parameters (PATH) is stored to Windows too (After
   reboot). So to run your script,
   just start like :
 
  Do you mean the default for the ActiveState version? Anyway there's no
  reason in general for the installation path to cause problems.
 

 Yes, and Yes, in general.

 If one can tell the path or adding path correctly, then no problem in any
 case
 for sure. So, my starting point is for the simplest, defaultest starting.
 Breaking
 down the problem's combinations.

Yes, and I agreed that checking that the Perl executable was on the path
was the right thing to do.

 Sorry if my comments are not Pro enough.

This is a beginners' list, and whatever level you're at I think it helps you to try
to solve other people's proplems: you can learn very quickly that way. My
comments were made only to correct what I saw as possible mistakes in
your post.

 But on the way I starting Perl, unlink Delphi, Turbo C
 Perl is just looking like an silence army, stand
 by for action, but nothing more is signaled.
 All the way I was trying, was to make
 the Hello World get success, at my very beginning start time =)

I like that too - is it a quote from Sun Tzu?  ;-)

I'm still puzzled as to how Kenneth managed to get a listing of his
program out of a Perl command. Let us know how you're getting
on Kenneth, if you're still watching this thread.

Cheers,

Rob






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



Re: Need help on modules

2003-07-31 Thread Rob Dixon

Pandey Rajeev-A19514 [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi,

 I want to create a module, say ABC.pm.
 I dont want to build and install the module.

 I want to use a function xyz() of the module ABC in some other script.
 AND, I want to call the function as
 xyz();
 instead of
 ABC::xyz();

 Can anyone tell me how to do that without installing the module ?
 Is it sufficient to push the Module path in @INC ?

The current directory '.' is a member of @INC, so if you
simply write your Perl module file in same directory as
the calling program it will work fine (as long as you don't
use a module name that already exists amongst the installed
modules). Try the following files. It should be easy enough
to expand from there to what you want.

** FILE ABC.pm

  package ABC;
  use strict;

  require Exporter;

  our @ISA = qw/ Exporter /;

  our @EXPORT = qw/ xyz /;

  sub xyz {
print ABC::xyz() called\n;
  }

** FILE xyz.pl

  use strict;
  use warnings;

  use ABC;

  xyz();

** OUTPUT

  ABC::xyz() called




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



Re: Reg. Exp. to find dir. question

2003-07-31 Thread Rob Dixon

Quenten Griffith [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED]
 Hello all I have a script that reads in a control file
 that list a dir. to
 change to inside the control file I have

 Dir: /cf/courseware

 The part of the Perl script that I run to pull in that
 info is

 # Open the control file or log
 my $control_file= /home/qgriff/FTP.CTL;
  unless ( open CTL, $control_file ) { $log-write(
 Error Could not open
 $control_file: $!);
  exit 1;
   }

 my ($site, $user, $password, $dir, $file );
 my $stanza = 0;
   while ( CTL ) {
 chop;
 #skip all comments
 next if /^\s*#/;
 #skip blank lines
 next unless length;
 #Check to see the control file has the site listed and
 pass it to $site
 if ( /^Site:\s+(\w+)/ ) {
$site = $1;
$stanza = 1;
($user, $password, $dir, $file ) = ('', '', '',
 '' );
next;
}
 if ($stanza) {
$user = $1 if /^User:\s+(\w+)/;
$password = $1 if /^Password:\s+(\w+)/;
b$dir = $1 if /^Dir:\s+(\W\w+\W\w+)/;/b
$file = $1 if /^File:\s+(.+)$/;
if ( $user  $password  $dir  $file ) {
  #Exit the loop
  $stanza = 0;

 #Submit the job for the real work
  submit_job($site, $user, $password, $dir,
 $file);
  }
}
}

 This line is what I am having an issue with $dir = $1
 if
 /^Dir:\s+(\W\w+\W\w+)/;
 That will match /your/path but it will not match /your
 or /your/path/is.

 Is there a better reg.exp. I can use that will match
 anything with a / in and everything after it so I can
 have /your our /your/path or even a dir. ten
 levels deep and it will still match it?

  /^Dir:\s+(\/\S+)/

will capture a slash and all following non-whitespace characters
after Dir: and some whitespace. This should do it for you
unless you could have spaces in the path?

By the way, use 'chomp' instead of 'chop'. The latter will
remove the last character from the string whether or not it
is a newline. The last line of a file may not be terminated
by a newline and you will lose valid data.

Cheers,

Rob



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



Re: Reg. Exp. to find dir. question

2003-07-31 Thread Rob Dixon

Rob Dixon wrote:

  This line is what I am having an issue with $dir = $1
  if
  /^Dir:\s+(\W\w+\W\w+)/;
  That will match /your/path but it will not match /your
  or /your/path/is.

  Is there a better reg.exp. I can use that will match
  anything with a / in and everything after it so I can
  have /your our /your/path or even a dir. ten
  levels deep and it will still match it?

   /^Dir:\s+(\/\S+)/

 will capture a slash and all following non-whitespace characters
 after Dir: and some whitespace. This should do it for you
 unless you could have spaces in the path?

 By the way, use 'chomp' instead of 'chop'. The latter will
 remove the last character from the string whether or not it
 is a newline. The last line of a file may not be terminated
 by a newline and you will lose valid data.

Alternatively use

  /^Dir:\s+([\/\w]+)/

which will match any mixture of word characters or slashes.

Rob



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



search for string then deleting a line

2003-07-31 Thread Distribution Lists
Can someone give me a clue

I want to search through a file for a given string, when the string is
found then delete the whole line. For example

test.user: cd9p06

search for test.user, then delete test.user: cd9p06

Thanks


-- 
http://www.e-securenetworks.net
http://www.shopper-holic.com
http://www.planet247.net
http://www.auction-holic.com

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



Re: Help please - still not understanding references I think...

2003-07-31 Thread Peter Scott
In article [EMAIL PROTECTED],
 [EMAIL PROTECTED] (Tim Musson) writes:
Thanks Peter!,
[snip]
PS my $href = $result-as_struct;
PS for my $dn (keys %$href) {
PS   print cn of $dn is $href-{$dn}{cn}[0]\n;
PS }

That is exactly what I was looking for!

PS (That's taking advantage of the fact that you can leave out - between
PS closing and opening {} or [].)

So my problem was that I was dereferencing the hash, but not the array
reference it was talking About? 

Right.

or was it that I was not using the [0]?

Same thing; in that context [0] is equivalent to -[0],
which is a dereference to extract an element.

Look for Randal Schwartz's new book on references from O'Reilly.

-- 
Peter Scott
http://www.perldebugged.com

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



Re: search for string then deleting a line

2003-07-31 Thread Steve Grazzini
On Thu, Jul 31, 2003 at 09:32:32AM -0500, Distribution Lists wrote:
 Can someone give me a clue
 
 I want to search through a file for a given string, when the string is
 found then delete the whole line. For example

There's a nice FAQ on this

% perldoc -q 'change one line'

 test.user: cd9p06
 
 search for test.user, then delete test.user: cd9p06

I'd usually use something like this:

local ($^I, @ARGV) = ('', $filename);
while () {
print unless /test\.user/;
}

Or just do it from the command-line

% perl -ni -e 'print unless /test\.user/'

-- 
Steve

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



Re: Attach inline image in mail using MIME::Parser

2003-07-31 Thread zentara
On Tue, 29 Jul 2003 14:37:51 +0530, [EMAIL PROTECTED] (Ramprasad)
wrote:

Hello all,

   I am confused at using MIME::Parser and adding attachments
When I add an attachment thru MIME::Parser it is show as a seperate 
attachment on all clients
But When I add an inline image thru a mail client I can see it in the 
body of the mail


Can anyone tell me how to attach inline using MIME::Parser
Thanks
Ram

I don't know much about images with MIME::Parser, but if you
use MIME::Lite it's easy to send inline pictures. The trick is the
cid prefix, notice the ID field for the image, and in the html, the
image name is prefixed with cid:  Something similar is needed with
MIME::Parser.

#!/usr/bin/perl -w
# Send HTML document with inline images
use strict;
use MIME::Lite;

# Create a new MIME Lite object
my $msg = MIME::Lite-new(
   From='[EMAIL PROTECTED]',
   To  ='[EMAIL PROTECTED]',
   Subject ='Hi',
   Type='multipart/related');

# Add the body to your HTML message
$msg-attach(Type = 'text/html',
Data = qq{ BODY BGCOLOR=#FF
H2Hi/H2
P ALIGN=left
This is an HTML message.
/P
P ALIGN=left
A HREF=http://foo123.com/;Here's a link/A.
/P
P ALIGN=middle
IMG SRC=cid:2uni2.jpg;
/P
/BODY });

# Attach the image
$msg-attach(Type = 'image/jpg',
   Id   = '2uni2.jpg',
   Path = '2uni2.jpg');

# Send it
$msg-send();






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



config nightmares

2003-07-31 Thread Hodge, Jeff F (ECIII)
Things are just not working together.  Originally I had perl 5.6.1/
apache1.3/mysql4.0.12/ mason1.22/and various mod's.  At one point I thought
that I had mod-perl installed but it seems as if I had some selected
modules and not mod-perl itself installed.  

I upgraded to perl 5.8 and realized that mod-perl needs to be installed
specifically with apache and things appeared to be better.  Then I ran the
apache::bundle from cpn and it installed various mods with some
exceptions...but not all of the mod's.  All in all I don't think perl is
installed/config properly and its causing problems with my mod_perl/apache
install and causing the mod installs to bomb.

So my question is how does perl 5.8 have to be installed; ie what
configurations need to be set before make...in order to install
mod_perl1/apache1.3.

Also I want to upgrade MySql to v 4.0.14 bc .12 is supposed to be doing some
freaky ordering things that were resolved in .14...Should this be done
before I start on the Perl/mod/apache/mason?

Since everything is basically needed to be reinstalled, I'm thinking about
just going to modperl2/apache2...although still unsure; but now would be the
time to do so.  Is this a better route?


rrr...and I suppose while I'm at it I should re-build mason after all is
said and done 

tks

-Jeff

-Original Message-
From: Wiggins d'Anconia [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 30, 2003 6:12 PM
To: Hodge, Jeff F (ECIII)
Cc: [EMAIL PROTECTED]
Subject: Re: installing perl mod's


Hodge, Jeff F (ECIII) wrote:
 
 I'm having trouble installing certain modules...they bomb out during the
 make processsee attachments.  
 
 perl -MCPAN -e 'install Apache::Cookie'
 perl -MCPAN -e 'install DBD::mysql'
 
 
 This should work other modules where installed and work fine using the
same
 methodology.  What do I have to do to get these installed?
 
 thanks,
 
 Jeff
 
 
  dbd_failed_install.txt  apache_cookie.txt 
 
 
snip install output

In the first case the installer is looking for the 'mysql_config' 
program so that it can ask it questions about your environment, probably 
along the lines of where the libraries/includes are for mysql. Do you 
have the mysql client installed?  If so did you install the development 
packages as well if you didn't install from source?  If so where on your 
system is the program 'mysql_config'?  On my RH9.0 install it is in 
/usr/bin


In the second case it appears that 'mod_perl' is a prerequisite, do you 
have it installed?  Where is it located?

http://danconia.org


Re: I'm a Nebie to PERL

2003-07-31 Thread Li Ngok Lam
 I'm still puzzled as to how Kenneth managed to get a listing of his
 program out of a Perl command. Let us know how you're getting
 on Kenneth, if you're still watching this thread.

Hi Rob and Kenneth,

I still watching in this thread, but I am not sure did I missed something in
this thread. Because I host my domain and the server had shut down for 
electricity out today.

Kenneth did give me a personal reply and told me he don't want to download
the Perl from activestate because it have to be charged. And my reply was telling 
him that he might looking at something wrong, those charging stuff are KDE, 
making Perl to exe and something like that, but not Perl. Perl is FREE in all versions.

So, thaz more important does Kenneth still is looking in this thread, rather than
me. I am not sure if he gave me further reply or not. But I sure that if he think
have to pay for Perl and giving it up, thaz a LOSS.

Are you still here Kenneth? Feel free to go on if you need any help =)

Cheers


Email msg, controlling the Font and Size within a text message but not as an attachment

2003-07-31 Thread Wagner, David --- Senior Programmer Analyst --- WGO
I use mail::sendmail or mail::sender, but I need to be able to send the msg as 
body of text but with font/size vs default of receiver.

I am unsure where to look or what to look for.

Can it be done? If so, any pointers to or suggestions on how or simple example 
of doing such would be greatly appreciated.

Wags ;)



**
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.



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



RE: config nightmares

2003-07-31 Thread Hodge, Jeff F (ECIII)
Title: RE: config nightmares





I have attached info on my perl installation...perl -V


Does this look like its built correctly...




-Original Message-
From: Levon Barker [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 31, 2003 10:31 AM
To: Hodge, Jeff F (ECIII)
Cc: [EMAIL PROTECTED]
Subject: RE: config nightmares



Hi Jeff,


You may get a more informed response from the mod_perl mailing list.
([EMAIL PROTECTED])


But I would generally get perl installed, then worry about updating getting
a mod_perl enabled apache installed
(http://perl.apache.org/docs/1.0/guide/install.html#A_Summary_of_a_Basic_mod
_perl_Installation).


(http://perl.apache.org/docs/2.0/user/install/install.html for mod_perl2)


The database is quite independant of this process. The only thing that is
dependant is the DBI drivers for MYSQL. Get those installed after perl,
obviously.


Cheers,
Levon Barker


 -Original Message-
 From: Hodge, Jeff F (ECIII) [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, July 31, 2003 12:25 PM
 To: 'Wiggins d'Anconia'
 Cc: [EMAIL PROTECTED]
 Subject: config nightmares


 Things are just not working together. Originally I had perl 5.6.1/
 apache1.3/mysql4.0.12/ mason1.22/and various mod's. At one point
 I thought
 that I had mod-perl installed but it seems as if I had some selected
 modules and not mod-perl itself installed.

 I upgraded to perl 5.8 and realized that mod-perl needs to be installed
 specifically with apache and things appeared to be better. Then I ran the
 apache::bundle from cpn and it installed various mods with some
 exceptions...but not all of the mod's. All in all I don't think perl is
 installed/config properly and its causing problems with my mod_perl/apache
 install and causing the mod installs to bomb.

 So my question is how does perl 5.8 have to be installed; ie what
 configurations need to be set before make...in order to install
 mod_perl1/apache1.3.

 Also I want to upgrade MySql to v 4.0.14 bc .12 is supposed to be
 doing some
 freaky ordering things that were resolved in .14...Should this be done
 before I start on the Perl/mod/apache/mason?

 Since everything is basically needed to be reinstalled, I'm thinking about
 just going to modperl2/apache2...although still unsure; but now
 would be the
 time to do so. Is this a better route?


 rrr...and I suppose while I'm at it I should re-build mason after all is
 said and done

 tks

 -Jeff

 -Original Message-
 From: Wiggins d'Anconia [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, July 30, 2003 6:12 PM
 To: Hodge, Jeff F (ECIII)
 Cc: [EMAIL PROTECTED]
 Subject: Re: installing perl mod's


 Hodge, Jeff F (ECIII) wrote:
 
  I'm having trouble installing certain modules...they bomb out during the
  make processsee attachments.
 
  perl -MCPAN -e 'install Apache::Cookie'
  perl -MCPAN -e 'install DBD::mysql'
 
 
  This should work other modules where installed and work fine using the
 same
  methodology. What do I have to do to get these installed?
 
  thanks,
 
  Jeff
 
 
  dbd_failed_install.txt apache_cookie.txt
 
 
 snip install output

 In the first case the installer is looking for the 'mysql_config'
 program so that it can ask it questions about your environment, probably
 along the lines of where the libraries/includes are for mysql. Do you
 have the mysql client installed? If so did you install the development
 packages as well if you didn't install from source? If so where on your
 system is the program 'mysql_config'? On my RH9.0 install it is in
 /usr/bin


 In the second case it appears that 'mod_perl' is a prerequisite, do you
 have it installed? Where is it located?

 http://danconia.org







lamp:/dloads/perl # perl -V
Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
  Platform:
osname=linux, osvers=2.4.18-64gb-smp, archname=i686-linux
uname='linux lamp 2.4.18-64gb-smp #1 smp wed mar 27 13:58:12 utc 2002 i686 unknown 
'
config_args='-de'
hint=recommended, useposix=true, d_sigaction=define
usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
use64bitint=undef use64bitall=undef uselongdouble=undef
usemymalloc=n, bincompat5005=undef
  Compiler:
cc='cc', ccflags ='-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64',
optimize='-O3',
cppflags='-fno-strict-aliasing -I/usr/local/include'
ccversion='', gccversion='2.95.3 20010315 (SuSE)', gccosandvers=''
intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=12
ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
alignbytes=4, prototype=define
  Linker and Libraries:
ld='cc', ldflags =' -L/usr/local/lib'
libpth=/usr/local/lib /lib /usr/lib
libs=-lnsl -lndbm -lgdbm -ldb -ldl -lm -lc -lcrypt -lutil
perllibs=-lnsl -ldl 

RE: Email msg, controlling the Font and Size within a text message but not as an attachment

2003-07-31 Thread Dan Muey
   I use mail::sendmail or mail::sender, but I need to be 

You mean Mail::X , may not seem like much but Case Matters!


 able to send the msg as body of text but with font/size vs 
 default of receiver.
 
   I am unsure where to look or what to look for.

Just send an html message via Mail::Sender. 
Check out cpan to see how, Jenda has example galore!

HTH

DMuey

 
   Can it be done? If so, any pointers to or suggestions 
 on how or simple example of doing such would be greatly appreciated.
 
 Wags ;)
 
 
 
 **
 This message contains information that is confidential
 and proprietary to FedEx Freight or its affiliates.
 It is intended only for the recipient named and for
 the express purpose(s) described therein.
 Any other use is prohibited.
 
 
 
 -- 
 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]



Learning Perl vs. c ++

2003-07-31 Thread GregorioGonzalez
Hello:

I have heard that PERL is more valuable than learning C++ in terms of
IT, etc.

What is your view of the matter.

Regards, 

GREGORIO GONZALEZ:  Internet Business Developer
VERIO:  An NTT Communications Company
TOLL FREE:  877-273-3190 EXT 4672
INTERNATIONAL:  011-561-999-8599 ext: 4672 
EMAIL:  [EMAIL PROTECTED]
TECH SUPPORT: 800-339-4929 option 4
WEBSITE: http://hosting.verio.com/index.php/vps_vpscompare.html


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



Re: Learning Perl vs. c ++

2003-07-31 Thread Casey West
It was Thursday, July 31, 2003 when GregorioGonzalez took the soap box, saying:
: Hello:
: 
: I have heard that PERL is more valuable than learning C++ in terms of
: IT, etc.
: 
: What is your view of the matter.

I agree.

I'm a case-in-point.  In university I learnt C++ in the classroom,
Perl on my own time.  I've never once found a decent C++ gig, and have
been working steady using Perl ever since.  

Your milage may vary, however.

  Casey West

-- 
Shooting yourself in the foot with ASP
You try to shoot yourself in the foot, however the most advanced thing
you can manage is to cut your wrist.


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



RE: Learning Perl vs. c ++

2003-07-31 Thread Hanson, Rob
 I have heard that PERL is more valuable than learning C++

I guess it depends on what you are doing.  Having done web work for 8 years
now I haven't had any use for C++, and never took the time to learn it (it's
still on my to-do list).

Besides the usual CGI scripts and mod_perl scripts, I have used Perl for all
of my text processing needs.  From doing simple search/replace to
re-formatting thousands of documents.

So I guess if you plan on writing a C++ app, then you need to know it.  If
you are unsure of where you will end up in IT, then you can't go wrong with
Perl, even if you never write a single CGI script.  In a pinch you can write
Window applications (on Windows, Mac, or Unix), text processing utilities,
SQL loaders, and anything else you can imagine with Perl.

I'm not a fan of doing bulk changes manually, instead I just write a quick
10 minute script to save me an hour of time... not something you can
generally do with C++.

Rob

-Original Message-
From: GregorioGonzalez [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 31, 2003 2:10 PM
To: [EMAIL PROTECTED]
Subject: Learning Perl vs. c ++


Hello:

I have heard that PERL is more valuable than learning C++ in terms of
IT, etc.

What is your view of the matter.

Regards, 

GREGORIO GONZALEZ:  Internet Business Developer
VERIO:  An NTT Communications Company
TOLL FREE:  877-273-3190 EXT 4672
INTERNATIONAL:  011-561-999-8599 ext: 4672 
EMAIL:  [EMAIL PROTECTED]
TECH SUPPORT: 800-339-4929 option 4
WEBSITE: http://hosting.verio.com/index.php/vps_vpscompare.html


-- 
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: Help please - still not understanding references I think...

2003-07-31 Thread Tim Musson
Hey Peter, 

My MUA believes you used 
to write the following on Thursday, July 31, 2003 at 10:45:04 AM.

PS Look for Randal Schwartz's new book on references from O'Reilly.

Ah, cool, will get that soonest!

-- 
Tim Musson
Flying with The Bat! eMail v1.62q
Windows 2000 5.0.2195 (Service Pack 2)
So many cats, so few recipes.


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



RE: Learning Perl vs. c ++

2003-07-31 Thread Dan Muey
 Hello:

Howdy!

 
 I have heard that PERL is more valuable than learning C++ in 
 terms of IT, etc.
 
 What is your view of the matter.
 

Perl is super valuable for Administrator, developers, etcc...
Saying it's more valueable than c++ is like saying apples are more valuable than 
oranges.

For me, Perl has been way more valuable than c++ but I 
hardly ever have a need to use c++ and Perl does everythign I need and more.
Then again lots of stuff I use are written in c++, but I don't have to know it.

I use Perl for 99% of my programming needs because it is so powerful 
and flexible and the mailinglist is so awesome.

So basically learn all you can but no matter what learn Perl, you'll never regret it!

HTH

Dan

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



Why use symbolic refs?

2003-07-31 Thread Kipp, James
In the Advanced Perl book it gives an example of using sym ref:
--
process a command-line option such as -Ddebug_level=3 and set the
$debug_level variable. This is one way of doing it:

while ($arg = shift @ARGV){
if ($arg =~ /-D(\w+)=(\w+)/) {
 $var_name = $1; $value = $2;
 $$var_name = $value; # Or more compactly, $$1 = $2;
}
}

how is this any better than:

while ($arg = shift @ARGV){
if ($arg =~ /-D(\w+)=(\w+)/) {
 $level = $2;
   }
}
---

Or am i missing the point? I never use sym refs and just wondering why i
would ever want to

Thanks
Jim
 


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



RE: Why use symbolic refs?

2003-07-31 Thread Hanson, Rob
 Or am i missing the point?

Yeah, I think you did.

In the first example:
 $var_name = $1; $value = $2;
 $$var_name = $value; # Or more compactly, $$1 = $2;

The variable *name* is dynamic (which is usually a bad practice).

In the second:
 $level = $2;

Here the variable name is hard-coded.

This is the real point...

$x = foo;
$$x = 20;# this sets $foo
print $foo;  # prints 20
print $x;# still prints foo!.

But like I said, this is usually a bad way of doing things.  It is better to
use a hash when you have dynamic names.

Rob


-Original Message-
From: Kipp, James [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 31, 2003 2:27 PM
To: [EMAIL PROTECTED]
Subject: Why use symbolic refs?


In the Advanced Perl book it gives an example of using sym ref:
--
process a command-line option such as -Ddebug_level=3 and set the
$debug_level variable. This is one way of doing it:

while ($arg = shift @ARGV){
if ($arg =~ /-D(\w+)=(\w+)/) {
 $var_name = $1; $value = $2;
 $$var_name = $value; # Or more compactly, $$1 = $2;
}
}

how is this any better than:

while ($arg = shift @ARGV){
if ($arg =~ /-D(\w+)=(\w+)/) {
 $level = $2;
   }
}
---

Or am i missing the point? I never use sym refs and just wondering why i
would ever want to

Thanks
Jim
 


-- 
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: Learning Perl vs. c ++

2003-07-31 Thread awarsd
Hi,

I learn perl for about 3-4 slow years (meaning I am far from being
advanced), but I'm use to it.

I also don't know anything about IT stuff.

But I think learning perl before C++ would be good.
Actually the best which I had the chance to do because of my school, I
learnt perl bymyself and at my school we learnt Visual Basic
And now i have decided to go on with c++ for about a month and I found it
really easy to go jump in c++-- I can skip some chapters (less reading :-) )
personnally I think it is the best way to go at least for me.



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



Re: Learning Perl vs. c ++

2003-07-31 Thread Michael Muratet
On Thu, 31 Jul 2003 14:15:17 -0400
Casey West [EMAIL PROTECTED] wrote:

 It was Thursday, July 31, 2003 when GregorioGonzalez took the soap
 box, saying:: Hello:
 : 
 : I have heard that PERL is more valuable than learning C++ in terms
 of: IT, etc.
 : 
 : What is your view of the matter.
 
 I agree.
 
 I'm a case-in-point.  In university I learnt C++ in the classroom,
 Perl on my own time.  I've never once found a decent C++ gig, and have
 been working steady using Perl ever since.  
 
 Your milage may vary, however.
 
   Casey West

Greetings

There's an excellent article by Lincoln Stein called How perl saved the
human genome project or something like that. I'm sure it would be easy
to find with a google search. Perl has the reputation (deserved IMHO) of
being the easiest language for the non-computer scientist to learn.

Regards

Mike

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



Re: Learning Perl vs. c ++

2003-07-31 Thread Casey West
It was Thursday, July 31, 2003 when Michael Muratet took the soap box, saying:
: On Thu, 31 Jul 2003 14:15:17 -0400
: Casey West [EMAIL PROTECTED] wrote:
: 
:  It was Thursday, July 31, 2003 when GregorioGonzalez took the soap
:  box, saying:: Hello:
:  : 
:  : I have heard that PERL is more valuable than learning C++ in terms
:  of: IT, etc.
:  : 
:  : What is your view of the matter.
:  
:  I agree.
:  
:  I'm a case-in-point.  In university I learnt C++ in the classroom,
:  Perl on my own time.  I've never once found a decent C++ gig, and have
:  been working steady using Perl ever since.  
:  
:  Your milage may vary, however.
:  
:Casey West
: 
: Greetings
: 
: There's an excellent article by Lincoln Stein called How perl saved the
: human genome project or something like that. I'm sure it would be easy
: to find with a google search. Perl has the reputation (deserved IMHO) of
: being the easiest language for the non-computer scientist to learn.

http://www.samag.com/documents/s=1283/sam01020001/

  Casey West

-- 
If you don't double-click me, I can't do anything. 
  -- John Aniston, on how computers have taken over his life


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



Perl History

2003-07-31 Thread Ohad Ohad
hey All,

I need some pointers (essays, presentations whatever . . .) on Perl 
past/present/future .
I'm looking for something as little technical as possible.

10x

_
Add photos to your e-mail with MSN 8. Get 2 months FREE*. 
http://join.msn.com/?page=features/featuredemail

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


Re: Perl History

2003-07-31 Thread Casey West
It was Thursday, July 31, 2003 when Ohad Ohad took the soap box, saying:
: hey All,
: 
: I need some pointers (essays, presentations whatever . . .) on Perl 
: past/present/future .
: I'm looking for something as little technical as possible.

http://history.perl.org


  Casey West

-- 
Shooting yourself in the foot with SQL 
You cut your foot off, send it out to a service bureau and when it
returns, it has a hole in it but will no longer fit the attachment at
the end of your leg. 


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



RE: Why use symbolic refs?

2003-07-31 Thread Kipp, James

 
 
  Or am i missing the point?
 
 Yeah, I think you did.
 
 
 This is the real point...
 
 $x = foo;
 $$x = 20;# this sets $foo
 print $foo;  # prints 20
 print $x;# still prints foo!.
 
 But like I said, this is usually a bad way of doing things.  
 It is better to
 use a hash when you have dynamic names.
 
 Rob
 

Thanks. I will continue on without them :) 


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



Re: Can't figure out this warning.

2003-07-31 Thread John W. Krahn
Rob Dixon wrote:
 
 Sudarshan Raghavan wrote:
  Sachin Hegde wrote:
  
   131 if($flds[5] =~ /[a-zA-Z]+/)# Check for a hex number
 
 Also your check for a hex number is wrong - it will be successful if the
 string contains at least one alpha character. Change this for
 
   if ($flds[5] =~ /^[a-z0-9]+$/)

Also wrong.  It should be:

if ( $flds[5] =~ /^[a-f0-9]+$/i )

Or:

if ( $flds[5] =~ /^[a-fA-F0-9]+$/ )


:-)

John
-- 
use Perl;
program
fulfillment

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



Emacs and Perl syntax compile

2003-07-31 Thread Harter, Douglas
I am creating a good many perl scripts on a Unix using emacs. 

Can someone tell me what I need in my .emacs to do perl syntax compiles from
emacs?

.

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



Re: I'm a Nebie to PERL

2003-07-31 Thread Rob Dixon
Li Ngok Lam wrote:
  I'm still puzzled as to how Kenneth managed to get a listing of his
  program out of a Perl command. Let us know how you're getting
  on Kenneth, if you're still watching this thread.

 Hi Rob and Kenneth,

 I still watching in this thread, but I am not sure did I missed something in
 this thread. Because I host my domain and the server had shut down for
 electricity out today.

 Kenneth did give me a personal reply and told me he don't want to download
 the Perl from activestate because it have to be charged. And my reply was telling
 him that he might looking at something wrong, those charging stuff are KDE,
 making Perl to exe and something like that, but not Perl. Perl is FREE in all 
 versions.

But the version he already has installed is free too, and there's probably nothing
wrong with it!

 So, thaz more important does Kenneth still is looking in this thread, rather than
 me. I am not sure if he gave me further reply or not. But I sure that if he think
 have to pay for Perl and giving it up, thaz a LOSS.

 Are you still here Kenneth? Feel free to go on if you need any help =)

I also got a personal mail from Ken, saying that he had found and downloaded
Perl from ActiveState. But he also said that he had found strict.pm in his 
installation,
and I am very wary of encouraging an upgrade when it isn't necessary. Is the
build of Perl that's installed with Oracle even an ActiveState version? If
not there may be a number of differences apart from the Perl release version
which Oracle relies on in some way.

Rob



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



Re: Can't figure out this warning.

2003-07-31 Thread Rob Dixon
John W. Krahn wrote:
 Rob Dixon wrote:
 
  Sudarshan Raghavan wrote:
   Sachin Hegde wrote:
   
131 if($flds[5] =~ /[a-zA-Z]+/)# Check for a hex number
 
  Also your check for a hex number is wrong - it will be successful if the
  string contains at least one alpha character. Change this for
 
if ($flds[5] =~ /^[a-z0-9]+$/)

 Also wrong.  It should be:

 if ( $flds[5] =~ /^[a-f0-9]+$/i )


Yes. Dammit. I knew that /i should be in there when I posted, but
it never got from my head to my keyboard. Temporary synaptic
link problem :)

Thanks John.



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



Re: Can't figure out this warning.

2003-07-31 Thread John W. Krahn
Rob Dixon wrote:
 
 John W. Krahn wrote:
  Rob Dixon wrote:
  
   Also your check for a hex number is wrong - it will be successful if the
   string contains at least one alpha character. Change this for
  
 if ($flds[5] =~ /^[a-z0-9]+$/)
 
  Also wrong.  It should be:
 
  if ( $flds[5] =~ /^[a-f0-9]+$/i )
 
 Yes. Dammit. I knew that /i should be in there when I posted, but
 it never got from my head to my keyboard. Temporary synaptic
 link problem :)

Also hexadecimal doesn't use the letters g-z.


:-)

John
-- 
use Perl;
program
fulfillment

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



RE: Email msg, controlling the Font and Size within a text message but not as an attachment

2003-07-31 Thread Wagner, David --- Senior Programmer Analyst --- WGO
Dan Muey wrote:
  I use mail::sendmail or mail::sender, but I need to be
 
 You mean Mail::X , may not seem like much but Case Matters!
 
 
 able to send the msg as body of text but with font/size vs default
 of receiver. 
 
  I am unsure where to look or what to look for.
 
 Just send an html message via Mail::Sender.
 Check out cpan to see how, Jenda has example galore!
I looked at the examples and so I assume that within the html, you can add 
Font and Size.
Is this the only way to accomplish the task? I can set the the Font/Size within 
Outlook and that is what I am trying duplicate.  I would rather not use HTML since I 
don't like to receive HTML as mail.

I understand the Case matters, but all I was saying is that I use both and 
have no problems using them, but would like the ability to change the text to my 
choosing since I have column data and the amount of data will for most screens wrap.

I see Mime::Lite and looked at those examples, but again did not see anything 
related to font/size, etc.

Wags ;)
 
 HTH
 
 DMuey
 
 
  Can it be done? If so, any pointers to or suggestions
 on how or simple example of doing such would be greatly appreciated.
 
 Wags ;)
 
 
 
 **
 This message contains information that is confidential
 and proprietary to FedEx Freight or its affiliates.
 It is intended only for the recipient named and for
 the express purpose(s) described therein.
 Any other use is prohibited.
 
 
 
 --
 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]



nested pattern match

2003-07-31 Thread Raghupathy
Hi All,

  I have a text file as shown below. How do I match
patterns like the following:

Pattern to be matched:
=
#ifndef def 
..   (anything except #if)
#else def
...  (anything except #if)
#endif def


My Input Data:
=
#ifndef def
DELETE sys1..tbl1
#endif def

SELECT col1, col2, col3 
#ifndef def
   FROMsys1..tbl1 
#else def
   FROMsys1..tbl2 
#endif def
WHERE  schdid is not null

=

What I tried is below (but did not work since it
captured patterns which had #if nested within the
main pattern).

$line1 =~
m/#ifndef\s+def(.*?)#else\s+def(.*?)#endif\s+def/isg

Any suggestions Please !!!

Thanks,
Ramesh


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



RE: config nightmares

2003-07-31 Thread Levon Barker
Hi Jeff,

You may get a more informed response from the mod_perl mailing list.
([EMAIL PROTECTED])

But I would generally get perl installed, then worry about updating getting
a mod_perl enabled apache installed
(http://perl.apache.org/docs/1.0/guide/install.html#A_Summary_of_a_Basic_mod
_perl_Installation).

(http://perl.apache.org/docs/2.0/user/install/install.html for mod_perl2)

The database is quite independant of this process. The only thing that is
dependant is the DBI drivers for MYSQL. Get those installed after perl,
obviously.

Cheers,
Levon Barker

 -Original Message-
 From: Hodge, Jeff F (ECIII) [mailto:[EMAIL PROTECTED]
 Sent: Thursday, July 31, 2003 12:25 PM
 To: 'Wiggins d'Anconia'
 Cc: [EMAIL PROTECTED]
 Subject: config nightmares


 Things are just not working together.  Originally I had perl 5.6.1/
 apache1.3/mysql4.0.12/ mason1.22/and various mod's.  At one point
 I thought
 that I had mod-perl installed but it seems as if I had some selected
 modules and not mod-perl itself installed.

 I upgraded to perl 5.8 and realized that mod-perl needs to be installed
 specifically with apache and things appeared to be better.  Then I ran the
 apache::bundle from cpn and it installed various mods with some
 exceptions...but not all of the mod's.  All in all I don't think perl is
 installed/config properly and its causing problems with my mod_perl/apache
 install and causing the mod installs to bomb.

 So my question is how does perl 5.8 have to be installed; ie what
 configurations need to be set before make...in order to install
 mod_perl1/apache1.3.

 Also I want to upgrade MySql to v 4.0.14 bc .12 is supposed to be
 doing some
 freaky ordering things that were resolved in .14...Should this be done
 before I start on the Perl/mod/apache/mason?

 Since everything is basically needed to be reinstalled, I'm thinking about
 just going to modperl2/apache2...although still unsure; but now
 would be the
 time to do so.  Is this a better route?


 rrr...and I suppose while I'm at it I should re-build mason after all is
 said and done

 tks

 -Jeff

 -Original Message-
 From: Wiggins d'Anconia [mailto:[EMAIL PROTECTED]
 Sent: Wednesday, July 30, 2003 6:12 PM
 To: Hodge, Jeff F (ECIII)
 Cc: [EMAIL PROTECTED]
 Subject: Re: installing perl mod's


 Hodge, Jeff F (ECIII) wrote:
 
  I'm having trouble installing certain modules...they bomb out during the
  make processsee attachments.
 
  perl -MCPAN -e 'install Apache::Cookie'
  perl -MCPAN -e 'install DBD::mysql'
 
 
  This should work other modules where installed and work fine using the
 same
  methodology.  What do I have to do to get these installed?
 
  thanks,
 
  Jeff
 
 
   dbd_failed_install.txt  apache_cookie.txt
 
 
 snip install output

 In the first case the installer is looking for the 'mysql_config'
 program so that it can ask it questions about your environment, probably
 along the lines of where the libraries/includes are for mysql. Do you
 have the mysql client installed?  If so did you install the development
 packages as well if you didn't install from source?  If so where on your
 system is the program 'mysql_config'?  On my RH9.0 install it is in
 /usr/bin


 In the second case it appears that 'mod_perl' is a prerequisite, do you
 have it installed?  Where is it located?

 http://danconia.org



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



RE: Email msg, controlling the Font and Size within a text message but not as an attachment

2003-07-31 Thread Dan Muey
  Just send an html message via Mail::Sender.
  Check out cpan to see how, Jenda has example galore!
   I looked at the examples and so I assume that within 
 the html, you can add Font and Size. Is this the only way to 
 accomplish the task? I can set the the Font/Size within 
 Outlook and that is what I am trying duplicate.  I would 
 rather not use HTML since I don't like to receive HTML as mail.

Yes html email is a pain. But when Outlook lets you change the 
font/size for a plain text message it's only for messages you see in your mail client.

For instance if I send myself a palin text email from my work 
address to home and I see Courier New 12pt at work then at home I'll get a 10pt Arial.

If you can change the font/size and the recipients see the same size/font then:
1) they have the same font settings as you
2) it's really an html message


Make sense?

HTH

DMuey

 
   I understand the Case matters, but all I was saying is 
 that I use both and have no problems using them, but would 
 like the ability to change the text to my choosing since I 
 have column data and the amount of data will for most screens wrap.

Perhaps an html message using pre and use Perl to format the data ???

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



Re: nested pattern match

2003-07-31 Thread Rob Dixon
Raghupathy wrote:
 Hi All,

   I have a text file as shown below. How do I match
 patterns like the following:

 Pattern to be matched:
 =
 #ifndef def
 ..   (anything except #if)
 #else def
 ...  (anything except #if)
 #endif def


 My Input Data:
 =
 #ifndef def
 DELETE sys1..tbl1
 #endif def

 SELECT col1, col2, col3
 #ifndef def
FROMsys1..tbl1
 #else def
FROMsys1..tbl2
 #endif def
 WHERE  schdid is not null

 =

 What I tried is below (but did not work since it
 captured patterns which had #if nested within the
 main pattern).

 $line1 =~
 m/#ifndef\s+def(.*?)#else\s+def(.*?)#endif\s+def/isg


I thought I knew what you meant, but then I changed my mind!

If your input file is, say

statement1;
#ifdef def1
statement2;
#ifdef def2
statement3;
#else
statement4;
#endif
statement5;
#else
statement6;
#ifdef def3
statement7;
#else
statement8;
#endif
statement9;
#endif

What is it that you want to capture?

Rob



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



Quick DBI connection

2003-07-31 Thread Dan Muey
If I do 

use DBI;
my $dbh = DBI-connect('DBI:mysql:localhost','user','pass');

To connect to the mysql driver the package name is actually DBI::db not DBI.

My question is: is it always going to be DBI::db regardless of the driver?
I need ot know for some stuff I'm making that uses the name space of $dbh object.

TIA

Dan

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



Re: Reg. Exp. to find dir. question

2003-07-31 Thread Quenten Griffith
Thank you that worked, and thank you for the tip about
chomp/chop
--- Rob Dixon [EMAIL PROTECTED] wrote:
 
 Quenten Griffith [EMAIL PROTECTED] wrote in
 message

news:[EMAIL PROTECTED]
  Hello all I have a script that reads in a control
 file
  that list a dir. to
  change to inside the control file I have
 
  Dir: /cf/courseware
 
  The part of the Perl script that I run to pull in
 that
  info is
 
  # Open the control file or log
  my $control_file= /home/qgriff/FTP.CTL;
   unless ( open CTL, $control_file ) { $log-write(
  Error Could not open
  $control_file: $!);
   exit 1;
}
 
  my ($site, $user, $password, $dir, $file );
  my $stanza = 0;
while ( CTL ) {
  chop;
  #skip all comments
  next if /^\s*#/;
  #skip blank lines
  next unless length;
  #Check to see the control file has the site listed
 and
  pass it to $site
  if ( /^Site:\s+(\w+)/ ) {
 $site = $1;
 $stanza = 1;
 ($user, $password, $dir, $file ) = ('', '',
 '',
  '' );
 next;
 }
  if ($stanza) {
 $user = $1 if /^User:\s+(\w+)/;
 $password = $1 if /^Password:\s+(\w+)/;
 b$dir = $1 if
 /^Dir:\s+(\W\w+\W\w+)/;/b
 $file = $1 if /^File:\s+(.+)$/;
 if ( $user  $password  $dir  $file )
 {
   #Exit the loop
   $stanza = 0;
 
  #Submit the job for the real work
   submit_job($site, $user, $password, $dir,
  $file);
   }
 }
 }
 
  This line is what I am having an issue with $dir =
 $1
  if
  /^Dir:\s+(\W\w+\W\w+)/;
  That will match /your/path but it will not match
 /your
  or /your/path/is.
 
  Is there a better reg.exp. I can use that will
 match
  anything with a / in and everything after it so I
 can
  have /your our /your/path or even a dir. ten
  levels deep and it will still match it?
 
   /^Dir:\s+(\/\S+)/
 
 will capture a slash and all following
 non-whitespace characters
 after Dir: and some whitespace. This should do it
 for you
 unless you could have spaces in the path?
 
 By the way, use 'chomp' instead of 'chop'. The
 latter will
 remove the last character from the string whether or
 not it
 is a newline. The last line of a file may not be
 terminated
 by a newline and you will lose valid data.
 
 Cheers,
 
 Rob
 
 
 
 -- 
 To unsubscribe, e-mail:
 [EMAIL PROTECTED]
 For additional commands, e-mail:
 [EMAIL PROTECTED]
 


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



Re: Quick DBI connection

2003-07-31 Thread Casey West
It was Thursday, July 31, 2003 when Dan Muey took the soap box, saying:
: If I do 
: 
: use DBI;
: my $dbh = DBI-connect('DBI:mysql:localhost','user','pass');
: 
: To connect to the mysql driver the package name is actually DBI::db not DBI.
: 
: My question is: is it always going to be DBI::db regardless of the driver?
: I need ot know for some stuff I'm making that uses the name space of $dbh object.

Yep.

  Casey West

-- 
Shooting yourself in the foot with Modula-2
After realizing that you can't actually accomplish anything in this
language, you shoot yourself in the head.


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



RE: Quick DBI connection

2003-07-31 Thread Dan Muey

 It was Thursday, July 31, 2003 when Dan Muey took the soap 
 box, saying:
 : If I do 
 : 
 : use DBI;
 : my $dbh = DBI-connect('DBI:mysql:localhost','user','pass');
 : 
 : To connect to the mysql driver the package name is actually 
 DBI::db not DBI.
 : 
 : My question is: is it always going to be DBI::db regardless 
 of the driver?
 : I need ot know for some stuff I'm making that uses the name 
 space of $dbh object.
 
 Yep.
 
   Casey West

Thanks Casey!

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



Re: nested pattern match

2003-07-31 Thread Raghupathy
Rob,
 
   The input file you described is not correct, since
it has  
#ifdef def2
statement3;
#else
statement4;
#endif
nested within another #ifdef ... #else ... #endif.
 
 My input file is the output of 
diff -D def file1 file2 (on unix). This will
generate a file which has the following patterns and
none of the patterns can be nested within the other:

#ifdef  #else ... #endif
#ifndef  #else ... #endif
#ifdef  #endif
#ifndef  #endif

   I need to substitute the above patterns to be read
by a home grown program. 
 
   I encountered a problem due to the following
reason.
There was:

#ifndef def  #endif def-  Call it sentence1
#ifndef def ... #else def ... #endif def   - Call it
sentence2

   I tried the following line but it matched sentence1
and sentence2 together. I need to match sentence1 and
sentence2 seperately. 
$line1 =~ 
m/#ifndef\s+def(.*?)#else\s+def(.*?)#endif\s+def/isg  

For this 
#ifndef def (...1...) #else def (...2...) #endif def  

should be matched only if #if is not there within 
(...1...) and (...2...).

  Hopefully I have conveyed it more clearly.

Thanks,
Raghu



==
Raghupathy wrote:
 Hi All,

   I have a text file as shown below. How do I match
 patterns like the following:

 Pattern to be matched:
 =
 #ifndef def
 ..   (anything except #if)
 #else def
 ...  (anything except #if)
 #endif def


 My Input Data:

=
 #ifndef def
 DELETE sys1..tbl1
 #endif def

 SELECT col1, col2, col3
 #ifndef def
FROMsys1..tbl1
 #else def
FROMsys1..tbl2
 #endif def
 WHERE  schdid is not null


=

 What I tried is below (but did not work since it
 captured patterns which had #if nested within the
 main pattern).

 $line1 =~
 m/#ifndef\s+def(.*?)#else\s+def(.*?)#endif\s+def/isg


I thought I knew what you meant, but then I changed my
mind!

If your input file is, say

statement1;
#ifdef def1
statement2;
#ifdef def2
statement3;
#else
statement4;
#endif
statement5;
#else
statement6;
#ifdef def3
statement7;
#else
statement8;
#endif
statement9;
#endif

What is it that you want to capture?

Rob


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

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



Name msg from Mime::Parser

2003-07-31 Thread awarsd
Hi,

I finally got what i wanted. Anyways I would like to know how does
Mime::Parser decides of the name of the folder
here is my code (it is rough)

open(CURRMSG,c:\\message.msg);
$pop3-get($msg_id, \*CURRMSG);
close CURRMSG;
$parser = new MIME::Parser;

$parser-output_under(C:\\mail\\pop3\\info);
$parser-output_prefix($msg_id);

open(CURRMSG, C:\\message.msg) or die Cannot open message: $!\n;
my $ent = $parser-parse(\*CURRMSG);
close CURRMSG;


if ($ent-effective_type eq multipart/alternative and $ent-parts == 2 and
$ent-parts(0)-effective_type eq text/plain and
$ent-parts(1)-effective_type eq text/html) {
my $newent = MIME::Entity-build(Data =
$ent-parts(0)-body_as_string . \n\n[[HTML alternate version
deleted]]\n);
$ent-parts([$newent]);
$ent-make_singlepart;
$ent-sync_headers(Length = 'COMPUTE', Nonstandard = 'ERASE');
}
$ent-print;

as above I put the mails files in
$parser-output_under(C:\\mail\\pop3\\info);
I often get a file name such as
msg-1059691621-2628-4
I would like to know how mime::parser gives a name to the folder and if
there is a way to name it our way or at least get the name of the folder.







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



Re: nested pattern match

2003-07-31 Thread david
Raghupathy wrote:

 Rob,
  
The input file you described is not correct, since
 it has
 #ifdef def2
 statement3;
 #else
 statement4;
 #endif
 nested within another #ifdef ... #else ... #endif.
  
  My input file is the output of
 diff -D def file1 file2 (on unix). This will
 generate a file which has the following patterns and
 none of the patterns can be nested within the other:
 
 #ifdef  #else ... #endif
 #ifndef  #else ... #endif
 #ifdef  #endif
 #ifndef  #endif
 
I need to substitute the above patterns to be read
 by a home grown program.
  
I encountered a problem due to the following
 reason.
 There was:
 
 #ifndef def  #endif def-  Call it sentence1
 #ifndef def ... #else def ... #endif def   - Call it
 sentence2
 
I tried the following line but it matched sentence1
 and sentence2 together. I need to match sentence1 and
 sentence2 seperately.
 $line1 =~
 m/#ifndef\s+def(.*?)#else\s+def(.*?)#endif\s+def/isg
 
 For this
 #ifndef def (...1...) #else def (...2...) #endif def
 
 should be matched only if #if is not there within
 (...1...) and (...2...).
 
   Hopefully I have conveyed it more clearly.

still not quit sure what you need but try the following:

#!/usr/bin/perl -w

use strict;

my $code =C;
#ifdef debug
debug defined!
#endif debug

#ifndef fork
no fork
no pfork
#else fork
great os
#endif fork
C

while($code =~ /
\#if n? def
\s+
([^\n]+)
(.*?)

(?:
\#else
\s+
\1
(.*?)
)?

\#endif
\s+
\1
/gsx){

my $if   = $2;
my $else = $3 || '';

print $1:,$if;
print $1 else: ,$else if($else);
}

__END__

prints:

debug:
debug defined!
fork:
no fork
no pfork
fork else:
great os

not sure if that's what you want.

david

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



What's Better?

2003-07-31 Thread Pablo Fischer
Hi

I have 10 files, each file has 3000 lines. I have two options but I need to 
know which option is better in disk space and in cpu (the fastest one when I 
need th edata):

1. Keep the 10 files in one Zip, and When its time to use them, unzip them, 
and start parsing and processing each one.

2. Save each file in row of a table of my Database (using MySql, so I need to 
use DBI), and when Its time to use it, connect to the database, and retrieve 
row by row.

Thanks!
Pablo
-- 
Pablo Fischer Sandoval ([EMAIL PROTECTED])
http://www.pablo.com.mx
http://www.debianmexico.org
GPG FingerTip: 3D49 4CB8 8951 F2CA 8131  AF7C D1B9 1FB9 6B11 810C
Firma URL: http://www.pablo.com.mx/firmagpg.txt

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



Re: Learning Perl vs. c ++

2003-07-31 Thread Bruce Whealton, Jr.
Which one of these would be best equipped for SQL database work/designs?  If
one is a
webmaster or webmaster in training, which language would have the best means
for creating
and marinating a dynamic database driven web site?  I'm thinking in
particular of a mysql database to
create a dynamic database driven web site and application.

I could use some tools/tutorials for learning about Perl Modules... also how
to use perl for the above mentioned
tasks, specifically mysql.
Thanks so much,
Bruce

 It was Thursday, July 31, 2003 when Michael Muratet took the soap box,
saying:
 : On Thu, 31 Jul 2003 14:15:17 -0400
 : Casey West [EMAIL PROTECTED] wrote:
 :
 :  It was Thursday, July 31, 2003 when GregorioGonzalez took the soap
 :  box, saying:: Hello:
 :  :
 :  : I have heard that PERL is more valuable than learning C++ in terms
 :  of: IT, etc.
 :  :
 :  : What is your view of the matter.
 : 
 :  I agree.
 : 
 :  I'm a case-in-point.  In university I learnt C++ in the classroom,
 :  Perl on my own time.  I've never once found a decent C++ gig, and have
 :  been working steady using Perl ever since.
 : 
 :  Your milage may vary, however.
 : 
 :Casey West
 :
 : Greetings
 :
 : There's an excellent article by Lincoln Stein called How perl saved the
 : human genome project or something like that. I'm sure it would be easy
 : to find with a google search. Perl has the reputation (deserved IMHO) of
 : being the easiest language for the non-computer scientist to learn.

 http://www.samag.com/documents/s=1283/sam01020001/

   Casey West

 -- 
 If you don't double-click me, I can't do anything.
   -- John Aniston, on how computers have taken over his life


 -- 
 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]



lynx, wget, etc and timeouts

2003-07-31 Thread Charles Logan

Hello... I have written a small script that uses lynx to retrieve data from an 
external web site, then parse and format parts of that data, finally writing 
out a script for a java based application which displays the data on the 
local web page.  The perl script is called via an #exec cmd in the local html 
code, followed by the  java script that acts on the file perl has written.
While this works flawlessly 99% of the time, there are occasions where the 
remote web site is down, or at least very busy and slow to respond.  At these 
times, the loading of the local page is delayed until the remote server is 
connected and the data is received or the natural duration of a time out is 
reached.  Is there a way using lynx, or wget, or some other method to specify 
a timeout so that if the remote site doesn't respond in a specified amount of 
time, the perl script will continue on?
It will be easy enough to have the perl script create a 'data not available' 
sort or message to satisfy the java routine if a timeout occurs and the 
remote data isn't received.  It's a rare occurance, but when it happens I'd 
prefer a 'no data' message as opposed to a delay of up to 2 minutes while the 
local page waits for things to happen.  Here are the lines I presently have 
for retreiving the data:


$lynx = /usr/bin/lynx;
open(DATAIN,$lynx -source http://remotesite.com/remotedata|);
chop (@lines = DATAIN);

Any suggestions are greatly appreciated!





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