Response

2002-09-07 Thread Boris Penchev

Hi Everyone,

I think that this is a good idea ( use regular expresion ):

$str = perl editor free blind accessible;
$str =~ s/^(.*?\s.*?)\s(.*?)\s(.*?\s.*?)$/$1\n$2\n$3\n/i;
print $str;

To make this you have of course other-s way use split and others things.

Best Regards,
Boris Penchev



Re: Splitting a string

2002-09-07 Thread Janek Schleicher

Wiggins D'Anconia wrote at Sat, 07 Sep 2002 05:34:55 +0200:

 Octavian Rasnita wrote:
 Hi and thank you. It works!
 Could you explain me please in a few words what is this line doing exactly?
 I want to learn.
 
 print join \n, grep defined, ($string =~ /(.*?)|(\w+)/g);
 
 [snipped very good explanation]
 
 The grep defined is new to me in this manner but my guess is that it 
 is making sure to take out any non-string occurences in the list (that 
 is undefs).

The regexp matches either (.*?) in $1 or (\w+) in $1.
But the regexp always makes a list of both ($1,$2) foreach match.
That's why half of the list consists of undefined elements,
that have to be grepped out.

It's not really nice, but it works.


Greetings,
Janek


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




Switching to Perl

2002-09-07 Thread Timothy Campbell

About one year before Perl was invented (1987, as I understand it), I
created a text-processing language of my own, named Parse-O-Matic.  Like
Perl, it ended up being a veritable Swiss Army Knife.  However, it only has
a few thousand users and I think it's time to admit defeat and switch to
Perl.

As a beginner, I looked for a beginner's tutorial.  The first Hello world!
program advised me to use this command:

perl first.pl

That makes sense -- but I can't find perl.exe for WinXP.  I found the open
source for 5.8.0, which is nice, but I'd have to buy C++ to compile it!

I realize that the open source lets me configure my own perl.exe to suit me,
but as a beginner, I don't want to get that involved.  All I want is the
essential perl.exe (for WinXP) so I can start learning.

Can you tell me where I might find such a beast?

- Timothy Campbell
  http://www.parse-o-matic.com



Re: Switching to Perl

2002-09-07 Thread Bob Showalter

- Original Message -
From: Timothy Campbell [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, September 06, 2002 4:08 PM
Subject: Switching to Perl


 ...All I want is the essential perl.exe (for WinXP) so I can start
learning.

 Can you tell me where I might find such a beast?


Head over to http://www.activestate.com/Products/ActivePerl/



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




Regular expression

2002-09-07 Thread Octavian Rasnita

Hi all,

I am trying to match a word boundry or an end of string.
I would like something like:

/$word[\bX]/

where X is the symbol used for end of string. I know that I can use $ but I
don't think I can use it between brackets.

I've seen that \b doesn't match the end or beginning of a string.
I would like to know if there is another symbol that can match both these.

Thank you for help.


Teddy's Center: http://teddy.fcc.ro/
Mail: [EMAIL PROTECTED]



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




HOw to pass parameters to the perl script?

2002-09-07 Thread Almond


Please, 

trying to invoke perl script from the shell and have to pass parameter to it.

What is the right way to do it?

Thanks



-
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes


how to fix uninitialized value in subsitution warning

2002-09-07 Thread pelp

Hi -

I'm unsure of how to patch the following warning message,

Use of uninitialized value in substitution (s///) at work.pl line 74


Here's my code:

#!/usr/bin/perl

use strict;
user IO::File;


my $FILE = new IO::File;
my $change_on = /FChangeBar Yes/;
my $change_off = /FChangeBar No/;


$FILE - open(test.mif) or die can't open file;

while ($FILE)
{
   if ($change_on)
   {
 s/$change_on/$change_off/;
   }
}

$FILE - close;


Thanks ahead.

-pelp
-- 
http://fastmail.fm - The way email should be...

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




Unable to save changes using IO::File

2002-09-07 Thread pelp

Hi -

The problem is that I'm unable to save my changes after making
subsitutions, and I don't understand why.

Here's the code.

--

#!/usr/vendor/bin/perl
use strict;
use IO::File

my $FRAME_FILE = new IO::File;
my $change_on  = FChangeBar Yes;
my $change_off = FchangeBar No;


$FRAME_FILE - open(+test.mif) or die can't open file;

while ($FRAME_FILE)
{
   if (/$change_on/)
   {
  s/$change_on/$change_off/g;
   }
}

$FRAME_FILE - close;

--

After debugging the code myself for a bit, I don't see where the
problem could lay.

Thanks ahead!!

-- 
http://fastmail.fm
 - Taking the ail out of email! 

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




RE: Book on Perl!

2002-09-07 Thread Daniel Schwedler Kofoed

Hi,

Learning Perl is a good and easy one - here is a link to some of the perl
books:

http://www.norcom.ru/users/stone/

Cheers,
Jakob

 -Oprindelig meddelelse-
 Fra: Nitin Yogishwar [mailto:[EMAIL PROTECTED]]
 Sendt: 7. september 2002 06:55
 Til: [EMAIL PROTECTED]
 Emne: Book on Perl!



 Hi,

 Can some one tell me which is best book on Perl language for beginners.

 /nitin



 -
 Do You Yahoo!?
 Yahoo! Finance - Get real-time stock quotes



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




Re: Book on Perl!

2002-09-07 Thread ANIDIL RAJENDRAN

The 3rd edition is definitely good.
You can also try PERL BY EXAMPLE by ellie quigley.
Perl Cookbook is definitely a must.

good luck

=rajendran
Burlingame,CA

- Original Message -
From: Ebaad Ahmed [EMAIL PROTECTED]
To: Nitin Yogishwar [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Friday, September 06, 2002 10:18 PM
Subject: Re: Book on Perl!


 learning perl by Oeilly is so far great and unquestionably a good book for
 starting to learning perl, but if you need to bigen with the installation
 instructions you can get them on perl.com or perl.org or perldoc.com
 websites.

 Regards,
 Ebaad.
 - Original Message -
 From: Nitin Yogishwar [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Friday, September 06, 2002 9:54 PM
 Subject: Book on Perl!


 
  Hi,
 
  Can some one tell me which is best book on Perl language for beginners.
 
  /nitin
 
 
 
  -
  Do You Yahoo!?
  Yahoo! Finance - Get real-time stock quotes

 --
 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: Unable to save changes using IO::File

2002-09-07 Thread Bob Showalter

- Original Message - 
From: pelp [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, September 06, 2002 9:12 PM
Subject: Unable to save changes using IO::File


 Hi -
 
 The problem is that I'm unable to save my changes after making
 subsitutions, and I don't understand why.
 
 Here's the code.
 
 --
 
 #!/usr/vendor/bin/perl
 use strict;
 use IO::File
 
 my $FRAME_FILE = new IO::File;
 my $change_on  = FChangeBar Yes;
 my $change_off = FchangeBar No;
 
 
 $FRAME_FILE - open(+test.mif) or die can't open file;
 
 while ($FRAME_FILE)
 {
if (/$change_on/)
{
   s/$change_on/$change_off/g;
}
 }
 
 $FRAME_FILE - close;
 
 --
 
 After debugging the code myself for a bit, I don't see where the
 problem could lay.

Short answer: You aren't writing to the file anywhere.
Medium answer: What you're trying is the wrong approach.
Long answer: Read the FAQ article: 

   perldoc -q 'change one line'



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




Re: perlcc boot_File__Glob error (solution)

2002-09-07 Thread Bob Showalter

I wonder why there's so much traffic on this list about perlcc? Why do so
many feel the compulsion to compile their programs?

- Original Message -
From: Tony [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, September 06, 2002 9:04 PM
Subject: perlcc boot_File__Glob error (solution)


I couldn't find a better place to post this information than
beginners section so here it is:


--

If you are compiling your perl prog with perlcc and receive this error,

/tmp/ccaooDv1.o: In function `dl_init':
/tmp/ccaooDv1.o(.text+0x4d687): undefined reference to `boot_File__Glob'
collect2: ld returned 1 exit status

Or one similar to a File__Glob type error, you may want to
check your code to see if your using

while(/etc/somedirectory/*)
{
# statement
}

I was using that statement without using any glob module.

So when I finally narrowed what the error was in reference to down to
that code I figured what it wanted was a module to define the glob code
I was using.

The Fix:

I added this line above all usage instances of that code:

use File::DosGlob 'glob';

I suppose use File::Glob 'glob'
would work too but all I had is DosGlob.pm installed at the moment.

Seems that glob needs to be defined manually with perlcc but with the
perl interpreter glob is already defined.

If anyone has additional information to educate me a little more on this
'glob' issue I'd appreciate it.

Hope this helps someone.

Tony



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




Re: HOw to pass parameters to the perl script?

2002-09-07 Thread Bob Showalter

- Original Message -
From: Almond [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, September 06, 2002 3:50 PM
Subject: HOw to pass parameters to the perl script?



 Please,

 trying to invoke perl script from the shell and have to pass parameter
 to it.

 What is the right way to do it?

Program arguments will be found in the global array @ARGV. Is that what
you're asking?

$ perl -le 'print for @ARGV' foo bar baz
foo
bar
baz

see 'perldoc perlvar'



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




Re: how to fix uninitialized value in subsitution warning

2002-09-07 Thread Bob Showalter

- Original Message -
From: pelp [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, September 06, 2002 7:26 PM
Subject: how to fix uninitialized value in subsitution warning


 Hi -

 I'm unsure of how to patch the following warning message,

 Use of uninitialized value in substitution (s///) at work.pl line 74

Hmm, the code below didn't throw that warning, because:
1. It doesn't have a line 74
2. It doesn't enable warnings
3. It doesn't compile, due to the syntax error on line 4.

In general, you can take care of that warning by either:
a. Make sure the variable you're using is not undef
b. Suppress the warning by using (in Perl 5.6 or higher):

   no warnings 'uninitialized';

see 'perldoc perllexwarn' for more details.



 Here's my code:

 #!/usr/bin/perl

 use strict;
 user IO::File;

s/b 'use', not 'user'



 my $FILE = new IO::File;
 my $change_on = /FChangeBar Yes/;
 my $change_off = /FChangeBar No/;

Are the strokes part of the data you wish to match?



 $FILE - open(test.mif) or die can't open file;

 while ($FILE)

This is an endless loop, since $FILE doesn't change. Do you mean to be
reading $FILE? That won't work, since you've opened it for output above.
What are you trying to do?

 {
if ($change_on)

Why the test? $change_on is true and you never change it.

{
  s/$change_on/$change_off/;

Since $change_on and $change_off never change (no pun intended), you can
use /o modifier here to speed things up a bit.

}
 }

 $FILE - close;



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




RE: HOw to pass parameters to the perl script?

2002-09-07 Thread Beau E. Cox

perl script_name arg0 arg1 arg2...

the args are available to you in @ARGV.

Aloha = Beau.

-Original Message-
From: Almond [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 06, 2002 9:50 AM
To: [EMAIL PROTECTED]
Subject: HOw to pass parameters to the perl script?



Please,

trying to invoke perl script from the shell and have to pass parameter to
it.

What is the right way to do it?

Thanks



-
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes



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




Re: Translating fortran subroutine to perl

2002-09-07 Thread John W. Krahn

John Cichy wrote:
 
 Hello all,

Hello,

 I have a binary I*2 format data file that I would like to extract data from.
 The file comes with a discription file that contains a fortran sub to extract
 the data. For the life of me I can't figure out how to accomplish the extraction.
 The following is from the description file nad includes the fortran sub:
 
 ---begin paste
 
 2. The goes.nav is a file containing latitude/longitude data which can be
used with satellite images in this directory to pinpoint geographical
locations on goes-8 images. The file is binary  I*2 format with the
first two values being the pixel and line (x,y) size of the image.
The succeeding pairs of elements are I*2 values of latitude longitude * 100.
Compared to the goes image, the lat/lon pairs are stored by column first,
then row; i.e. all the elements in row 1 are stored, then row 2 etc until
the bottom of the image.
 
 The following is a fortran subroutine that can be used to read
 the goes.nav file:
 
  subroutine getnav(lat,lon)
 c
 c*   This routine reads goes.nav files with a maximum size of   *
 c*   2000 pixels wide and 2000 lines/records and stores *
 c*   latitude/longitude data into lat lon   *
 c*   the format of the goes.nav data is as follows  *
 c*  *
 c*   i*2  i*2   *
 c*||*
 c*VV*
 c*   record 1   x sizeysize *
 c*   record 2  lat *100   lon*100   *
 c*   record 3  lat *100   lon*100   *
 c*   record 4etc   etc  *
 c*  *
 c
 character   file_name*80
 reallat(2000,2000),lon(2000,2000)
 c
 c
 integer*2   tempstor(2)
 integer*4   buffout,record_count,xsize,ysize,,
 equivalence (buffout,tempstor(1))
 C
 C
 C  PLEASE NOTE: recl=1 in the open statment below means
 C   that the record length is 32 bits ( 4 bytes)
 C   not 8 bits (1 byte)
 open(23,file='goes.nav',access='direct',recl=1,status='old')
 READ(23,REC=1)buffout
 C
 C
 xsize=tempstor(1)
 C
 C
 ysize=tempstor(2)
 type *,' width =',xsize, ' height =',ysize
 C
 C
 record_count=1
 do =1,ysize
 do =1,xsize
 record_count = record_count + 1
 read(23,rec=record_count)buffout
  lat(,)=tempstor(1) * .01
  lon(,)=tempstor(2) * .01
 c  ...
 c   NOTE: LATITUDE VALUES OFF THE EARTH ARE 99.00
 C AND LONGITUDE VALUES ARE -256.35999 AT THIS
 C POINT IN THE SUBROUTINE
 C  ...
 end do
 end do
RETURN
END
 
 end paste


Well, my FORTRAN is a little rusty (to say the least) but I'll give it a shot.
(caveat: this is a literal translation and isn't very Perlish. YMMV)


my $file = 'goes.nav';
open FILE, $file or die Cannot open $file: $!;
$/ = \4;

my ( $xsize, $ysize ) = unpack 'ss', scalar FILE;
print  width=$xsize height=$ysize\n;

my ( @lat, @lon );
for my $ ( 1 .. $ysize ) {
for my $ ( 1 .. $xsize ) {
( $lat[$][$], $lon[$][$] ) = map $_ *= 0.01, unpack 'ss', 
scalar FILE;
}
}



John
-- 
use Perl;
program
fulfillment

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




Translating fortran subroutine to perl

2002-09-07 Thread John Cichy

Hello all,
I have a binary I*2 format data file that I would like to extract data from. The file 
comes with a discription file that contains a fortran sub to extract the data. For the 
life of me I can't figure out how to accomplish the extraction. The following is from 
the description file nad includes the fortran sub:


---begin paste

2. The goes.nav is a file containing latitude/longitude data which can be
   used with satellite images in this directory to pinpoint geographical
   locations on goes-8 images. The file is binary  I*2 format with the 
   first two values being the pixel and line (x,y) size of the image. 
   The succeeding pairs of elements are I*2 values of latitude longitude * 100.
   Compared to the goes image, the lat/lon pairs are stored by column first, 
   then row; i.e. all the elements in row 1 are stored, then row 2 etc until 
   the bottom of the image.
 
The following is a fortran subroutine that can be used to read
the goes.nav file:

 subroutine getnav(lat,lon) 
c
c*   This routine reads goes.nav files with a maximum size of   *
c*   2000 pixels wide and 2000 lines/records and stores *
c*   latitude/longitude data into lat lon   *
c*   the format of the goes.nav data is as follows  *
c*  *  
  
c*   i*2  i*2   *
c*||*
c*VV*
c*   record 1   x sizeysize *
c*   record 2  lat *100   lon*100   *
c*   record 3  lat *100   lon*100   *
c*   record 4etc   etc  *
c*  *  
 
c  
   character   file_name*80
reallat(2000,2000),lon(2000,2000)
c
c
integer*2   tempstor(2)
integer*4   buffout,record_count,xsize,ysize,,
equivalence (buffout,tempstor(1))
C
C
C  PLEASE NOTE: recl=1 in the open statment below means
C   that the record length is 32 bits ( 4 bytes)
C   not 8 bits (1 byte)
open(23,file='goes.nav',access='direct',recl=1,status='old')
READ(23,REC=1)buffout
C
C  
xsize=tempstor(1)
C
C   
ysize=tempstor(2)
type *,' width =',xsize, ' height =',ysize
C
C
record_count=1  
do =1,ysize
do =1,xsize
record_count = record_count + 1
read(23,rec=record_count)buffout  
 lat(,)=tempstor(1) * .01
 lon(,)=tempstor(2) * .01 
c  ...
c   NOTE: LATITUDE VALUES OFF THE EARTH ARE 99.00 
C AND LONGITUDE VALUES ARE -256.35999 AT THIS
C POINT IN THE SUBROUTINE
C  ...
end do
end do
   RETURN
   END   

end paste

Any help would be happily accepted...

John

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




Re: Unable to save changes using IO::File

2002-09-07 Thread John W. Krahn

Pelp wrote:
 
 Hi -

Hello,

 The problem is that I'm unable to save my changes after making
 subsitutions, and I don't understand why.
 
 Here's the code.
 
 --
 
 #!/usr/vendor/bin/perl
 use strict;
 use IO::File
 
 my $FRAME_FILE = new IO::File;
 my $change_on  = FChangeBar Yes;
 my $change_off = FchangeBar No;
 
 $FRAME_FILE - open(+test.mif) or die can't open file;
 
 while ($FRAME_FILE)
 {
if (/$change_on/)
{
   s/$change_on/$change_off/g;
}
 }
 
 $FRAME_FILE - close;


Here is one way to do it:

#!/usr/vendor/bin/perl -w
use strict;
use Tie::File

my $change_on  = qr/FChangeBar Yes/;
my $change_off = 'FchangeBar No';
my @data;

tie @data, 'Tie::File', 'test.mif' or die Cannot tie 'test.mif': $!;
s/$change_on/$change_off/g for @data;
untie @data;

__END__



John
-- 
use Perl;
program
fulfillment

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




Processing Tagged Files (Real Newbie)

2002-09-07 Thread Alexandre Enkerli

Hello all,
This one is probably very easy for most of you and it would help me a 
great deal if someone could tell me how to do it. I know there's a 
bunch of tutorials, perldocs and manuals out there, but I'm getting 
confused.

I receive files with the following line format:
tr
td nbsp;ENKA10577207
/td
td nbsp;p1234567
/td
td nbsp;Enkerli-Smith Tremblay, Alexandra Jean-Sébastien
/td
td nbsp; alexandre.jean-Sé[EMAIL PROTECTED]
/td
/tr

These are:
Permanent code
Access code
Names, First names
Email address (usually of the [EMAIL PROTECTED], but not always)

The Permanent code is made up of:
Last name's first three letters plus first name initial
day (01-31)
month+sex (month (01-12) for males, month+50 for females)
two-digit year (00-99)
extra digits (I don't know what they mean)

What I'd like to get is a tab-delimited file with the following
Permanent code
Access code
Names
First names
Sex
Age (or, at least, formatted birthdate)
Email

And then do calculations by age and sex.
Now, I've been doing this semi-manually, but I'm sure this is trivial 
to do in Perl and it looks like an ideal learning opportunity. What 
I've tried so far (with F[n]s, unpack, regexp...) doesn't really work. 
A complete script (likely a one-liner) would be wonderful.

Thanks in advance for your help.

Alexandre Enkerli
Ph.D. Candidate
Department of Folklore and Ethnomusicology
Indiana University


system function question

2002-09-07 Thread Brian Volk

Hi All,

I'm trying to write a program that will calculate the number of days 
between two dates.  I thought it would be easy enough to write... but I 
thought wrong.

One of the dates is fixed:
$start_date = system date --d 20020607;

The other date is the current date:
$todays_date = system date;

I'm not sure how to subtract the two dates to calculate the number of 
days between.  Any help would be greatly appreciated.

Thanks,

Brian


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




RE: Book on Perl!

2002-09-07 Thread HiroPro1971

The O'Reilly books are awesome, but I also enjoyed Perl: How to Program by Deitel, 
Deitel, Nieto, and McPhie.

#jlk



Nitin Yogishwar [EMAIL PROTECTED] wrote:


Hi,

Can some one tell me which is best book on Perl language for beginners.

/nitin



-
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes


__
The NEW Netscape 7.0 browser is now available. Upgrade now! 
http://channels.netscape.com/ns/browsers/download.jsp 

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/

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




Re: perlcc boot_File__Glob error (solution)

2002-09-07 Thread Tony

Well, in my case I work for a security company, and I need to close the
source to make sure that our software is secure.

- Original Message -
From: Bob Showalter [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, September 07, 2002 8:07 AM
Subject: Re: perlcc boot_File__Glob error (solution)


 I wonder why there's so much traffic on this list about perlcc? Why do so
 many feel the compulsion to compile their programs?



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




RE: Book on Perl!

2002-09-07 Thread Kowalski Pete-PKOWALS1

My personal choice is PERL BLACK BOOK

http://www.amazon.com/exec/obidos/ASIN/1576104656/hotscrcomyourgui/002-58285
00-2101637

 .:.  -Original Message-
 .:.  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
 .:.  Sent: Saturday, September 07, 2002 7:32 PM
 .:.  To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 .:.  Subject: RE: Book on Perl!
 .:.  
 .:.  
 .:.  The O'Reilly books are awesome, but I also enjoyed Perl: 
 .:.  How to Program by Deitel, Deitel, Nieto, and McPhie.
 .:.  
 .:.  #jlk
 .:.  
 .:.  
 .:.  
 .:.  Nitin Yogishwar [EMAIL PROTECTED] wrote:
 .:.  
 .:.  
 .:.  Hi,
 .:.  
 .:.  Can some one tell me which is best book on Perl language 
 .:.  for beginners.
 .:.  
 .:.  /nitin
 .:.  
 .:.  
 .:.  
 .:.  -
 .:.  Do You Yahoo!?
 .:.  Yahoo! Finance - Get real-time stock quotes
 .:.  
 .:.  
 .:.  __
 .:.  The NEW Netscape 7.0 browser is now available. Upgrade 
 .:.  now! http://channels.netscape.com/ns/browsers/download.jsp 
 .:.  
 .:.  Get your own FREE, personal Netscape Mail account today 
 .:.  at http://webmail.netscape.com/
 .:.  
 .:.  -- 
 .:.  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: system function question

2002-09-07 Thread Tim Musson

Hey Brian, 

My MUA believes you used Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.4) 
Gecko/20011126 Netscape6/6.2.1
to write the following on Saturday, September 7, 2002 at 10:00:23 PM.

BV Hi All,

BV I'm trying to write a program that will calculate the number of days 
BV between two dates.  I thought it would be easy enough to write... but I 
BV thought wrong.

BV One of the dates is fixed:
BV $start_date = system date --d 20020607;

BV The other date is the current date:
BV $todays_date = system date;

BV I'm not sure how to subtract the two dates to calculate the number of 
BV days between.  Any help would be greatly appreciated.

perldoc -q How can I compare two dates and find the difference?

-- 
[EMAIL PROTECTED]
Flying with The Bat! eMail v1.61
Windows 2000 5.0.2195 (Service Pack 2)
A life? . . Cool! Where can I download one of those?!


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




Re: HOw to pass parameters to the perl script?

2002-09-07 Thread Simon K. Chan


Hi Almond,

Along with what Bob suggested, you can also try using the module GetOpt::Long, too.  
It should be
included in the standard distribution.

HTH,

Simon

--- Almond [EMAIL PROTECTED] wrote:
 
 Please, 
 
 trying to invoke perl script from the shell and have to pass parameter to it.
 
 What is the right way to do it?
 
 Thanks
 
 
 
 -
 Do You Yahoo!?
 Yahoo! Finance - Get real-time stock quotes


=
#

Warmest Regards,
Simon K. Chan - [EMAIL PROTECTED]

Great spirits have always encountered violent opposition from mediocre minds.  - 
Albert Einstein

__
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com

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




Problems with perl and cron jobs

2002-09-07 Thread David Gerler

Hi all,
I have a script that runs an SQL query and sends an email using sendmail.
It works fine if called using a browser. The email is sent with the correct
content in the message.
If I run it using cron, I get the message but the content is not sent.
Meaning the body of the message is empty. I also get an email from cron that
contains and error message:
---
DBD::mysql::db do failed: You have an error in your SQL syntax near '' at
line 1 at /home/ezbid/www/cgi-bin/ua/includes/close_item.pl line 248.
--

Can anybody give me some insight as to why I get an error when cron
executes the script, but when I do it in a browser it works fine.

Any help is appreciated.

David Gerler
Gerler Enterprises
PO BOX 16357
Chesapeake VA 23328
http://www.GerlerEnterprises.com/

Nationwide Dial-up from $12.45
http://www.EasySitesForLess.com/




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




Re: system function question

2002-09-07 Thread Brian Volk

Thank you.  I didn't realize you could do that...  How can you find a 
list of all the questions in perldoc?

Thanks again,

Brian

Tim Musson wrote:

Hey Brian, 

My MUA believes you used Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.4) 
Gecko/20011126 Netscape6/6.2.1
to write the following on Saturday, September 7, 2002 at 10:00:23 PM.

BV Hi All,

BV I'm trying to write a program that will calculate the number of days 
BV between two dates.  I thought it would be easy enough to write... but I 
BV thought wrong.

BV One of the dates is fixed:
BV $start_date = system date --d 20020607;

BV The other date is the current date:
BV $todays_date = system date;

BV I'm not sure how to subtract the two dates to calculate the number of 
BV days between.  Any help would be greatly appreciated.

perldoc -q How can I compare two dates and find the difference?




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




Re: system function question

2002-09-07 Thread Tanton Gibbs

perldoc perlfaq
- Original Message -
From: Brian Volk [EMAIL PROTECTED]
To: Tim Musson [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Sunday, September 08, 2002 2:04 AM
Subject: Re: system function question


 Thank you.  I didn't realize you could do that...  How can you find a
 list of all the questions in perldoc?

 Thanks again,

 Brian

 Tim Musson wrote:

 Hey Brian,
 
 My MUA believes you used Mozilla/5.0 (X11; U; Linux i686; en-US;
rv:0.9.4) Gecko/20011126 Netscape6/6.2.1
 to write the following on Saturday, September 7, 2002 at 10:00:23 PM.
 
 BV Hi All,
 
 BV I'm trying to write a program that will calculate the number of days
 BV between two dates.  I thought it would be easy enough to write... but
I
 BV thought wrong.
 
 BV One of the dates is fixed:
 BV $start_date = system date --d 20020607;
 
 BV The other date is the current date:
 BV $todays_date = system date;
 
 BV I'm not sure how to subtract the two dates to calculate the number of
 BV days between.  Any help would be greatly appreciated.
 
 perldoc -q How can I compare two dates and find the difference?
 



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